From 5e6cc7bd5a064d3b421a1b14c83300a8d11aa7c3 Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Tue, 20 Aug 2024 22:38:36 +0200 Subject: [PATCH] python312Packages.clustershell: drop nose dependency --- .../python-modules/clustershell/default.nix | 69 +++++++------------ 1 file changed, 26 insertions(+), 43 deletions(-) diff --git a/pkgs/development/python-modules/clustershell/default.nix b/pkgs/development/python-modules/clustershell/default.nix index 964b2724d07c..9c166af7f550 100644 --- a/pkgs/development/python-modules/clustershell/default.nix +++ b/pkgs/development/python-modules/clustershell/default.nix @@ -3,9 +3,11 @@ lib, buildPythonPackage, fetchPypi, + setuptools, + distutils, pyyaml, openssh, - nose, + unittestCheckHook, bc, hostname, bash, @@ -14,6 +16,7 @@ buildPythonPackage rec { pname = "clustershell"; version = "1.9.2"; + pyproject = true; src = fetchPypi { pname = "ClusterShell"; @@ -21,30 +24,29 @@ buildPythonPackage rec { hash = "sha256-rsF/HG4GNBC+N49b+sDO2AyUI1G44wJNBUwQNPzShD0="; }; + build-system = [ + setuptools + distutils + ]; + postPatch = '' substituteInPlace lib/ClusterShell/Worker/Ssh.py \ - --replace '"ssh"' '"${openssh}/bin/ssh"' \ - --replace '"scp"' '"${openssh}/bin/scp"' + --replace-fail '"ssh"' '"${openssh}/bin/ssh"' \ + --replace-fail '"scp"' '"${openssh}/bin/scp"' substituteInPlace lib/ClusterShell/Worker/fastsubprocess.py \ - --replace '"/bin/sh"' '"${bash}/bin/sh"' + --replace-fail '"/bin/sh"' '"${bash}/bin/sh"' for f in tests/*; do substituteInPlace $f \ - --replace '/bin/hostname' '${hostname}/bin/hostname' \ - --replace '/bin/sleep' 'sleep' \ - --replace '/bin/echo' 'echo' \ - --replace '/bin/uname' 'uname' \ - --replace '/bin/false' 'false' \ - --replace '/bin/true' 'true' \ - --replace '/usr/bin/printf' 'printf' + --replace-quiet '/bin/hostname' '${hostname}/bin/hostname' \ + --replace-quiet '/bin/sleep' 'sleep' \ + --replace-quiet '/bin/echo' 'echo' \ + --replace-quiet '/bin/uname' 'uname' \ + --replace-quiet '/bin/false' 'false' \ + --replace-quiet '/bin/true' 'true' \ + --replace-quiet '/usr/bin/printf' 'printf' done - - # Fix warnings - substituteInPlace lib/ClusterShell/Task.py \ - --replace "notifyAll" "notify_all" - substituteInPlace tests/TaskPortTest.py lib/ClusterShell/Task.py \ - --replace "currentThread" "current_thread" ''; propagatedBuildInputs = [ pyyaml ]; @@ -52,18 +54,22 @@ buildPythonPackage rec { nativeCheckInputs = [ bc hostname - nose + unittestCheckHook ]; pythonImportsCheck = [ "ClusterShell" ]; - doCheck = false; # tests often get stuck + unittestFlagsArray = [ + "tests" + "-p" + "'*Test.py'" + ]; # Many tests want to open network connections # https://github.com/cea-hpc/clustershell#test-suite # # Several tests fail on Darwin - checkPhase = '' + preCheck = '' rm tests/CLIClushTest.py rm tests/TreeWorkerTest.py rm tests/TaskDistantMixin.py @@ -72,29 +78,6 @@ buildPythonPackage rec { rm tests/TaskDistantPdshTest.py rm tests/TaskRLimitsTest.py rm tests/TreeGatewayTest.py - - nosetests -v \ - -e test_fromall_grouplist \ - -e test_rank_placeholder \ - -e test_engine_on_the_fly_launch \ - -e test_ev_pickup_fanout \ - -e test_ev_pickup_fanout_legacy \ - -e test_timeout \ - -e test_008_broken_pipe_on_write \ - -e testLocalBufferRCGathering \ - -e testLocalBuffers \ - -e testLocalErrorBuffers \ - -e testLocalFanout \ - -e testLocalRetcodes \ - -e testLocalRCBufferGathering \ - -e testLocalSingleLineBuffers \ - -e testLocalWorkerFanout \ - -e testSimpleMultipleCommands \ - -e testClushConfigSetRlimit \ - -e testTimerInvalidateInHandler \ - -e testTimerSetNextFireInHandler \ - -e test_node_placeholder \ - tests/*.py ''; meta = with lib; {