Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, fetchFromGitHub 3, buildPythonPackage 4, pythonOlder 5 # Mitmproxy requirements 6, asgiref 7, blinker 8, brotli 9, certifi 10, cryptography 11, flask 12, h11 13, h2 14, hyperframe 15, kaitaistruct 16, ldap3 17, mitmproxy-wireguard 18, msgpack 19, passlib 20, protobuf 21, publicsuffix2 22, pyopenssl 23, pyparsing 24, pyperclip 25, ruamel-yaml 26, setuptools 27, sortedcontainers 28, tornado 29, urwid 30, wsproto 31, zstandard 32 # Additional check requirements 33, hypothesis 34, parver 35, pytest-asyncio 36, pytest-timeout 37, pytest-xdist 38, pytestCheckHook 39, requests 40}: 41 42buildPythonPackage rec { 43 pname = "mitmproxy"; 44 version = "9.0.1"; 45 disabled = pythonOlder "3.9"; 46 47 src = fetchFromGitHub { 48 owner = "mitmproxy"; 49 repo = "mitmproxy"; 50 rev = "refs/tags/${version}"; 51 hash = "sha256-CINKvRnBspciS+wefJB8gzBE13L8CjbYCkmLmTTeYlA="; 52 }; 53 54 propagatedBuildInputs = [ 55 setuptools 56 # setup.py 57 asgiref 58 blinker 59 brotli 60 certifi 61 cryptography 62 flask 63 h11 64 h2 65 hyperframe 66 kaitaistruct 67 ldap3 68 mitmproxy-wireguard 69 msgpack 70 passlib 71 protobuf 72 pyopenssl 73 publicsuffix2 74 pyparsing 75 pyperclip 76 ruamel-yaml 77 sortedcontainers 78 tornado 79 urwid 80 wsproto 81 zstandard 82 ]; 83 84 nativeCheckInputs = [ 85 hypothesis 86 parver 87 pytest-asyncio 88 pytest-timeout 89 pytest-xdist 90 pytestCheckHook 91 requests 92 ]; 93 94 postPatch = '' 95 # remove dependency constraints 96 sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?\( \?, \?!=\([0-9]\.\?\)\+\)\?//' -i setup.py 97 ''; 98 99 __darwinAllowLocalNetworking = true; 100 101 preCheck = '' 102 export HOME=$(mktemp -d) 103 ''; 104 105 disabledTests = [ 106 # Tests require a git repository 107 "test_get_version" 108 # https://github.com/mitmproxy/mitmproxy/commit/36ebf11916704b3cdaf4be840eaafa66a115ac03 109 # Tests require terminal 110 "test_integration" 111 "test_contentview_flowview" 112 "test_flowview" 113 # ValueError: Exceeds the limit (4300) for integer string conversion 114 "test_roundtrip_big_integer" 115 116 "test_wireguard" 117 "test_commands_exist" 118 "test_statusbar" 119 ]; 120 121 disabledTestPaths = [ 122 # teardown of half the tests broken 123 "test/mitmproxy/addons/test_onboarding.py" 124 ]; 125 126 dontUsePytestXdist = true; 127 128 pythonImportsCheck = [ "mitmproxy" ]; 129 130 meta = with lib; { 131 description = "Man-in-the-middle proxy"; 132 homepage = "https://mitmproxy.org/"; 133 license = licenses.mit; 134 maintainers = with maintainers; [ kamilchm SuperSandro2000 ]; 135 }; 136}