about summary refs log tree commit diff
path: root/pkgs/development/python-modules/clustershell/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/clustershell/default.nix')
-rw-r--r--pkgs/development/python-modules/clustershell/default.nix71
1 files changed, 28 insertions, 43 deletions
diff --git a/pkgs/development/python-modules/clustershell/default.nix b/pkgs/development/python-modules/clustershell/default.nix
index 284e5a0eb53ae..f52f290be8d52 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,16 +54,22 @@ buildPythonPackage rec {
   nativeCheckInputs = [
     bc
     hostname
-    nose
+    unittestCheckHook
   ];
 
   pythonImportsCheck = [ "ClusterShell" ];
 
+  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
@@ -70,33 +78,10 @@ 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; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Scalable Python framework for cluster administration";
     homepage = "https://cea-hpc.github.io/clustershell";
     license = licenses.lgpl21;