pythonPackages.ansible-lint: 5.0.2 -> 5.0.8 (#122442)

This commit is contained in:
Thilo Uttendorfer 2021-05-14 02:48:03 +02:00 committed by GitHub
parent 1cdf5f4436
commit 7cd876f22d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,41 +1,66 @@
{ lib
, stdenv
, fetchPypi
, buildPythonPackage
, isPy27
, ansible
, pyyaml
, ruamel-yaml
, rich
, pytestCheckHook
, pytest-xdist
, git
, wcmatch
, enrich
, fetchPypi
, python
, ansible
, enrich
, flaky
, pyyaml
, rich
, ruamel-yaml
, tenacity
, wcmatch
, yamllint
, pytest-xdist
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "ansible-lint";
version = "5.0.2";
version = "5.0.8";
disabled = isPy27;
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-vgt/KqNozTPaON/I19SybBZuo7bbl3Duq5dTBTMlj44=";
sha256 = "sha256-tnuWKEB66bwVuwu3H3mHG99ZP+/msGhMDMRL5fyQgD8=";
};
postPatch = ''
substituteInPlace src/ansiblelint/file_utils.py \
--replace 'raise RuntimeError("Unable to determine file type for %s" % pathex)' 'return "playbook"'
'';
buildInputs = [ python ];
propagatedBuildInputs = [ ansible enrich pyyaml rich ruamel-yaml wcmatch ];
propagatedBuildInputs = [
ansible
enrich
flaky
pyyaml
rich
ruamel-yaml
tenacity
wcmatch
yamllint
];
checkInputs = [ pytestCheckHook pytest-xdist git ];
checkInputs = [
pytest-xdist
pytestCheckHook
];
pytestFlagsArray = [
"--numprocesses" "auto"
];
postPatch = ''
# Both patches are addressed in https://github.com/ansible-community/ansible-lint/pull/1549
# and should be removed once merged upstream
# fixes test_get_yaml_files_umlaut and test_run_inside_role_dir
substituteInPlace src/ansiblelint/file_utils.py \
--replace 'os.path.join(root, name)' 'os.path.normpath(os.path.join(root, name))'
# fixes test_custom_kinds
substituteInPlace src/ansiblelint/file_utils.py \
--replace "if name.endswith('.yaml') or name.endswith('.yml')" ""
'';
preCheck = ''
# ansible wants to write to $HOME and crashes if it can't
@ -46,27 +71,17 @@ buildPythonPackage rec {
export PATH=$PATH:$PWD/src/ansiblelint
ln -rs src/ansiblelint/__main__.py src/ansiblelint/ansible-lint
patchShebangs src/ansiblelint/__main__.py
# create symlink like in the git repo so test_included_tasks does not fail
ln -s ../roles examples/playbooks/roles
'';
disabledTests = [
# requires network
"test_prerun_reqs_v1"
"test_prerun_reqs_v2"
# Assertion error with negative numbers; maybe requieres an ansible update?
"test_negative"
"test_example"
"test_playbook"
"test_included_tasks"
"test_long_line"
"test_get_yaml_files_umlaut"
"test_run_inside_role_dir"
"test_role_handler_positive"
];
# fails to run tests due to issues with temporary directory
doCheck = !stdenv.isDarwin;
makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible ]}" ];
meta = with lib; {