2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
ansible-core,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
fetchpatch,
|
|
|
|
glibcLocales,
|
|
|
|
importlib-metadata,
|
|
|
|
mock,
|
|
|
|
openssh,
|
|
|
|
pbr,
|
|
|
|
pexpect,
|
|
|
|
psutil,
|
|
|
|
pytest-mock,
|
|
|
|
pytest-timeout,
|
|
|
|
pytest-xdist,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
python-daemon,
|
|
|
|
pyyaml,
|
|
|
|
setuptools,
|
|
|
|
six,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "ansible-runner";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.3.6";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-shdKEtytLcLzQuqCh2iY9WigtmxTVoYAv4BXcVj8uhw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-tests.patch";
|
|
|
|
url = "https://github.com/ansible/ansible-runner/commit/0d522c90cfc1f305e118705a1b3335ccb9c1633d.patch";
|
|
|
|
hash = "sha256-eTnQkftvjK0YHU+ovotRVSuVlvaVeXp5SvYk1DPCg88=";
|
2024-06-05 15:53:02 +00:00
|
|
|
excludes = [
|
|
|
|
".github/workflows/ci.yml"
|
|
|
|
"tox.ini"
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|
2024-05-15 15:35:15 +00:00
|
|
|
(fetchpatch {
|
|
|
|
# python 3.12 compat
|
|
|
|
url = "https://github.com/ansible/ansible-runner/commit/dc248497bb2375a363222ce755bf3a31f21d5f64.patch";
|
|
|
|
hash = "sha256-QT28Iw0uENoO35rqZpYBcmJB/GNDEF4m86SKf6p0XQU=";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
2022-04-27 09:35:20 +00:00
|
|
|
pbr
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
dependencies = [
|
2022-04-27 09:35:20 +00:00
|
|
|
ansible-core
|
2022-01-07 04:07:37 +00:00
|
|
|
psutil
|
|
|
|
pexpect
|
|
|
|
python-daemon
|
|
|
|
pyyaml
|
|
|
|
six
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
|
2022-01-07 04:07:37 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
ansible-core # required to place ansible CLI onto the PATH in tests
|
2022-11-21 17:40:18 +00:00
|
|
|
glibcLocales
|
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";
|
2022-08-12 12:06:08 +00:00
|
|
|
# avoid coverage flags
|
|
|
|
rm pytest.ini
|
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"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTestPaths =
|
|
|
|
[
|
|
|
|
# These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918)
|
|
|
|
"test/integration/test_runner.py"
|
|
|
|
"test/unit/test_runner.py"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
# Integration tests on Darwin are not regularly passing in ansible-runner's own CI
|
|
|
|
"test/integration"
|
|
|
|
# These tests write to `/tmp` which is not writable on Darwin
|
|
|
|
"test/unit/config/test__base.py"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "ansible_runner" ];
|
2022-01-07 04:07:37 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Helps when interfacing with Ansible";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ansible-runner";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/ansible/ansible-runner";
|
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|