From c96f661c08b7d35cf5b681c019183d8ba9b2ee8e Mon Sep 17 00:00:00 2001 From: emaryn Date: Tue, 15 Apr 2025 06:56:52 +0800 Subject: [PATCH 1/2] python313Packages.ansible-compat: 25.1.2 -> 25.1.5 --- .../python-modules/ansible-compat/default.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/ansible-compat/default.nix b/pkgs/development/python-modules/ansible-compat/default.nix index 4098fa11b845..6f8f79c5fe2f 100644 --- a/pkgs/development/python-modules/ansible-compat/default.nix +++ b/pkgs/development/python-modules/ansible-compat/default.nix @@ -18,18 +18,19 @@ pytest-mock, pytest-instafail, pytestCheckHook, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { pname = "ansible-compat"; - version = "25.1.2"; + version = "25.1.5"; pyproject = true; src = fetchFromGitHub { owner = "ansible"; repo = "ansible-compat"; tag = "v${version}"; - hash = "sha256-AElonUB2zXB3ZcRTwuaYpEQJYHtPw2lD3tBNMEqwuKo="; + hash = "sha256-fc+PXw9sT+CQFwcajuJC1IcAECbNiklzVTGFsZWUJGY="; }; build-system = [ @@ -42,20 +43,20 @@ buildPythonPackage rec { subprocess-tee ]; - preCheck = '' - export HOME=$(mktemp -d) - substituteInPlace test/test_runtime.py \ - --replace-fail "printenv" "${lib.getExe' coreutils "printenv"}" - ''; - nativeCheckInputs = [ ansible-core flaky pytest-mock pytest-instafail pytestCheckHook + writableTmpDirAsHomeHook ]; + preCheck = '' + substituteInPlace test/test_runtime.py \ + --replace-fail "printenv" "${lib.getExe' coreutils "printenv"}" + ''; + disabledTests = [ # require network "test_install_collection" @@ -74,6 +75,7 @@ buildPythonPackage rec { "test_runtime_example" "test_scan_sys_path" "test_upgrade_collection" + "test_ro_venv" ]; pythonImportsCheck = [ "ansible_compat" ]; From 4c9acd05a67dea18c2862586c6a7d6283e65a800 Mon Sep 17 00:00:00 2001 From: emaryn Date: Tue, 15 Apr 2025 06:57:12 +0800 Subject: [PATCH 2/2] ansible-lint: 24.12.2 -> 25.2.1 --- pkgs/by-name/an/ansible-lint/package.nix | 49 ++++++++++++------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/pkgs/by-name/an/ansible-lint/package.nix b/pkgs/by-name/an/ansible-lint/package.nix index aacb554af567..0b730c94d4d1 100644 --- a/pkgs/by-name/an/ansible-lint/package.nix +++ b/pkgs/by-name/an/ansible-lint/package.nix @@ -1,37 +1,34 @@ { lib, - python3, + python3Packages, fetchPypi, ansible, + writableTmpDirAsHomeHook, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "ansible-lint"; - version = "24.12.2"; - format = "pyproject"; + version = "25.2.1"; + pyproject = true; src = fetchPypi { inherit version; pname = "ansible_lint"; - hash = "sha256-9jYwnE5/ck/BpUTfUpxMI1T1TPNe3hHXUDZq+xFYpGQ="; + hash = "sha256-7Esfz6i+8T9Uf+76IupoZN79kCs6Jn749MU0GXb0X/E="; }; postPatch = '' # it is fine if lint tools are missing substituteInPlace conftest.py \ - --replace "sys.exit(1)" "" + --replace-fail "sys.exit(1)" "" ''; - nativeBuildInputs = with python3.pkgs; [ + build-system = with python3Packages; [ setuptools setuptools-scm ]; - pythonRelaxDeps = [ - "ruamel.yaml" - ]; - - propagatedBuildInputs = with python3.pkgs; [ + dependencies = with python3Packages; [ # https://github.com/ansible/ansible-lint/blob/master/.config/requirements.in ansible-core ansible-compat @@ -48,20 +45,24 @@ python3.pkgs.buildPythonApplication rec { yamllint ]; + pythonRelaxDeps = [ "ruamel.yaml" ]; + # tests can't be easily run without installing things from ansible-galaxy doCheck = false; - nativeCheckInputs = with python3.pkgs; [ - flaky - pytest-xdist - pytestCheckHook - ]; + nativeCheckInputs = + with python3Packages; + [ + flaky + pytest-xdist + pytestCheckHook + ] + ++ [ + writableTmpDirAsHomeHook + ansible + ]; preCheck = '' - # ansible wants to write to $HOME and crashes if it can't - export HOME=$(mktemp -d) - export PATH=$PATH:${lib.makeBinPath [ ansible ]} - # create a working ansible-lint executable export PATH=$PATH:$PWD/src/ansiblelint ln -rs src/ansiblelint/__main__.py src/ansiblelint/ansible-lint @@ -88,12 +89,12 @@ python3.pkgs.buildPythonApplication rec { makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ansible ]}" ]; - meta = with lib; { + meta = { description = "Best practices checker for Ansible"; mainProgram = "ansible-lint"; homepage = "https://github.com/ansible/ansible-lint"; changelog = "https://github.com/ansible/ansible-lint/releases/tag/v${version}"; - license = licenses.mit; - maintainers = with maintainers; [ sengaya ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ sengaya ]; }; }