Merge pull request #228427 from Et7f3/fix_pytest-ansible

python3Packages.pytest-ansible: 2.2.4 -> 3.0.0
This commit is contained in:
Fabian Affolter 2023-05-02 19:23:41 +02:00 committed by GitHub
commit 74e1c512cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,46 +1,71 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, ansible
, ansible-core
, coreutils
, coverage
, pytest
, mock
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "pytest-ansible";
version = "2.2.4";
version = "3.0.0";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "ansible";
repo = "pytest-ansible";
rev = "v${version}";
sha256 = "0vr015msciwzz20zplxalfmfx5hbg8rkf8vwjdg3z12fba8z8ks4";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-kxOp7ScpIIzEbM4VQa+3ByHzkPS8pzdYq82rggF9Fpk=";
};
patchPhase = ''
sed -i "s/'setuptools-markdown'//g" setup.py
postPatch = ''
substituteInPlace tests/conftest.py inventory \
--replace '/usr/bin/env' '${coreutils}/bin/env'
'';
buildInputs = [ pytest ];
buildInputs = [
pytest
];
# requires pandoc < 2.0
# buildInputs = [ setuptools-markdown ];
nativeCheckInputs = [ mock ];
propagatedBuildInputs = [ ansible ];
propagatedBuildInputs = [
ansible-core
];
# tests not included with release, even on github
doCheck = false;
nativeCheckInputs = [
coverage
pytestCheckHook
];
checkPhase = ''
HOME=$TMPDIR pytest tests/
preCheck = ''
export HOME=$TMPDIR
'';
pytestFlagsArray = [
"tests/"
];
disabledTests = [
# Host unreachable in the inventory
"test_become"
# [Errno -3] Temporary failure in name resolution
"test_connection_failure_v2"
"test_connection_failure_extra_inventory_v2"
];
pythonImportsCheck = [
"pytest_ansible"
];
meta = with lib; {
homepage = "https://github.com/jlaska/pytest-ansible";
description = "Plugin for py.test to simplify calling ansible modules from tests or fixtures";
homepage = "https://github.com/jlaska/pytest-ansible";
changelog = "https://github.com/ansible-community/pytest-ansible/releases/tag/v${version}";
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
# https://github.com/ansible-community/pytest-ansible/blob/v2.2.4/setup.py#L124
broken = lib.versionAtLeast ansible.version "2.10";
maintainers = with maintainers; [ costrouc ];
};
}