diff --git a/pkgs/applications/graphics/hydrus/default.nix b/pkgs/applications/graphics/hydrus/default.nix index 7da1858cb542a..8f2891639751a 100644 --- a/pkgs/applications/graphics/hydrus/default.nix +++ b/pkgs/applications/graphics/hydrus/default.nix @@ -6,7 +6,6 @@ , enableSwftools ? false , swftools , python3Packages -, pythonOlder , qtbase , qtcharts , makeDesktopItem @@ -82,9 +81,6 @@ python3Packages.buildPythonPackage rec { twisted ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = with python3Packages; [ nose mock diff --git a/pkgs/development/python-modules/actdiag/default.nix b/pkgs/development/python-modules/actdiag/default.nix index cf84a064b54f0..effba4c188bb6 100644 --- a/pkgs/development/python-modules/actdiag/default.nix +++ b/pkgs/development/python-modules/actdiag/default.nix @@ -27,9 +27,6 @@ buildPythonPackage rec { propagatedBuildInputs = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose pytestCheckHook diff --git a/pkgs/development/python-modules/biopandas/default.nix b/pkgs/development/python-modules/biopandas/default.nix index be59f3638d913..1102457cb94d4 100644 --- a/pkgs/development/python-modules/biopandas/default.nix +++ b/pkgs/development/python-modules/biopandas/default.nix @@ -35,10 +35,6 @@ buildPythonPackage rec { looseversion ]; - # tests rely on nose - # resolved in 0.5.1: https://github.com/BioPandas/biopandas/commit/67aa2f237c70c826cd9ab59d6ae114582da2112f - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose pytestCheckHook diff --git a/pkgs/development/python-modules/blockdiag/default.nix b/pkgs/development/python-modules/blockdiag/default.nix index 8b43fd2c90656..8b0742ed77f5b 100644 --- a/pkgs/development/python-modules/blockdiag/default.nix +++ b/pkgs/development/python-modules/blockdiag/default.nix @@ -48,9 +48,6 @@ buildPythonPackage rec { webcolors ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ ephem nose diff --git a/pkgs/development/python-modules/hkdf/default.nix b/pkgs/development/python-modules/hkdf/default.nix index 176322d932212..f04e486fd73ca 100644 --- a/pkgs/development/python-modules/hkdf/default.nix +++ b/pkgs/development/python-modules/hkdf/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, nose, setuptools, }: @@ -23,9 +22,6 @@ buildPythonPackage { pythonImportsCheck = [ "hkdf" ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose ]; checkPhase = '' diff --git a/pkgs/development/python-modules/lockfile/default.nix b/pkgs/development/python-modules/lockfile/default.nix index 0a0b906e91229..5423a1abb300f 100644 --- a/pkgs/development/python-modules/lockfile/default.nix +++ b/pkgs/development/python-modules/lockfile/default.nix @@ -5,7 +5,6 @@ setuptools, pbr, nose, - pythonOlder, }: buildPythonPackage rec { @@ -23,9 +22,6 @@ buildPythonPackage rec { setuptools ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose ]; checkPhase = '' diff --git a/pkgs/development/python-modules/nose/default.nix b/pkgs/development/python-modules/nose/default.nix index f864cfb9125f3..44b98b0620e78 100644 --- a/pkgs/development/python-modules/nose/default.nix +++ b/pkgs/development/python-modules/nose/default.nix @@ -5,23 +5,35 @@ isPy3k, isPyPy, python, - pythonAtLeast, + python312, coverage, + setuptools, + fetchpatch2, }: buildPythonPackage rec { version = "1.3.7"; - format = "setuptools"; pname = "nose"; - - # unmaintained, relies on the imp module - disabled = pythonAtLeast "3.12"; + pyproject = true; src = fetchPypi { inherit pname version; sha256 = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"; }; + build-system = [ setuptools ]; + + patches = [ + (fetchpatch2 { + url = "https://gitlab.alpinelinux.org/alpine/aports/-/raw/71a773b0618ce60d276a3df74ed69e6bd6d13237/community/py3-nose/python-nose-py311.patch"; + hash = "sha256-CwY1pxzFFD0AYgmbERQyb6dD3bSInTqteUM85nfYkq8="; + }) + (fetchpatch2 { + url = "https://gitlab.alpinelinux.org/alpine/aports/-/raw/71a773b0618ce60d276a3df74ed69e6bd6d13237/community/py3-nose/python-nose-py312.patch"; + hash = "sha256-/mJHbal8XXOWvLtebrYmoK23rCNp+VWIFYDPUckEEGg="; + }) + ]; + # 2to3 was removed in setuptools 58 postPatch = '' substituteInPlace setup.py \ @@ -31,8 +43,9 @@ buildPythonPackage rec { --replace "from setuptools.command.build_py import Mixin2to3" "from distutils.util import Mixin2to3" ''; - preBuild = lib.optionalString (isPy3k) '' - ${python.pythonOnBuildForHost}/bin/2to3 -wn nose functional_tests unit_tests + # Python 3.12 is the last version to ship 2to3. + preBuild = lib.optionalString isPy3k '' + ${python312.pythonOnBuildForHost}/bin/2to3 -wn nose functional_tests unit_tests ''; propagatedBuildInputs = [ coverage ]; diff --git a/pkgs/development/python-modules/nwdiag/default.nix b/pkgs/development/python-modules/nwdiag/default.nix index dc2fd74fbef56..ac121549596ee 100644 --- a/pkgs/development/python-modules/nwdiag/default.nix +++ b/pkgs/development/python-modules/nwdiag/default.nix @@ -27,9 +27,6 @@ buildPythonPackage rec { dependencies = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose pytestCheckHook diff --git a/pkgs/development/python-modules/pprintpp/default.nix b/pkgs/development/python-modules/pprintpp/default.nix index d7da3d5511e8b..904e067b6c0a8 100644 --- a/pkgs/development/python-modules/pprintpp/default.nix +++ b/pkgs/development/python-modules/pprintpp/default.nix @@ -38,9 +38,6 @@ buildPythonPackage rec { build-system = [ setuptools ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose parameterized diff --git a/pkgs/development/python-modules/pydy/default.nix b/pkgs/development/python-modules/pydy/default.nix index 1c858f5d02914..e9b916c888e22 100644 --- a/pkgs/development/python-modules/pydy/default.nix +++ b/pkgs/development/python-modules/pydy/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchPypi, - pythonOlder, numpy, scipy, sympy, @@ -29,9 +28,6 @@ buildPythonPackage rec { sympy ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose cython diff --git a/pkgs/development/python-modules/pypass/default.nix b/pkgs/development/python-modules/pypass/default.nix index 3a2fc269ceda4..a13d4ea197209 100644 --- a/pkgs/development/python-modules/pypass/default.nix +++ b/pkgs/development/python-modules/pypass/default.nix @@ -55,8 +55,6 @@ buildPythonPackage rec { pexpect ]; - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose ]; # Configuration so that the tests work diff --git a/pkgs/development/python-modules/pytimeparse/default.nix b/pkgs/development/python-modules/pytimeparse/default.nix index 819bc5875c6f1..03b0bc996cdfd 100644 --- a/pkgs/development/python-modules/pytimeparse/default.nix +++ b/pkgs/development/python-modules/pytimeparse/default.nix @@ -21,9 +21,6 @@ buildPythonPackage rec { build-system = [ setuptools ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose ]; pythonImportsCheck = [ "pytimeparse" ]; diff --git a/pkgs/development/python-modules/seqdiag/default.nix b/pkgs/development/python-modules/seqdiag/default.nix index 79d575a9fa516..d205c2e986a3e 100644 --- a/pkgs/development/python-modules/seqdiag/default.nix +++ b/pkgs/development/python-modules/seqdiag/default.nix @@ -27,9 +27,6 @@ buildPythonPackage rec { dependencies = [ blockdiag ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose pytestCheckHook diff --git a/pkgs/development/python-modules/sphinx-rtd-dark-mode/default.nix b/pkgs/development/python-modules/sphinx-rtd-dark-mode/default.nix index d3b4bf7f41045..67d6794ee1d58 100644 --- a/pkgs/development/python-modules/sphinx-rtd-dark-mode/default.nix +++ b/pkgs/development/python-modules/sphinx-rtd-dark-mode/default.nix @@ -25,9 +25,6 @@ buildPythonPackage rec { dependencies = [ sphinx-rtd-theme ]; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose sphinx diff --git a/pkgs/development/python-modules/uvcclient/default.nix b/pkgs/development/python-modules/uvcclient/default.nix index c884e3a029261..374bbdde7a4e4 100644 --- a/pkgs/development/python-modules/uvcclient/default.nix +++ b/pkgs/development/python-modules/uvcclient/default.nix @@ -2,7 +2,6 @@ lib, buildPythonPackage, fetchFromGitHub, - pythonOlder, nose, mock, }: @@ -24,9 +23,6 @@ buildPythonPackage rec { --replace-fail "assertEquals" "assertEqual" ''; - # tests rely on nose - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose mock diff --git a/pkgs/development/python-modules/xlwt/default.nix b/pkgs/development/python-modules/xlwt/default.nix index 12dfb75ce3410..e4f1821431298 100644 --- a/pkgs/development/python-modules/xlwt/default.nix +++ b/pkgs/development/python-modules/xlwt/default.nix @@ -21,9 +21,6 @@ buildPythonPackage rec { build-system = [ setuptools ]; - # tests rely on nose, archived in 2020 - doCheck = pythonOlder "3.12"; - nativeCheckInputs = [ nose ]; checkPhase = ''