2019-02-24 22:06:53 +00:00
|
|
|
{ lib
|
2020-02-19 03:42:40 +00:00
|
|
|
, stdenv
|
2022-04-26 09:27:47 +00:00
|
|
|
, ansible-core
|
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-11-03 08:27:16 +00:00
|
|
|
, pythonOlder
|
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-11-02 23:14:03 +00:00
|
|
|
version = "2.3.0";
|
2022-01-05 08:38:24 +00:00
|
|
|
format = "setuptools";
|
2019-02-24 22:06:53 +00:00
|
|
|
|
2022-11-03 08:27:16 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2019-02-24 22:06:53 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-11-02 23:14:03 +00:00
|
|
|
hash = "sha256-mcTfu+reRGOXvRqeC/BQhz2KBrWSbVXSQIWyld2/Ecs=";
|
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 = [
|
2022-04-26 09:27:47 +00:00
|
|
|
ansible-core
|
2022-01-05 08:38:24 +00:00
|
|
|
psutil
|
|
|
|
pexpect
|
|
|
|
python-daemon
|
|
|
|
pyyaml
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2021-11-06 09:14:50 +00:00
|
|
|
checkInputs = [
|
2022-04-26 09:27:47 +00:00
|
|
|
ansible-core # required to place ansible CLI onto the PATH in tests
|
2021-11-06 09:14:50 +00:00
|
|
|
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";
|
2022-07-31 00:58:09 +00:00
|
|
|
# avoid coverage flags
|
|
|
|
rm pytest.ini
|
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"
|
2022-10-06 16:38:53 +00:00
|
|
|
] ++ lib.optionals 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
|
|
|
};
|
|
|
|
}
|