2019-02-24 22:06:53 +00:00
|
|
|
{ lib
|
2020-02-19 03:42:40 +00:00
|
|
|
, stdenv
|
2019-02-24 22:06:53 +00:00
|
|
|
, ansible
|
2022-01-05 08:38:24 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2019-02-24 22:06:53 +00:00
|
|
|
, mock
|
2021-11-06 09:14:50 +00:00
|
|
|
, openssh
|
2022-04-14 14:22:40 +00:00
|
|
|
, pbr
|
2022-01-05 08:38:24 +00:00
|
|
|
, pexpect
|
|
|
|
, psutil
|
2021-11-06 09:14:50 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2022-01-05 08:38:24 +00:00
|
|
|
, python-daemon
|
|
|
|
, pyyaml
|
|
|
|
, six
|
2019-02-24 22:06:53 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-runner";
|
2022-03-23 21:29:23 +00:00
|
|
|
version = "2.1.3";
|
2022-01-05 08:38:24 +00:00
|
|
|
format = "setuptools";
|
2019-02-24 22:06:53 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-03-23 21:29:23 +00:00
|
|
|
hash = "sha256-2m5dD+gGDL5LnY7QbDYiGdu4GYu0C49WU29GZY2bnBo=";
|
2019-02-24 22:06:53 +00:00
|
|
|
};
|
|
|
|
|
2022-04-14 14:22:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pbr
|
|
|
|
];
|
|
|
|
|
2022-01-05 08:38:24 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
ansible
|
|
|
|
psutil
|
|
|
|
pexpect
|
|
|
|
python-daemon
|
|
|
|
pyyaml
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2021-11-06 09:14:50 +00:00
|
|
|
checkInputs = [
|
|
|
|
ansible # required to place ansible CLI onto the PATH in tests
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
mock
|
|
|
|
openssh
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2022-01-05 08:38:24 +00:00
|
|
|
export PATH="$PATH:$out/bin";
|
2019-02-24 22:06:53 +00:00
|
|
|
'';
|
|
|
|
|
2021-11-06 09:14:50 +00:00
|
|
|
disabledTests = [
|
2022-01-05 08:38:24 +00:00
|
|
|
# Requires network access
|
|
|
|
"test_callback_plugin_task_args_leak"
|
2021-11-06 09:14:50 +00:00
|
|
|
"test_env_accuracy"
|
2022-01-05 08:38:24 +00:00
|
|
|
# Times out on slower hardware
|
|
|
|
"test_large_stdout_blob"
|
|
|
|
# Failed: DID NOT RAISE <class 'RuntimeError'>
|
|
|
|
"test_validate_pattern"
|
|
|
|
] ++ lib.optional stdenv.isDarwin [
|
2021-11-06 09:14:50 +00:00
|
|
|
# test_process_isolation_settings is currently broken on Darwin Catalina
|
|
|
|
# https://github.com/ansible/ansible-runner/issues/413
|
2022-01-05 08:38:24 +00:00
|
|
|
"process_isolation_settings"
|
|
|
|
];
|
2021-11-06 09:14:50 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
2022-01-05 08:38:24 +00:00
|
|
|
# These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918)
|
2021-11-06 09:14:50 +00:00
|
|
|
"test/integration/test_runner.py"
|
|
|
|
"test/unit/test_runner.py"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
2022-01-05 08:38:24 +00:00
|
|
|
# Integration tests on Darwin are not regularly passing in ansible-runner's own CI
|
2021-11-06 09:14:50 +00:00
|
|
|
"test/integration"
|
2022-01-05 08:38:24 +00:00
|
|
|
# These tests write to `/tmp` which is not writable on Darwin
|
2021-11-06 09:14:50 +00:00
|
|
|
"test/unit/config/test__base.py"
|
|
|
|
];
|
|
|
|
|
2022-01-05 08:38:24 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"ansible_runner"
|
|
|
|
];
|
|
|
|
|
2019-02-24 22:06:53 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Helps when interfacing with Ansible";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/ansible/ansible-runner";
|
2019-02-24 22:06:53 +00:00
|
|
|
license = licenses.asl20;
|
2022-01-05 08:38:24 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2019-02-24 22:06:53 +00:00
|
|
|
};
|
|
|
|
}
|