From b24ddbbf57240f1a3fe88c00464ab1d7fba1d863 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 28 Jul 2024 00:02:15 +0100 Subject: [PATCH 1/4] python3Packages.androguard: convert to `pyproject` --- pkgs/development/python-modules/androguard/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/androguard/default.nix b/pkgs/development/python-modules/androguard/default.nix index cc1789963e61..a34be1401ddc 100644 --- a/pkgs/development/python-modules/androguard/default.nix +++ b/pkgs/development/python-modules/androguard/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + setuptools, future, networkx, pygments, @@ -12,7 +13,6 @@ click, pydot, ipython, - packaging, pyqt5, pyperclip, nose, @@ -33,7 +33,7 @@ buildPythonPackage rec { pname = "androguard"; version = "3.4.0a1"; - format = "setuptools"; + pyproject = true; src = fetchFromGitHub { repo = pname; @@ -42,9 +42,11 @@ buildPythonPackage rec { sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy"; }; - nativeBuildInputs = [ packaging ] ++ lib.optionals withGui [ qt5.wrapQtAppsHook ]; + build-system = [ setuptools ]; - propagatedBuildInputs = + nativeBuildInputs = lib.optionals withGui [ qt5.wrapQtAppsHook ]; + + dependencies = [ asn1crypto click From 5612d9441888e47fa7e7ac6a28e8a4eb528bb7f3 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 28 Jul 2024 00:02:15 +0100 Subject: [PATCH 2/4] python3Packages.androguard: update for networkx changes --- .../python-modules/androguard/default.nix | 4 ++++ .../androguard/drop-removed-networkx-formats.patch | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/development/python-modules/androguard/drop-removed-networkx-formats.patch diff --git a/pkgs/development/python-modules/androguard/default.nix b/pkgs/development/python-modules/androguard/default.nix index a34be1401ddc..b952e71ac7c6 100644 --- a/pkgs/development/python-modules/androguard/default.nix +++ b/pkgs/development/python-modules/androguard/default.nix @@ -42,6 +42,8 @@ buildPythonPackage rec { sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy"; }; + patches = [ ./drop-removed-networkx-formats.patch ]; + build-system = [ setuptools ]; nativeBuildInputs = lib.optionals withGui [ qt5.wrapQtAppsHook ]; @@ -59,6 +61,8 @@ buildPythonPackage rec { pydot pygments ] + ++ networkx.optional-dependencies.default + ++ networkx.optional-dependencies.extra ++ lib.optionals withGui [ pyqt5 pyperclip diff --git a/pkgs/development/python-modules/androguard/drop-removed-networkx-formats.patch b/pkgs/development/python-modules/androguard/drop-removed-networkx-formats.patch new file mode 100644 index 000000000000..214fbaa2dafd --- /dev/null +++ b/pkgs/development/python-modules/androguard/drop-removed-networkx-formats.patch @@ -0,0 +1,14 @@ +diff --git a/androguard/cli/main.py b/androguard/cli/main.py +index 13bc1d0ab7..a79b4fe5fa 100644 +--- a/androguard/cli/main.py ++++ b/androguard/cli/main.py +@@ -110,9 +110,7 @@ + + write_methods = dict(gml=_write_gml, + gexf=nx.write_gexf, +- gpickle=nx.write_gpickle, + graphml=nx.write_graphml, +- yaml=nx.write_yaml, + net=nx.write_pajek, + ) + From 5b2c9211a3034492dfb6acec6491715c4ca56675 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 28 Jul 2024 00:02:15 +0100 Subject: [PATCH 3/4] python3Packages.androguard: drop nose dependency --- .../python-modules/androguard/default.nix | 25 ++++++++----------- .../python-modules/androguard/fix-tests.patch | 13 ++++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 pkgs/development/python-modules/androguard/fix-tests.patch diff --git a/pkgs/development/python-modules/androguard/default.nix b/pkgs/development/python-modules/androguard/default.nix index b952e71ac7c6..c5a4300736ee 100644 --- a/pkgs/development/python-modules/androguard/default.nix +++ b/pkgs/development/python-modules/androguard/default.nix @@ -15,8 +15,7 @@ ipython, pyqt5, pyperclip, - nose, - nose-timer, + pytestCheckHook, mock, python-magic, codecov, @@ -25,11 +24,12 @@ # This is usually used as a library, and it'd be a shame to force the GUI # libraries to the closure if GUI is not desired. withGui ? false, - # Tests take a very long time, and currently fail, but next release' tests - # shouldn't fail - doCheck ? false, + # Deprecated in 24.11. + doCheck ? true, }: +assert lib.warnIf (!doCheck) "python3Packages.androguard: doCheck is deprecated" true; + buildPythonPackage rec { pname = "androguard"; version = "3.4.0a1"; @@ -42,7 +42,10 @@ buildPythonPackage rec { sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy"; }; - patches = [ ./drop-removed-networkx-formats.patch ]; + patches = [ + ./drop-removed-networkx-formats.patch + ./fix-tests.patch + ]; build-system = [ setuptools ]; @@ -69,23 +72,17 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ + pytestCheckHook codecov coverage mock - nose - nose-timer pyperclip pyqt5 python-magic ]; - inherit doCheck; # If it won't be verbose, you'll see nothing going on for a long time. - checkPhase = '' - runHook preCheck - nosetests --verbosity=3 - runHook postCheck - ''; + pytestFlagsArray = [ "--verbose" ]; preFixup = lib.optionalString withGui '' makeWrapperArgs+=("''${qtWrapperArgs[@]}") diff --git a/pkgs/development/python-modules/androguard/fix-tests.patch b/pkgs/development/python-modules/androguard/fix-tests.patch new file mode 100644 index 000000000000..b971b46c6244 --- /dev/null +++ b/pkgs/development/python-modules/androguard/fix-tests.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_types.py b/tests/test_types.py +index 127dfc20eb..f1c89f0712 100644 +--- a/tests/test_types.py ++++ b/tests/test_types.py +@@ -182,7 +182,7 @@ + for i in filter(lambda x: 'const' in x.get_name(), method.get_instructions()): + i.show(0) + # ins should only have one literal +- self.assertEquals(len(i.get_literals()), 1) ++ self.assertEqual(len(i.get_literals()), 1) + + fmt, value = VALUES[method.full_name].pop(0) + converted = format_value(i.get_literals()[0], i, fmt) From 4d10225ee46c0ab16332a2450b493e0277d1741a Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 27 Jul 2024 13:45:39 +0100 Subject: [PATCH 4/4] python3Packages.nose-timer: drop --- .../python-modules/nose-timer/default.nix | 46 ------------------- pkgs/top-level/python-aliases.nix | 1 + pkgs/top-level/python-packages.nix | 2 - 3 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 pkgs/development/python-modules/nose-timer/default.nix diff --git a/pkgs/development/python-modules/nose-timer/default.nix b/pkgs/development/python-modules/nose-timer/default.nix deleted file mode 100644 index a002e6bfb1da..000000000000 --- a/pkgs/development/python-modules/nose-timer/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - lib, - buildPythonPackage, - fetchFromGitHub, - nose, - mock, - parameterized, - termcolor, -}: - -buildPythonPackage rec { - pname = "nose-timer"; - version = "1.0.1"; - format = "setuptools"; - - src = fetchFromGitHub { - owner = "mahmoudimus"; - repo = pname; - rev = "v${version}"; - sha256 = "0xsai2l5i1av62y9y0q63wy2zk27klmf2jizgghhxg2y8nfa8x3x"; - }; - - propagatedBuildInputs = [ nose ]; - - nativeCheckInputs = [ - mock - nose - parameterized - termcolor - ]; - - checkPhase = '' - runHook preCheck - nosetests --verbosity 2 tests - runHook postCheck - ''; - - pythonImportsCheck = [ "nosetimer" ]; - - meta = with lib; { - description = "Timer plugin for nosetests"; - homepage = "https://github.com/mahmoudimus/nose-timer"; - license = licenses.mit; - maintainers = with maintainers; [ doronbehar ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index f17abd7da95b..9e7d42bc852a 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -336,6 +336,7 @@ mapAliases ({ nose-randomly = throw "nose-randomly has been removed, it was archived and unmaintained since 2019"; # added 2024-05-22 nose-pattern-exclude = throw "nose-pattern-exclude has been removed as it has been unmaintained since 2014"; # added 2024-07-27 nose_progressive = throw "nose_progressive has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; #added 2023-02-21 + nose-timer = throw "nose-timer has been removed as it depends on the abandoned nose test framework"; # added 2024-07-27 nose-warnings-filters = throw "nose-warnings-filters has been removed as it has been unmaintained since 2016"; # added 2024-07-27 nose_warnings_filters = nose-warnings-filters; # added 2024-01-07 notifymuch = throw "notifymuch has been promoted to a top-level attribute name: `pkgs.notifymuch`"; # added 2022-10-02 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1f7fd485376c..80c7c5002072 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9119,8 +9119,6 @@ self: super: with self; { nose3 = callPackage ../development/python-modules/nose3 { }; - nose-timer = callPackage ../development/python-modules/nose-timer { }; - nose-xunitmp = callPackage ../development/python-modules/nose-xunitmp { }; notebook = callPackage ../development/python-modules/notebook { };