mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-10-02 10:00:18 +02:00
Merge pull request #166283 from SuperSandro2000/ansible-lint
This commit is contained in:
commit
aaf26cbb37
66
pkgs/development/python-modules/ansible-compat/default.nix
Normal file
66
pkgs/development/python-modules/ansible-compat/default.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, ansible
|
||||
, flaky
|
||||
, pytest-mock
|
||||
, pytestCheckHook
|
||||
, pyyaml
|
||||
, setuptools-scm
|
||||
, subprocess-tee
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-compat";
|
||||
version = "2.0.2";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-xlGZXcMj7xRbq4V/7mVA/ryIH7cbf+r+gWPUnicxY6U=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyyaml
|
||||
subprocess-tee
|
||||
];
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
export PATH=$PATH:$out/bin
|
||||
'';
|
||||
|
||||
checkInputs = [
|
||||
ansible
|
||||
flaky
|
||||
pytest-mock
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# require network
|
||||
"test_prepare_environment_with_collections"
|
||||
"test_prerun_reqs_v1"
|
||||
"test_prerun_reqs_v2"
|
||||
"test_require_collection_wrong_version"
|
||||
"test_require_collection"
|
||||
"test_install_collection"
|
||||
"test_install_collection_dest"
|
||||
"test_upgrade_collection"
|
||||
"test_require_collection_no_cache_dir"
|
||||
"test_runtime"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "ansible_compat" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A python package containing functions that help interacting with various versions of Ansible";
|
||||
homepage = "https://github.com/ansible/ansible-compat";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ SuperSandro2000 ];
|
||||
};
|
||||
}
|
|
@ -1,49 +1,58 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, isPy27
|
||||
, fetchPypi
|
||||
, setuptools-scm
|
||||
, ansible-base
|
||||
, ansible-compat
|
||||
, ansible-core
|
||||
, enrich
|
||||
, flaky
|
||||
, pyyaml
|
||||
, rich
|
||||
, ruamel-yaml
|
||||
, tenacity
|
||||
, wcmatch
|
||||
, yamllint
|
||||
, pythonOlder
|
||||
, pytest-xdist
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ansible-lint";
|
||||
version = "5.3.2";
|
||||
disabled = isPy27;
|
||||
version = "6.0.2";
|
||||
format = "pyproject";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-m6iG20xE5ZNgvI1mjwvq5hk8Ch/LuedhJwAMo6ztfCg=";
|
||||
sha256 = "sha256-tTm8ItE+beDMLiV1jh0osrwBVhpBSuN87aNwi1oqee0=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# it is fine if lint tools are missing
|
||||
substituteInPlace conftest.py \
|
||||
--replace "sys.exit(1)" ""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
ansible-base
|
||||
ansible-compat
|
||||
ansible-core
|
||||
enrich
|
||||
flaky
|
||||
pyyaml
|
||||
rich
|
||||
ruamel-yaml
|
||||
tenacity
|
||||
wcmatch
|
||||
yamllint
|
||||
];
|
||||
|
||||
# tests can't be easily run without installing things from ansible-galaxy
|
||||
doCheck = false;
|
||||
|
||||
checkInputs = [
|
||||
flaky
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
@ -55,7 +64,7 @@ buildPythonPackage rec {
|
|||
preCheck = ''
|
||||
# ansible wants to write to $HOME and crashes if it can't
|
||||
export HOME=$(mktemp -d)
|
||||
export PATH=$PATH:${lib.makeBinPath [ ansible-base ]}
|
||||
export PATH=$PATH:${lib.makeBinPath [ ansible-core ]}
|
||||
|
||||
# create a working ansible-lint executable
|
||||
export PATH=$PATH:$PWD/src/ansiblelint
|
||||
|
@ -82,7 +91,7 @@ buildPythonPackage rec {
|
|||
"test_discover_lintables_umlaut"
|
||||
];
|
||||
|
||||
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible-base ]}" ];
|
||||
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible-core ]}" ];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/ansible-community/ansible-lint";
|
||||
|
|
|
@ -520,6 +520,8 @@ in {
|
|||
|
||||
ansible-base = callPackage ../development/python-modules/ansible/base.nix { };
|
||||
|
||||
ansible-compat = callPackage ../development/python-modules/ansible-compat { };
|
||||
|
||||
ansible-core = callPackage ../development/python-modules/ansible/core.nix { };
|
||||
|
||||
ansible-doctor = callPackage ../development/python-modules/ansible-doctor { };
|
||||
|
|
Loading…
Reference in a new issue