Skip to content

Commit

Permalink
Merge pull request #325968 from jchw-forks/fix/nose-alt
Browse files Browse the repository at this point in the history
python312Packages.nose: fix build
  • Loading branch information
mweinelt authored Jul 11, 2024
2 parents dd91b84 + 599e471 commit 60f2cc2
Show file tree
Hide file tree
Showing 17 changed files with 586 additions and 57 deletions.
3 changes: 0 additions & 3 deletions pkgs/applications/graphics/hydrus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ python3Packages.buildPythonPackage rec {
twisted
];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = with python3Packages; [
nose
mock
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/actdiag/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ buildPythonPackage rec {

propagatedBuildInputs = [ blockdiag ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
pytestCheckHook
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/biopandas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/blockdiag/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ buildPythonPackage rec {
webcolors
];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
ephem
nose
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/hkdf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
nose,
setuptools,
}:
Expand All @@ -23,9 +22,6 @@ buildPythonPackage {

pythonImportsCheck = [ "hkdf" ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];

checkPhase = ''
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/lockfile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
setuptools,
pbr,
nose,
pythonOlder,
}:

buildPythonPackage rec {
Expand All @@ -23,9 +22,6 @@ buildPythonPackage rec {
setuptools
];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];

checkPhase = ''
Expand Down
576 changes: 576 additions & 0 deletions pkgs/development/python-modules/nose/0001-nose-python-3.12-fixes.patch

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions pkgs/development/python-modules/nose/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@
isPy3k,
isPyPy,
python,
pythonAtLeast,
python312,
coverage,
setuptools,
}:

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";
};

# 2to3 was removed in setuptools 58
build-system = [ setuptools ];

patches = lib.optional isPy3k [ ./0001-nose-python-3.12-fixes.patch ];

postPatch = ''
substituteInPlace setup.py \
--replace "'use_2to3': True," ""
Expand All @@ -31,8 +32,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
# 2to3 is removed from Python 3.13, so always use Python 3.12 2to3 for now.
preBuild = lib.optionalString isPy3k ''
${python312.pythonOnBuildForHost}/bin/2to3 -wn nose functional_tests unit_tests
'';

propagatedBuildInputs = [ coverage ];
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/nwdiag/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ buildPythonPackage rec {

dependencies = [ blockdiag ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
pytestCheckHook
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/pprintpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ buildPythonPackage rec {

build-system = [ setuptools ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
parameterized
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/pydy/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
numpy,
scipy,
sympy,
Expand All @@ -29,9 +28,6 @@ buildPythonPackage rec {
sympy
];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
cython
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/python-modules/pypass/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ buildPythonPackage rec {
pexpect
];

doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];

# Configuration so that the tests work
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/pytimeparse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ buildPythonPackage rec {

build-system = [ setuptools ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];

pythonImportsCheck = [ "pytimeparse" ];
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/seqdiag/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ buildPythonPackage rec {

dependencies = [ blockdiag ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
pytestCheckHook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ buildPythonPackage rec {

dependencies = [ sphinx-rtd-theme ];

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
sphinx
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/uvcclient/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
nose,
mock,
}:
Expand All @@ -24,9 +23,6 @@ buildPythonPackage rec {
--replace-fail "assertEquals" "assertEqual"
'';

# tests rely on nose
doCheck = pythonOlder "3.12";

nativeCheckInputs = [
nose
mock
Expand Down
3 changes: 0 additions & 3 deletions pkgs/development/python-modules/xlwt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ buildPythonPackage rec {

build-system = [ setuptools ];

# tests rely on nose, archived in 2020
doCheck = pythonOlder "3.12";

nativeCheckInputs = [ nose ];

checkPhase = ''
Expand Down

0 comments on commit 60f2cc2

Please sign in to comment.