From 7cd876f22d58f2f977c1b8dfdb9d4316cdbd52ec Mon Sep 17 00:00:00 2001 From: Thilo Uttendorfer Date: Fri, 14 May 2021 02:48:03 +0200 Subject: [PATCH] pythonPackages.ansible-lint: 5.0.2 -> 5.0.8 (#122442) --- .../python-modules/ansible-lint/default.nix | 81 +++++++++++-------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/pkgs/development/python-modules/ansible-lint/default.nix b/pkgs/development/python-modules/ansible-lint/default.nix index 8388cd33e084..c6d66bc53155 100644 --- a/pkgs/development/python-modules/ansible-lint/default.nix +++ b/pkgs/development/python-modules/ansible-lint/default.nix @@ -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; {