2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-04-27 09:35:20 +00:00
|
|
|
, ansible-core
|
2022-01-07 04:07:37 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2020-04-24 23:36:52 +00:00
|
|
|
, mock
|
2021-12-06 16:07:01 +00:00
|
|
|
, openssh
|
2022-04-27 09:35:20 +00:00
|
|
|
, pbr
|
2022-01-07 04:07:37 +00:00
|
|
|
, pexpect
|
|
|
|
, psutil
|
2021-12-06 16:07:01 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytest-timeout
|
|
|
|
, pytest-xdist
|
|
|
|
, pytestCheckHook
|
2022-01-07 04:07:37 +00:00
|
|
|
, python-daemon
|
|
|
|
, pyyaml
|
|
|
|
, six
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-runner";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "2.1.3";
|
2022-01-07 04:07:37 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-03-30 09:31:56 +00:00
|
|
|
hash = "sha256-2m5dD+gGDL5LnY7QbDYiGdu4GYu0C49WU29GZY2bnBo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pbr
|
|
|
|
];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
ansible-core
|
2022-01-07 04:07:37 +00:00
|
|
|
psutil
|
|
|
|
pexpect
|
|
|
|
python-daemon
|
|
|
|
pyyaml
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
checkInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
ansible-core # required to place ansible CLI onto the PATH in tests
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
pytest-timeout
|
|
|
|
pytest-xdist
|
|
|
|
mock
|
|
|
|
openssh
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2022-01-07 04:07:37 +00:00
|
|
|
export PATH="$PATH:$out/bin";
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
disabledTests = [
|
2022-01-07 04:07:37 +00:00
|
|
|
# Requires network access
|
|
|
|
"test_callback_plugin_task_args_leak"
|
2021-12-06 16:07:01 +00:00
|
|
|
"test_env_accuracy"
|
2022-01-07 04:07:37 +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-12-06 16:07:01 +00:00
|
|
|
# test_process_isolation_settings is currently broken on Darwin Catalina
|
|
|
|
# https://github.com/ansible/ansible-runner/issues/413
|
2022-01-07 04:07:37 +00:00
|
|
|
"process_isolation_settings"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabledTestPaths = [
|
2022-01-07 04:07:37 +00:00
|
|
|
# These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918)
|
2021-12-06 16:07:01 +00:00
|
|
|
"test/integration/test_runner.py"
|
|
|
|
"test/unit/test_runner.py"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
2022-01-07 04:07:37 +00:00
|
|
|
# Integration tests on Darwin are not regularly passing in ansible-runner's own CI
|
2021-12-06 16:07:01 +00:00
|
|
|
"test/integration"
|
2022-01-07 04:07:37 +00:00
|
|
|
# These tests write to `/tmp` which is not writable on Darwin
|
2021-12-06 16:07:01 +00:00
|
|
|
"test/unit/config/test__base.py"
|
|
|
|
];
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"ansible_runner"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Helps when interfacing with Ansible";
|
|
|
|
homepage = "https://github.com/ansible/ansible-runner";
|
|
|
|
license = licenses.asl20;
|
2022-01-07 04:07:37 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|