From 740ec536a957b302ceedce84d7a9db6cc23f7b8e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 31 Dec 2024 14:36:51 +0100 Subject: [PATCH] python312Packages.ansible-runner: fix --- .../python-modules/ansible-runner/default.nix | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/pkgs/development/python-modules/ansible-runner/default.nix b/pkgs/development/python-modules/ansible-runner/default.nix index 11d0f37773e4..d4f047917fb6 100644 --- a/pkgs/development/python-modules/ansible-runner/default.nix +++ b/pkgs/development/python-modules/ansible-runner/default.nix @@ -1,24 +1,31 @@ { lib, stdenv, - ansible-core, buildPythonPackage, - fetchPypi, - glibcLocales, - importlib-metadata, - mock, - openssh, + fetchFromGitHub, + + # build-system + setuptools, + setuptools-scm, + + # dependencies packaging, pexpect, + python-daemon, + pyyaml, + pythonOlder, + importlib-metadata, + + # tests + ansible-core, + glibcLocales, + mock, + openssh, pytest-mock, pytest-timeout, pytest-xdist, pytestCheckHook, - pythonOlder, - python-daemon, - pyyaml, - setuptools, - setuptools-scm, + versionCheckHook, }: buildPythonPackage rec { @@ -26,11 +33,11 @@ buildPythonPackage rec { version = "2.4.0"; pyproject = true; - disabled = pythonOlder "3.9"; - - src = fetchPypi { - inherit pname version; - hash = "sha256-gtArJUiDDzelNRe2XII8SvNxBpQGx9ITtckEHUXgxbY="; + src = fetchFromGitHub { + owner = "ansible"; + repo = "ansible-runner"; + tag = version; + hash = "sha256-lmaYTdJ7NlaCJ5/CVds6Xzwbe45QXbtS3h8gi5xqvUc="; }; postPatch = '' @@ -53,13 +60,15 @@ buildPythonPackage rec { nativeCheckInputs = [ ansible-core # required to place ansible CLI onto the PATH in tests glibcLocales - pytestCheckHook + mock + openssh pytest-mock pytest-timeout pytest-xdist - mock - openssh + pytestCheckHook + versionCheckHook ]; + versionCheckProgramArg = [ "--version" ]; preCheck = '' export HOME=$(mktemp -d) @@ -77,10 +86,11 @@ buildPythonPackage rec { # Failed: DID NOT RAISE "test_validate_pattern" # Assertion error + "test_callback_plugin_censoring_does_not_overwrite" "test_get_role_list" "test_include_role_from_collection_events" + "test_module_level_no_log" "test_resolved_actions" - "test_callback_plugin_censoring_does_not_overwrite" ]; disabledTestPaths = @@ -98,11 +108,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "ansible_runner" ]; - meta = with lib; { + meta = { description = "Helps when interfacing with Ansible"; homepage = "https://github.com/ansible/ansible-runner"; changelog = "https://github.com/ansible/ansible-runner/releases/tag/${version}"; - license = licenses.asl20; + license = lib.licenses.asl20; maintainers = [ ]; mainProgram = "ansible-runner"; };