From f62942d4dfca1ad341f16f6083d7104c646f4ca1 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 13:54:29 +0200 Subject: [PATCH 1/4] python312Packages.blackdiag: drop nose dependency --- .../python-modules/blockdiag/default.nix | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/blockdiag/default.nix b/pkgs/development/python-modules/blockdiag/default.nix index 8b43fd2c90656..7acdf490acb40 100644 --- a/pkgs/development/python-modules/blockdiag/default.nix +++ b/pkgs/development/python-modules/blockdiag/default.nix @@ -5,9 +5,9 @@ ephem, fetchFromGitHub, fetchpatch, + fetchpatch2, funcparserlib, pillow, - nose, pytestCheckHook, pythonOlder, reportlab, @@ -36,8 +36,21 @@ buildPythonPackage rec { url = "https://github.com/blockdiag/blockdiag/commit/20d780cad84e7b010066cb55f848477957870165.patch"; hash = "sha256-t1zWFzAsLL2EUa0nD4Eui4Y5AhAZLRmp/yC9QpzzeUA="; }) + # https://github.com/blockdiag/blockdiag/pull/175 + (fetchpatch2 { + name = "migrate-to-pytest.patch"; + url = "https://github.com/blockdiag/blockdiag/commit/4f4f726252084f17ecc6c524592222af09d37da4.patch"; + hash = "sha256-OkfKJwJtb2DJRXE/8thYnisTFwcfstUFTTJHdM/qBzg="; + }) ]; + postPatch = '' + # requires network access the url-based icon + # and path-based icon is set to debian logo (/usr/share/pixmaps/debian-logo.png) + rm src/blockdiag/tests/diagrams/node_icon.diag + # note: this is a postPatch as `seqdiag` uses them directly + ''; + build-system = [ setuptools ]; dependencies = [ @@ -48,12 +61,8 @@ buildPythonPackage rec { webcolors ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ ephem - nose pytestCheckHook ]; From 1d4fbfc0527e5935449a70054fcb2a88c5177c87 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 14:09:11 +0200 Subject: [PATCH 2/4] python312Packages.seqdiag: drop nose dependency --- .../python-modules/seqdiag/default.nix | 10 ++------ .../seqdiag/fix_test_generate.patch | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/python-modules/seqdiag/fix_test_generate.patch diff --git a/pkgs/development/python-modules/seqdiag/default.nix b/pkgs/development/python-modules/seqdiag/default.nix index 79d575a9fa516..754ef870f8656 100644 --- a/pkgs/development/python-modules/seqdiag/default.nix +++ b/pkgs/development/python-modules/seqdiag/default.nix @@ -3,7 +3,6 @@ blockdiag, buildPythonPackage, fetchFromGitHub, - nose, pytestCheckHook, pythonOlder, setuptools, @@ -27,14 +26,9 @@ buildPythonPackage rec { dependencies = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - - nativeCheckInputs = [ - nose - pytestCheckHook - ]; + patches = [ ./fix_test_generate.patch ]; + nativeCheckInputs = [ pytestCheckHook ]; pytestFlagsArray = [ "src/seqdiag/tests/" ]; pythonImportsCheck = [ "seqdiag" ]; diff --git a/pkgs/development/python-modules/seqdiag/fix_test_generate.patch b/pkgs/development/python-modules/seqdiag/fix_test_generate.patch new file mode 100644 index 0000000000000..d96c1308e6ed7 --- /dev/null +++ b/pkgs/development/python-modules/seqdiag/fix_test_generate.patch @@ -0,0 +1,25 @@ +diff --git a/src/seqdiag/tests/test_generate_diagram.py b/src/seqdiag/tests/test_generate_diagram.py +index cdd340f..a1dd2d4 100644 +--- a/src/seqdiag/tests/test_generate_diagram.py ++++ b/src/seqdiag/tests/test_generate_diagram.py +@@ -13,19 +13,5 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import os +- + from blockdiag.tests.test_generate_diagram import (get_diagram_files, +- testcase_generator) +- +-import seqdiag.command +- +- +-def test_generate(): +- mainfunc = seqdiag.command.main +- basepath = os.path.dirname(__file__) +- files = get_diagram_files(basepath) +- options = [] +- +- for testcase in testcase_generator(basepath, mainfunc, files, options): +- yield testcase ++ test_generate_with_separate) From 09d128d4f76ed0fb2fdddb487b7f950be84776e2 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 22:13:39 +0200 Subject: [PATCH 3/4] python312Packages.actdiag: drop nose dependency --- .../python-modules/actdiag/default.nix | 11 +++------- .../actdiag/fix_test_generate.patch | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/python-modules/actdiag/fix_test_generate.patch diff --git a/pkgs/development/python-modules/actdiag/default.nix b/pkgs/development/python-modules/actdiag/default.nix index cf84a064b54f0..84fe61584547a 100644 --- a/pkgs/development/python-modules/actdiag/default.nix +++ b/pkgs/development/python-modules/actdiag/default.nix @@ -3,7 +3,6 @@ blockdiag, buildPythonPackage, fetchFromGitHub, - nose, pytestCheckHook, pythonOlder, setuptools, @@ -23,17 +22,13 @@ buildPythonPackage rec { hash = "sha256-WmprkHOgvlsOIg8H77P7fzEqxGnj6xaL7Df7urRkg3o="; }; + patches = [ ./fix_test_generate.patch ]; + build-system = [ setuptools ]; propagatedBuildInputs = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - - nativeCheckInputs = [ - nose - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; pytestFlagsArray = [ "src/actdiag/tests/" ]; diff --git a/pkgs/development/python-modules/actdiag/fix_test_generate.patch b/pkgs/development/python-modules/actdiag/fix_test_generate.patch new file mode 100644 index 0000000000000..95dbf5887268d --- /dev/null +++ b/pkgs/development/python-modules/actdiag/fix_test_generate.patch @@ -0,0 +1,22 @@ +diff --git a/src/actdiag/tests/test_generate_diagram.py b/src/actdiag/tests/test_generate_diagram.py +index c5ee3d5..a74a151 100644 +--- a/src/actdiag/tests/test_generate_diagram.py ++++ b/src/actdiag/tests/test_generate_diagram.py +@@ -16,16 +16,6 @@ + import os + + from blockdiag.tests.test_generate_diagram import (get_diagram_files, +- testcase_generator) ++ test_generate_with_separate) + +-import actdiag.command + +- +-def test_generate(): +- mainfunc = actdiag.command.main +- basepath = os.path.dirname(__file__) +- files = get_diagram_files(basepath) +- options = [] +- +- for testcase in testcase_generator(basepath, mainfunc, files, options): +- yield testcase From ac2e5fbdc060791bf1e8e1460dd5f941db2c3166 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Sat, 27 Jul 2024 22:20:49 +0200 Subject: [PATCH 4/4] python312Packages.nwdiag: drop nose dependency --- .../python-modules/nwdiag/default.nix | 11 +++------- .../nwdiag/fix_test_generate.patch | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/python-modules/nwdiag/fix_test_generate.patch diff --git a/pkgs/development/python-modules/nwdiag/default.nix b/pkgs/development/python-modules/nwdiag/default.nix index dc2fd74fbef56..6196910595cbf 100644 --- a/pkgs/development/python-modules/nwdiag/default.nix +++ b/pkgs/development/python-modules/nwdiag/default.nix @@ -3,7 +3,6 @@ blockdiag, fetchFromGitHub, buildPythonPackage, - nose, pytestCheckHook, setuptools, pythonOlder, @@ -23,17 +22,13 @@ buildPythonPackage rec { hash = "sha256-uKrdkXpL5YBr953sRsHknYg+2/WwrZmyDf8BMA2+0tU="; }; + patches = [ ./fix_test_generate.patch ]; + build-system = [ setuptools ]; dependencies = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - - nativeCheckInputs = [ - nose - pytestCheckHook - ]; + nativeCheckInputs = [ pytestCheckHook ]; pytestFlagsArray = [ "src/nwdiag/tests/" ]; diff --git a/pkgs/development/python-modules/nwdiag/fix_test_generate.patch b/pkgs/development/python-modules/nwdiag/fix_test_generate.patch new file mode 100644 index 0000000000000..c05b5be45c1dc --- /dev/null +++ b/pkgs/development/python-modules/nwdiag/fix_test_generate.patch @@ -0,0 +1,22 @@ +diff --git a/src/nwdiag/tests/test_generate_diagram.py b/src/nwdiag/tests/test_generate_diagram.py +index 2065208..ac9b096 100644 +--- a/src/nwdiag/tests/test_generate_diagram.py ++++ b/src/nwdiag/tests/test_generate_diagram.py +@@ -16,16 +16,4 @@ + import os + + from blockdiag.tests.test_generate_diagram import (get_diagram_files, +- testcase_generator) +- +-import nwdiag.command +- +- +-def test_generate(): +- mainfunc = nwdiag.command.main +- basepath = os.path.dirname(__file__) +- files = get_diagram_files(basepath) +- options = [] +- +- for testcase in testcase_generator(basepath, mainfunc, files, options): +- yield testcase ++ test_generate_with_separate)