2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
2024-09-26 11:04:55 +00:00
|
|
|
setuptools,
|
|
|
|
distutils,
|
2024-06-05 15:53:02 +00:00
|
|
|
pyyaml,
|
|
|
|
openssh,
|
2024-09-26 11:04:55 +00:00
|
|
|
unittestCheckHook,
|
2024-06-05 15:53:02 +00:00
|
|
|
bc,
|
|
|
|
hostname,
|
|
|
|
bash,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "clustershell";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.9.2";
|
2024-09-26 11:04:55 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "ClusterShell";
|
|
|
|
inherit version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-rsF/HG4GNBC+N49b+sDO2AyUI1G44wJNBUwQNPzShD0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
distutils
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/ClusterShell/Worker/Ssh.py \
|
2024-09-26 11:04:55 +00:00
|
|
|
--replace-fail '"ssh"' '"${openssh}/bin/ssh"' \
|
|
|
|
--replace-fail '"scp"' '"${openssh}/bin/scp"'
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
substituteInPlace lib/ClusterShell/Worker/fastsubprocess.py \
|
2024-09-26 11:04:55 +00:00
|
|
|
--replace-fail '"/bin/sh"' '"${bash}/bin/sh"'
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
for f in tests/*; do
|
|
|
|
substituteInPlace $f \
|
2024-09-26 11:04:55 +00:00
|
|
|
--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'
|
2022-08-12 12:06:08 +00:00
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [ pyyaml ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
bc
|
|
|
|
hostname
|
2024-09-26 11:04:55 +00:00
|
|
|
unittestCheckHook
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "ClusterShell" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
unittestFlagsArray = [
|
|
|
|
"tests"
|
|
|
|
"-p"
|
|
|
|
"'*Test.py'"
|
|
|
|
];
|
2024-07-27 06:49:29 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Many tests want to open network connections
|
|
|
|
# https://github.com/cea-hpc/clustershell#test-suite
|
|
|
|
#
|
|
|
|
# Several tests fail on Darwin
|
2024-09-26 11:04:55 +00:00
|
|
|
preCheck = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
2024-06-20 14:57:18 +00:00
|
|
|
rm tests/TreeGatewayTest.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Scalable Python framework for cluster administration";
|
|
|
|
homepage = "https://cea-hpc.github.io/clustershell";
|
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = [ maintainers.alexvorobiev ];
|
|
|
|
};
|
|
|
|
}
|