diff --git a/pkgs/development/python-modules/ansible-lint/default.nix b/pkgs/tools/admin/ansible/lint.nix similarity index 81% rename from pkgs/development/python-modules/ansible-lint/default.nix rename to pkgs/tools/admin/ansible/lint.nix index f50b333065f6..589e4284299b 100644 --- a/pkgs/development/python-modules/ansible-lint/default.nix +++ b/pkgs/tools/admin/ansible/lint.nix @@ -1,33 +1,14 @@ { lib -, buildPythonPackage +, python3 , fetchPypi -, setuptools -, setuptools-scm -, ansible-core -, black -, filelock -, flaky -, jsonschema -, packaging -, pythonOlder -, pytest-xdist -, pytestCheckHook -, pythonRelaxDepsHook -, pyyaml -, rich -, ruamel-yaml -, subprocess-tee -, wcmatch -, yamllint +, ansible }: -buildPythonPackage rec { +python3.pkgs.buildPythonApplication rec { pname = "ansible-lint"; version = "6.16.0"; format = "pyproject"; - disabled = pythonOlder "3.8"; - src = fetchPypi { inherit pname version; hash = "sha256-34Lzk18SCeMHRAjurl6DfM7G/VLB0xJmif9BJKuwpcs="; @@ -39,7 +20,7 @@ buildPythonPackage rec { --replace "sys.exit(1)" "" ''; - nativeBuildInputs = [ + nativeBuildInputs = with python3.pkgs; [ setuptools setuptools-scm pythonRelaxDepsHook @@ -49,7 +30,7 @@ buildPythonPackage rec { "ruamel.yaml" ]; - propagatedBuildInputs = [ + propagatedBuildInputs = with python3.pkgs; [ # https://github.com/ansible/ansible-lint/blob/master/.config/requirements.in ansible-core black @@ -67,7 +48,7 @@ buildPythonPackage rec { # tests can't be easily run without installing things from ansible-galaxy doCheck = false; - nativeCheckInputs = [ + nativeCheckInputs = with python3.pkgs; [ flaky pytest-xdist pytestCheckHook @@ -76,7 +57,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-core ]} + export PATH=$PATH:${lib.makeBinPath [ ansible ]} # create a working ansible-lint executable export PATH=$PATH:$PWD/src/ansiblelint @@ -102,7 +83,7 @@ buildPythonPackage rec { "test_discover_lintables_umlaut" ]; - makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible-core ]}" ]; + makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible ]}" ]; meta = with lib; { description = "Best practices checker for Ansible"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2246de4b9d11..5bec83390d0b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17567,7 +17567,7 @@ with pkgs; ansible-later = with python3.pkgs; toPythonApplication ansible-later; - ansible-lint = with python3.pkgs; toPythonApplication ansible-lint; + ansible-lint = callPackage ../tools/admin/ansible/lint.nix { }; antlr2 = callPackage ../development/tools/parsing/antlr/2.7.7.nix { }; antlr3_4 = callPackage ../development/tools/parsing/antlr/3.4.nix { }; diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 85f68182349d..5eb1ee78bb4c 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -36,6 +36,7 @@ mapAliases ({ abodepy = jaraco-abode; # added 2023-02-01 aioh2 = throw "aioh2 has been removed because it is abandoned and broken."; # Added 2022-03-30 ansible-base = throw "ansible-base has been removed, because it is end of life"; # added 2022-03-30 + ansible-lint = throw "ansible-lint has been promoted to a top-level attribute"; # Added 2023-05-16 anyjson = throw "anyjson has been removed, it was using setuptools 2to3 translation feature, which has been removed in setuptools 58"; # added 2022-01-18 argon2_cffi = argon2-cffi; # added 2022-05-09 APScheduler = apscheduler; # added 2023-02-19 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fc10f81e28b8..4087aa14a5c0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -500,8 +500,6 @@ self: super: with self; { ansible-later = callPackage ../development/python-modules/ansible-later { }; - ansible-lint = callPackage ../development/python-modules/ansible-lint { }; - ansible-runner = callPackage ../development/python-modules/ansible-runner { }; ansi = callPackage ../development/python-modules/ansi { };