From cfce2f382a104516b7956c863ec49abd16167f6b Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 20 Jan 2021 06:03:33 +0000 Subject: [PATCH 1/3] mitmproxy: 5.3.0 -> 6.0.2 --- pkgs/development/python-modules/mitmproxy/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index dd351931e06..28eea2f430b 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -43,14 +43,14 @@ buildPythonPackage rec { pname = "mitmproxy"; - version = "5.3.0"; + version = "6.0.2"; disabled = isPy27; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - sha256 = "04y7fxxssrs14i7zl7fwlwrpnms39i7a6m18481sg8vlrkbagxjr"; + sha256 = "sha256-FyIZKFQtf6qvwo4+NzPa/KOmBCcdGJ3jCqxz26+S2e4="; }; postPatch = '' From b5217c5d2a1425d1ff1304047856a60416b1a1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 23 Jan 2021 12:17:51 +0100 Subject: [PATCH 2/3] pythonPackages.mitmproxy: disable for Python < 3.8 --- 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 28eea2f430b..6dfac822405 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -44,7 +44,7 @@ buildPythonPackage rec { pname = "mitmproxy"; version = "6.0.2"; - disabled = isPy27; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = pname; From ff770828bab9c7689c9e0badaa81975fccc3bc87 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 22 Feb 2021 13:20:42 +0100 Subject: [PATCH 3/3] python3Packages.mitmproxy: adjust requirement and update check part --- .../python-modules/mitmproxy/default.nix | 73 +++++++++++-------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/pkgs/development/python-modules/mitmproxy/default.nix b/pkgs/development/python-modules/mitmproxy/default.nix index 6dfac822405..e9c12548269 100644 --- a/pkgs/development/python-modules/mitmproxy/default.nix +++ b/pkgs/development/python-modules/mitmproxy/default.nix @@ -1,21 +1,25 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub , buildPythonPackage -, isPy27 -, fetchpatch -# Mitmproxy requirements +, pythonOlder + # Mitmproxy requirements +, asgiref , blinker , brotli , certifi , click , cryptography , flask +, h11 , h2 , hyperframe , kaitaistruct , ldap3 +, msgpack , passlib , protobuf +, publicsuffix2 , pyasn1 , pyopenssl , pyparsing @@ -26,19 +30,17 @@ , tornado , urwid , wsproto -, publicsuffix2 , zstandard -# Additional check requirements + # Additional check requirements , beautifulsoup4 , glibcLocales -, pytest -, requests -, asynctest +, hypothesis , parver , pytest-asyncio -, hypothesis -, asgiref -, msgpack +, pytest-timeout +, pytest-xdist +, pytestCheckHook +, requests }: buildPythonPackage rec { @@ -47,24 +49,12 @@ buildPythonPackage rec { disabled = pythonOlder "3.8"; src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; + owner = pname; + repo = pname; + rev = "v${version}"; sha256 = "sha256-FyIZKFQtf6qvwo4+NzPa/KOmBCcdGJ3jCqxz26+S2e4="; }; - postPatch = '' - # remove dependency constraints - sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?\( \?, \?!=\([0-9]\.\?\)\+\)\?//' -i setup.py - ''; - - doCheck = (!stdenv.isDarwin); - - checkPhase = '' - export HOME=$(mktemp -d) - pytest -k 'not test_get_version' # expects a Git repository - ''; - propagatedBuildInputs = [ setuptools # setup.py @@ -75,6 +65,7 @@ buildPythonPackage rec { click cryptography flask + h11 h2 hyperframe kaitaistruct @@ -96,21 +87,39 @@ buildPythonPackage rec { ]; checkInputs = [ - asynctest beautifulsoup4 - flask glibcLocales hypothesis parver - pytest pytest-asyncio + pytest-timeout + pytest-xdist + pytestCheckHook requests ]; + doCheck = !stdenv.isDarwin; + + postPatch = '' + # remove dependency constraints + sed 's/>=\([0-9]\.\?\)\+\( \?, \?<\([0-9]\.\?\)\+\)\?\( \?, \?!=\([0-9]\.\?\)\+\)\?//' -i setup.py + ''; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + disabledTests = [ + # Tests require a git repository + "test_get_version" + ]; + + pythonImportsCheck = [ "mitmproxy" ]; + meta = with lib; { description = "Man-in-the-middle proxy"; - homepage = "https://mitmproxy.org/"; - license = licenses.mit; + homepage = "https://mitmproxy.org/"; + license = licenses.mit; maintainers = with maintainers; [ fpletz kamilchm ]; }; }