From d4e61d8c3b225d063eb1a83a07505a7000de25c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 16 Jan 2024 11:06:48 +0100 Subject: [PATCH 1/4] python311Packages.mitmproxy: fix build by using upstream aioquic which was changed in 10.2.0 see https://github.com/mitmproxy/mitmproxy/commit/95c5bf9d5da827c79a28e00c7dbc9bf913f0afb2 --- .../python-modules/mitmproxy/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index 085078429cd5..686605ca5221 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -3,8 +3,9 @@ , fetchFromGitHub , buildPythonPackage , pythonOlder +, pythonRelaxDepsHook # Mitmproxy requirements -, aioquic-mitmproxy +, aioquic , asgiref , blinker , brotli @@ -56,8 +57,16 @@ buildPythonPackage rec { hash = "sha256-BO7oQ4TVuZ4dCtROq2M24V6HVo0jzyBdQfb67dYA07U="; }; + nativeBuildInputs = [ + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = [ + "aioquic" + ]; + propagatedBuildInputs = [ - aioquic-mitmproxy + aioquic asgiref blinker brotli From 0555efad3b9bf82d6e3190a651ffded452b82f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 16 Jan 2024 11:06:48 +0100 Subject: [PATCH 2/4] python3Packages.aioquic-mitmproxy: drop No longer used by mitmproxy --- .../aioquic-mitmproxy/default.nix | 56 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 3 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 pkgs/development/python-modules/aioquic-mitmproxy/default.nix diff --git a/pkgs/development/python-modules/aioquic-mitmproxy/default.nix b/pkgs/development/python-modules/aioquic-mitmproxy/default.nix deleted file mode 100644 index 75ccd6072741..000000000000 --- a/pkgs/development/python-modules/aioquic-mitmproxy/default.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ lib -, buildPythonPackage -, certifi -, cryptography -, fetchFromGitHub -, pylsqpack -, pyopenssl -, pytestCheckHook -, pythonOlder -, service-identity -, setuptools -, wheel -}: - -buildPythonPackage rec { - pname = "aioquic-mitmproxy"; - version = "0.9.21.1"; - pyproject = true; - - disabled = pythonOlder "3.8"; - - src = fetchFromGitHub { - owner = "meitinger"; - repo = "aioquic_mitmproxy"; - rev = "refs/tags/${version}"; - hash = "sha256-eD3eICE9jS1jyqMgWwcv6w3gkR0EyGcKwgSXhasXNeA="; - }; - - nativeBuildInputs = [ - setuptools - wheel - ]; - - propagatedBuildInputs = [ - certifi - cryptography - pylsqpack - pyopenssl - service-identity - ]; - - nativeCheckInputs = [ - pytestCheckHook - ]; - - pythonImportsCheck = [ - "aioquic" - ]; - - meta = with lib; { - description = "QUIC and HTTP/3 implementation in Python"; - homepage = "https://github.com/meitinger/aioquic_mitmproxy"; - license = licenses.bsd3; - maintainers = with maintainers; [ fab ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 067e702b76d5..e2baccf5192b 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -39,6 +39,7 @@ mapAliases ({ aioh2 = throw "aioh2 has been removed because it is abandoned and broken."; # Added 2022-03-30 aionotify = throw "aionotify has been removed because is unmaintained and incompatible with python3.11."; # Added 2023-10-27 aiosenseme = throw "aiosenseme has been removed, because it does no longer work with the latest firmware and has become unmaintained"; # Added 2023-07-05 + aioquic-mitmproxy = throw "aioquic-mitmproxy has been removed because mitmproxy no longer uses it"; # Added 2024-01-16 amazon_kclpy = amazon-kclpy; # added 2023-08-08 ansible-base = throw "ansible-base has been removed, because it is end of life"; # added 2022-03-30 ansible-doctor = throw "ansible-doctor has been promoted to a top-level attribute"; # Added 2023-05-16 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 98b63bc08c6d..7007c3b7b6ec 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -349,8 +349,6 @@ self: super: with self; { aioquic = callPackage ../development/python-modules/aioquic { }; - aioquic-mitmproxy = callPackage ../development/python-modules/aioquic-mitmproxy { }; - aiorecollect = callPackage ../development/python-modules/aiorecollect { }; aioredis = callPackage ../development/python-modules/aioredis { }; From 48ae7e0f3c46f3fef14c93c3eb24aa7528b2d240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 16 Jan 2024 11:08:32 +0100 Subject: [PATCH 3/4] python311Packages.mitmproxy: update disabled tests --- .../python-modules/mitmproxy/default.nix | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index 686605ca5221..503314d68eea 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -118,22 +118,14 @@ buildPythonPackage rec { "test_get_version" # https://github.com/mitmproxy/mitmproxy/commit/36ebf11916704b3cdaf4be840eaafa66a115ac03 # Tests require terminal - "test_integration" + "test_commands_exist" "test_contentview_flowview" "test_flowview" - # ValueError: Exceeds the limit (4300) for integer string conversion - "test_roundtrip_big_integer" - "test_wireguard" - "test_commands_exist" + "test_integration" "test_statusbar" - # AssertionError: Playbook mismatch! - "test_untrusted_cert" - "test_mitmproxy_ca_is_untrusted" - ]; - - disabledTestPaths = [ - # teardown of half the tests broken - "test/mitmproxy/addons/test_onboarding.py" + # FileNotFoundError: [Errno 2] No such file or directory + # likely wireguard is also not working in the sandbox + "test_wireguard" ]; dontUsePytestXdist = true; From 1858cedf44e2587acc540aff36c2d849428c5836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 16 Jan 2024 11:08:37 +0100 Subject: [PATCH 4/4] python311Packages.mitmproxy: drop inactive maintainer --- pkgs/development/python-modules/mitmproxy/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index 503314d68eea..283208e3500e 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -137,6 +137,6 @@ buildPythonPackage rec { homepage = "https://mitmproxy.org/"; changelog = "https://github.com/mitmproxy/mitmproxy/blob/${version}/CHANGELOG.md"; license = licenses.mit; - maintainers = with maintainers; [ kamilchm SuperSandro2000 ]; + maintainers = with maintainers; [ SuperSandro2000 ]; }; }