lol

Merge pull request #228427 from Et7f3/fix_pytest-ansible

python3Packages.pytest-ansible: 2.2.4 -> 3.0.0

authored by

Fabian Affolter and committed by
GitHub
74e1c512 b04b3345

+46 -21
+46 -21
pkgs/development/python-modules/pytest-ansible/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 - , ansible 4 + , ansible-core 5 + , coreutils 6 + , coverage 5 7 , pytest 6 - , mock 8 + , pytestCheckHook 9 + , pythonOlder 7 10 }: 8 11 9 12 buildPythonPackage rec { 10 13 pname = "pytest-ansible"; 11 - version = "2.2.4"; 14 + version = "3.0.0"; 15 + format = "pyproject"; 16 + 17 + disabled = pythonOlder "3.9"; 12 18 13 19 src = fetchFromGitHub { 14 20 owner = "ansible"; 15 - repo = "pytest-ansible"; 16 - rev = "v${version}"; 17 - sha256 = "0vr015msciwzz20zplxalfmfx5hbg8rkf8vwjdg3z12fba8z8ks4"; 21 + repo = pname; 22 + rev = "refs/tags/v${version}"; 23 + hash = "sha256-kxOp7ScpIIzEbM4VQa+3ByHzkPS8pzdYq82rggF9Fpk="; 18 24 }; 19 25 20 - patchPhase = '' 21 - sed -i "s/'setuptools-markdown'//g" setup.py 26 + postPatch = '' 27 + substituteInPlace tests/conftest.py inventory \ 28 + --replace '/usr/bin/env' '${coreutils}/bin/env' 22 29 ''; 23 30 24 - buildInputs = [ pytest ]; 31 + buildInputs = [ 32 + pytest 33 + ]; 25 34 26 - # requires pandoc < 2.0 27 - # buildInputs = [ setuptools-markdown ]; 28 - nativeCheckInputs = [ mock ]; 29 - propagatedBuildInputs = [ ansible ]; 35 + propagatedBuildInputs = [ 36 + ansible-core 37 + ]; 30 38 31 - # tests not included with release, even on github 32 - doCheck = false; 39 + nativeCheckInputs = [ 40 + coverage 41 + pytestCheckHook 42 + ]; 33 43 34 - checkPhase = '' 35 - HOME=$TMPDIR pytest tests/ 44 + preCheck = '' 45 + export HOME=$TMPDIR 36 46 ''; 37 47 48 + pytestFlagsArray = [ 49 + "tests/" 50 + ]; 51 + 52 + disabledTests = [ 53 + # Host unreachable in the inventory 54 + "test_become" 55 + # [Errno -3] Temporary failure in name resolution 56 + "test_connection_failure_v2" 57 + "test_connection_failure_extra_inventory_v2" 58 + ]; 59 + 60 + pythonImportsCheck = [ 61 + "pytest_ansible" 62 + ]; 63 + 38 64 meta = with lib; { 39 - homepage = "https://github.com/jlaska/pytest-ansible"; 40 65 description = "Plugin for py.test to simplify calling ansible modules from tests or fixtures"; 66 + homepage = "https://github.com/jlaska/pytest-ansible"; 67 + changelog = "https://github.com/ansible-community/pytest-ansible/releases/tag/v${version}"; 41 68 license = licenses.mit; 42 - maintainers = [ maintainers.costrouc ]; 43 - # https://github.com/ansible-community/pytest-ansible/blob/v2.2.4/setup.py#L124 44 - broken = lib.versionAtLeast ansible.version "2.10"; 69 + maintainers = with maintainers; [ costrouc ]; 45 70 }; 46 71 }