summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2018-06-23 18:29:20 +0200
committerGitHub <noreply@github.com>2018-06-23 18:29:20 +0200
commitfc4ab420d98662cf93edeb4bf460c90c1feb7ec8 (patch)
treed7780ff10f8828e15ac629038d1d7c4013736428
parent904114fdb85df99e5e9472c9f6fd6432dc4f9d74 (diff)
parente2b87969834f132457e11f09025845d68b6cf185 (diff)
downloadnixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar.gz
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar.bz2
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar.lz
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar.xz
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.tar.zst
nixlib-fc4ab420d98662cf93edeb4bf460c90c1feb7ec8.zip
Merge pull request #40959 from alexvorobiev/clustershell
pythonPackages.clustershell: init at 1.8
-rw-r--r--pkgs/development/python-modules/clustershell/default.nix89
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 91 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/clustershell/default.nix b/pkgs/development/python-modules/clustershell/default.nix
new file mode 100644
index 000000000000..617b0ea101fc
--- /dev/null
+++ b/pkgs/development/python-modules/clustershell/default.nix
@@ -0,0 +1,89 @@
+{ stdenv, buildPythonPackage, fetchPypi, pyyaml, openssh
+, nose, bc, hostname, coreutils, bash, gnused
+}:
+
+buildPythonPackage rec {
+  pname = "ClusterShell";
+  version = "1.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1bm0pq8w2rql9q9i2bhs865rqvb6zck3h3gkb1d0mh59arrr7p4m";
+  };
+
+  propagatedBuildInputs = [ pyyaml ];
+
+  postPatch = ''
+    substituteInPlace lib/ClusterShell/Worker/Ssh.py \
+      --replace '"ssh"' '"${openssh}/bin/ssh"' \
+      --replace '"scp"' '"${openssh}/bin/scp"'
+
+    substituteInPlace lib/ClusterShell/Worker/fastsubprocess.py \
+      --replace '"/bin/sh"' '"${bash}/bin/sh"'
+  '';
+
+  checkInputs = [ nose bc hostname coreutils gnused ];
+
+  # Many tests want to open network connections
+  # https://github.com/cea-hpc/clustershell#test-suite
+  #
+  # Several tests fail on Darwin
+  checkPhase = ''
+    for f in tests/*; do
+      substituteInPlace $f \
+        --replace '/bin/hostname'   '${hostname}/bin/hostname' \
+        --replace '/bin/sleep'      '${coreutils}/bin/sleep' \
+        --replace '"sleep'          '"${coreutils}/bin/sleep' \
+        --replace '/bin/echo'       '${coreutils}/bin/echo' \
+        --replace '/bin/uname'      '${coreutils}/bin/uname' \
+        --replace '/bin/false'      '${coreutils}/bin/false' \
+        --replace '/bin/true'       '${coreutils}/bin/true' \
+        --replace '/usr/bin/printf' '${coreutils}/bin/printf' \
+        --replace '"sed'            '"${gnused}/bin/sed' \
+        --replace ' sed '           ' ${gnused}/bin/sed '
+    done
+
+    rm tests/CLIClushTest.py
+    rm tests/TreeWorkerTest.py
+    rm tests/TaskDistantMixin.py
+    rm tests/TaskDistantTest.py
+    rm tests/TaskDistantPdshMixin.py
+    rm tests/TaskDistantPdshTest.py
+    rm tests/TaskRLimitsTest.py
+
+    nosetests -v \
+      -e test_channel_ctl_shell_remote1 \
+      -e test_channel_ctl_shell_remote2 \
+      -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_channel_ctl_shell_mlocal1 \
+      -e test_channel_ctl_shell_mlocal2 \
+      -e test_channel_ctl_shell_mlocal3 \
+      -e test_node_placeholder \
+    tests/*.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Scalable Python framework for cluster administration";
+    homepage = https://cea-hpc.github.io/clustershell;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.alexvorobiev ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 673b22c401cd..ed293fb770ea 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -233,6 +233,8 @@ in {
 
   cdecimal = callPackage ../development/python-modules/cdecimal { };
 
+  clustershell = callPackage ../development/python-modules/clustershell { };
+
   dendropy = callPackage ../development/python-modules/dendropy { };
 
   dbf = callPackage ../development/python-modules/dbf { };