From 27d0d8d64b4aa5b12065ec75061666d60bb9cccd Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 28 Mar 2022 08:17:53 +0000 Subject: [PATCH 1/2] python310Packages.ansible-later: 2.0.6 -> 2.0.8 --- pkgs/development/python-modules/ansible-later/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/ansible-later/default.nix b/pkgs/development/python-modules/ansible-later/default.nix index e671063acce..573a8d3919b 100644 --- a/pkgs/development/python-modules/ansible-later/default.nix +++ b/pkgs/development/python-modules/ansible-later/default.nix @@ -19,14 +19,14 @@ buildPythonPackage rec { pname = "ansible-later"; - version = "2.0.6"; + version = "2.0.8"; format = "pyproject"; src = fetchFromGitHub { owner = "thegeeklab"; repo = "ansible-later"; rev = "v${version}"; - sha256 = "sha256-vg9ryzl9ZeOGuFLL1yeJ3vGNPdo3ONmCQozY6DK6miY="; + sha256 = "sha256-oPlm9uxyN3hyf4gFv37YWEn/HOkg0QQ1Ya3tjLd53rQ="; }; postInstall = '' From 9c26dceb88f76bf503d474a2593175446f9bcdb4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 28 Mar 2022 11:03:40 +0200 Subject: [PATCH 2/2] python3Packages.ansible-later: set version, enable tests --- .../python-modules/ansible-later/default.nix | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/pkgs/development/python-modules/ansible-later/default.nix b/pkgs/development/python-modules/ansible-later/default.nix index 573a8d3919b..9857c810ddb 100644 --- a/pkgs/development/python-modules/ansible-later/default.nix +++ b/pkgs/development/python-modules/ansible-later/default.nix @@ -1,16 +1,18 @@ -{ buildPythonPackage -, fetchFromGitHub -, lib - -# pythonPackages +{ lib , anyconfig , appdirs +, buildPythonPackage , colorama +, fetchFromGitHub , flake8 , jsonschema , nested-lookup +, pathspec , poetry-core +, pytest-mock , python-json-logger +, pytestCheckHook +, pythonOlder , pyyaml , toolz , unidiff @@ -19,27 +21,18 @@ buildPythonPackage rec { pname = "ansible-later"; - version = "2.0.8"; + version = "2.0.6"; format = "pyproject"; + disabled = pythonOlder "3.8"; + src = fetchFromGitHub { owner = "thegeeklab"; - repo = "ansible-later"; + repo = pname; rev = "v${version}"; - sha256 = "sha256-oPlm9uxyN3hyf4gFv37YWEn/HOkg0QQ1Ya3tjLd53rQ="; + hash = "sha256-vg9ryzl9ZeOGuFLL1yeJ3vGNPdo3ONmCQozY6DK6miY="; }; - postInstall = '' - rm $out/lib/python*/site-packages/LICENSE - ''; - - postPatch = '' - substituteInPlace pyproject.toml \ - --replace 'PyYAML = "6.0"' 'PyYAML = "*"' \ - --replace 'unidiff = "0.7.3"' 'unidiff = "*"' \ - --replace 'jsonschema = "4.4.0"' 'jsonschema = "*"' - ''; - nativeBuildInputs = [ poetry-core ]; @@ -51,6 +44,7 @@ buildPythonPackage rec { flake8 jsonschema nested-lookup + pathspec python-json-logger pyyaml toolz @@ -58,12 +52,30 @@ buildPythonPackage rec { yamllint ]; - # no tests - doCheck = false; - pythonImportsCheck = [ "ansiblelater" ]; + checkInputs = [ + pytest-mock + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'version = "0.0.0"' 'version = "${version}"' \ + --replace " --cov=ansiblelater --cov-report=xml:coverage.xml --cov-report=term --cov-append --no-cov-on-fail" "" \ + --replace 'PyYAML = "6.0"' 'PyYAML = "*"' \ + --replace 'unidiff = "0.7.3"' 'unidiff = "*"' \ + --replace 'jsonschema = "4.4.0"' 'jsonschema = "*"' + ''; + + postInstall = '' + rm $out/lib/python*/site-packages/LICENSE + ''; + + pythonImportsCheck = [ + "ansiblelater" + ]; meta = with lib; { - description = "Another best practice scanner for Ansible roles and playbooks"; + description = "Best practice scanner for Ansible roles and playbooks"; homepage = "https://github.com/thegeeklab/ansible-later"; license = licenses.mit; maintainers = with maintainers; [ tboerger ];