python312Packages.clustershell: drop nose dependency

This commit is contained in:
Sigmanificient
2024-08-24 01:17:31 +02:00
parent 52518ccfd2
commit 5e6cc7bd5a
@@ -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; {