python312Packages.clikit: refactor

This commit is contained in:
Fabian Affolter 2024-10-17 12:01:43 +02:00
parent 3a9aba5506
commit be871f95e9

View File

@ -1,57 +1,39 @@
{ {
lib, lib,
buildPythonPackage, buildPythonPackage,
fetchFromGitHub,
isPy27,
pythonAtLeast,
poetry-core,
# propagates
pylev,
pastel,
# python36+
crashtest, crashtest,
fetchFromGitHub,
# python2 pastel,
typing, poetry-core,
enum34, pylev,
# tests
pytest-mock, pytest-mock,
pytestCheckHook, pytestCheckHook,
pythonOlder,
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "clikit"; pname = "clikit";
version = "0.6.2"; version = "0.6.2";
format = "pyproject"; pyproject = true;
disabled = pythonOlder "3.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "sdispater"; owner = "sdispater";
repo = pname; repo = "clikit";
rev = "refs/tags/${version}"; rev = "refs/tags/${version}";
hash = "sha256-xAsUNhVQBjtSFHyjjnicAKRC3+Tdn3AdGDUYhmOOIdA="; hash = "sha256-xAsUNhVQBjtSFHyjjnicAKRC3+Tdn3AdGDUYhmOOIdA=";
}; };
postPatch = '' pythonRelaxDeps = [ "crashtest" ];
substituteInPlace pyproject.toml --replace \
'crashtest = { version = "^0.3.0", python = "^3.6" }' \
'crashtest = { version = "*", python = "^3.6" }'
'';
nativeBuildInputs = [ poetry-core ]; build-system = [ poetry-core ];
propagatedBuildInputs = dependencies = [
[ crashtest
pylev pastel
pastel pylev
] ];
++ lib.optionals (pythonAtLeast "3.6") [ crashtest ]
++ lib.optionals isPy27 [
typing
enum34
];
nativeCheckInputs = [ nativeCheckInputs = [
pytest-mock pytest-mock
@ -61,8 +43,9 @@ buildPythonPackage rec {
pythonImportsCheck = [ "clikit" ]; pythonImportsCheck = [ "clikit" ];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/sdispater/clikit";
description = "Group of utilities to build beautiful and testable command line interfaces"; 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; license = licenses.mit;
maintainers = with maintainers; [ jakewaksbaum ]; maintainers = with maintainers; [ jakewaksbaum ];
}; };