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