3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.pytest-ansible: equalize

- add changelog to meta
- add format
- disable on unsupported Python releases
This commit is contained in:
Fabian Affolter 2023-05-02 16:20:53 +02:00 committed by GitHub
parent 08080cc600
commit 0463551364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,31 +4,51 @@
, ansible-core , ansible-core
, coreutils , coreutils
, coverage , coverage
, pytest
, pytestCheckHook , pytestCheckHook
, pythonOlder
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pytest-ansible"; pname = "pytest-ansible";
version = "3.0.0"; version = "3.0.0";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ansible"; owner = "ansible";
repo = pname; repo = pname;
rev = "v${version}"; rev = "refs/tags/v${version}";
sha256 = "sha256-kxOp7ScpIIzEbM4VQa+3ByHzkPS8pzdYq82rggF9Fpk="; hash = "sha256-kxOp7ScpIIzEbM4VQa+3ByHzkPS8pzdYq82rggF9Fpk=";
}; };
postPatch = '' postPatch = ''
substituteInPlace tests/conftest.py inventory --replace '/usr/bin/env' '${coreutils}/bin/env' substituteInPlace tests/conftest.py inventory \
--replace '/usr/bin/env' '${coreutils}/bin/env'
''; '';
nativeCheckInputs = [ pytestCheckHook coverage ]; buildInputs = [
propagatedBuildInputs = [ ansible-core ]; pytest
];
format = "pyproject"; propagatedBuildInputs = [
ansible-core
];
nativeCheckInputs = [
coverage
pytestCheckHook
];
preCheck = ''
export HOME=$TMPDIR
'';
pytestFlagsArray = [
"tests/"
];
preCheck = "export HOME=$TMPDIR";
pytestFlagsArray = [ "tests/" ];
disabledTests = [ disabledTests = [
# Host unreachable in the inventory # Host unreachable in the inventory
"test_become" "test_become"
@ -37,10 +57,15 @@ buildPythonPackage rec {
"test_connection_failure_extra_inventory_v2" "test_connection_failure_extra_inventory_v2"
]; ];
pythonImportsCheck = [
"pytest_ansible"
];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/jlaska/pytest-ansible";
description = "Plugin for py.test to simplify calling ansible modules from tests or fixtures"; 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; license = licenses.mit;
maintainers = [ maintainers.costrouc ]; maintainers = with maintainers; [ costrouc ];
}; };
} }