nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, ansible-core
4, buildPythonPackage
5, fetchPypi
6, mock
7, openssh
8, pbr
9, pexpect
10, psutil
11, pytest-mock
12, pytest-timeout
13, pytest-xdist
14, pytestCheckHook
15, python-daemon
16, pyyaml
17, six
18}:
19
20buildPythonPackage rec {
21 pname = "ansible-runner";
22 version = "2.1.3";
23 format = "setuptools";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-2m5dD+gGDL5LnY7QbDYiGdu4GYu0C49WU29GZY2bnBo=";
28 };
29
30 nativeBuildInputs = [
31 pbr
32 ];
33
34 propagatedBuildInputs = [
35 ansible-core
36 psutil
37 pexpect
38 python-daemon
39 pyyaml
40 six
41 ];
42
43 checkInputs = [
44 ansible-core # required to place ansible CLI onto the PATH in tests
45 pytestCheckHook
46 pytest-mock
47 pytest-timeout
48 pytest-xdist
49 mock
50 openssh
51 ];
52
53 preCheck = ''
54 export HOME=$(mktemp -d)
55 export PATH="$PATH:$out/bin";
56 '';
57
58 disabledTests = [
59 # Requires network access
60 "test_callback_plugin_task_args_leak"
61 "test_env_accuracy"
62 # Times out on slower hardware
63 "test_large_stdout_blob"
64 # Failed: DID NOT RAISE <class 'RuntimeError'>
65 "test_validate_pattern"
66 ] ++ lib.optional stdenv.isDarwin [
67 # test_process_isolation_settings is currently broken on Darwin Catalina
68 # https://github.com/ansible/ansible-runner/issues/413
69 "process_isolation_settings"
70 ];
71
72 disabledTestPaths = [
73 # These tests unset PATH and then run executables like `bash` (see https://github.com/ansible/ansible-runner/pull/918)
74 "test/integration/test_runner.py"
75 "test/unit/test_runner.py"
76 ]
77 ++ lib.optionals stdenv.isDarwin [
78 # Integration tests on Darwin are not regularly passing in ansible-runner's own CI
79 "test/integration"
80 # These tests write to `/tmp` which is not writable on Darwin
81 "test/unit/config/test__base.py"
82 ];
83
84 pythonImportsCheck = [
85 "ansible_runner"
86 ];
87
88 meta = with lib; {
89 description = "Helps when interfacing with Ansible";
90 homepage = "https://github.com/ansible/ansible-runner";
91 license = licenses.asl20;
92 maintainers = with maintainers; [ costrouc ];
93 };
94}