From be871f95e97c25964329541ddcc8a6519dddc95c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 17 Oct 2024 12:01:43 +0200 Subject: [PATCH] python312Packages.clikit: refactor --- .../python-modules/clikit/default.nix | 53 +++++++------------ 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/pkgs/development/python-modules/clikit/default.nix b/pkgs/development/python-modules/clikit/default.nix index 0ecca4ea0fa8..7231d0e44e76 100644 --- a/pkgs/development/python-modules/clikit/default.nix +++ b/pkgs/development/python-modules/clikit/default.nix @@ -1,57 +1,39 @@ { lib, buildPythonPackage, - fetchFromGitHub, - isPy27, - pythonAtLeast, - poetry-core, - - # propagates - pylev, - pastel, - - # python36+ crashtest, - - # python2 - typing, - enum34, - - # tests + fetchFromGitHub, + pastel, + poetry-core, + pylev, pytest-mock, pytestCheckHook, + pythonOlder, }: buildPythonPackage rec { pname = "clikit"; version = "0.6.2"; - format = "pyproject"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "sdispater"; - repo = pname; + repo = "clikit"; rev = "refs/tags/${version}"; hash = "sha256-xAsUNhVQBjtSFHyjjnicAKRC3+Tdn3AdGDUYhmOOIdA="; }; - postPatch = '' - substituteInPlace pyproject.toml --replace \ - 'crashtest = { version = "^0.3.0", python = "^3.6" }' \ - 'crashtest = { version = "*", python = "^3.6" }' - ''; + pythonRelaxDeps = [ "crashtest" ]; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - propagatedBuildInputs = - [ - pylev - pastel - ] - ++ lib.optionals (pythonAtLeast "3.6") [ crashtest ] - ++ lib.optionals isPy27 [ - typing - enum34 - ]; + dependencies = [ + crashtest + pastel + pylev + ]; nativeCheckInputs = [ pytest-mock @@ -61,8 +43,9 @@ buildPythonPackage rec { pythonImportsCheck = [ "clikit" ]; meta = with lib; { - homepage = "https://github.com/sdispater/clikit"; description = "Group of utilities to build beautiful and testable command line interfaces"; + homepage = "https://github.com/sdispater/clikit"; + changelog = "https://github.com/sdispater/clikit/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ jakewaksbaum ]; };