nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 21.05 125 lines 2.0 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, buildPythonPackage 5, pythonOlder 6 # Mitmproxy requirements 7, asgiref 8, blinker 9, brotli 10, certifi 11, click 12, cryptography 13, flask 14, h11 15, h2 16, hyperframe 17, kaitaistruct 18, ldap3 19, msgpack 20, passlib 21, protobuf 22, publicsuffix2 23, pyasn1 24, pyopenssl 25, pyparsing 26, pyperclip 27, ruamel_yaml 28, setuptools 29, sortedcontainers 30, tornado 31, urwid 32, wsproto 33, zstandard 34 # Additional check requirements 35, beautifulsoup4 36, glibcLocales 37, hypothesis 38, parver 39, pytest-asyncio 40, pytest-timeout 41, pytest-xdist 42, pytestCheckHook 43, requests 44}: 45 46buildPythonPackage rec { 47 pname = "mitmproxy"; 48 version = "6.0.2"; 49 disabled = pythonOlder "3.8"; 50 51 src = fetchFromGitHub { 52 owner = pname; 53 repo = pname; 54 rev = "v${version}"; 55 sha256 = "sha256-FyIZKFQtf6qvwo4+NzPa/KOmBCcdGJ3jCqxz26+S2e4="; 56 }; 57 58 propagatedBuildInputs = [ 59 setuptools 60 # setup.py 61 asgiref 62 blinker 63 brotli 64 certifi 65 click 66 cryptography 67 flask 68 h11 69 h2 70 hyperframe 71 kaitaistruct 72 ldap3 73 msgpack 74 passlib 75 protobuf 76 publicsuffix2 77 pyasn1 78 pyopenssl 79 pyparsing 80 pyperclip 81 ruamel_yaml 82 sortedcontainers 83 tornado 84 urwid 85 wsproto 86 zstandard 87 ]; 88 89 checkInputs = [ 90 beautifulsoup4 91 glibcLocales 92 hypothesis 93 parver 94 pytest-asyncio 95 pytest-timeout 96 pytest-xdist 97 pytestCheckHook 98 requests 99 ]; 100 101 doCheck = !stdenv.isDarwin; 102 103 postPatch = '' 104 # remove dependency constraints 105 sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?\( \?, \?!=\([0-9]\.\?\)\+\)\?//' -i setup.py 106 ''; 107 108 preCheck = '' 109 export HOME=$(mktemp -d) 110 ''; 111 112 disabledTests = [ 113 # Tests require a git repository 114 "test_get_version" 115 ]; 116 117 pythonImportsCheck = [ "mitmproxy" ]; 118 119 meta = with lib; { 120 description = "Man-in-the-middle proxy"; 121 homepage = "https://mitmproxy.org/"; 122 license = licenses.mit; 123 maintainers = with maintainers; [ fpletz kamilchm ]; 124 }; 125}