python3Packages.clikit: relax crashtest constraint, enable tests

This commit is contained in:
Martin Weinelt 2022-09-16 01:39:11 +02:00
parent 72b0549074
commit e118a8d81f

View File

@ -1,26 +1,63 @@
{ lib, buildPythonPackage, fetchPypi { lib
, isPy27, pythonAtLeast , buildPythonPackage
, pylev, pastel, typing ? null, enum34 ? null, crashtest }: , fetchFromGitHub
, isPy27
, pythonAtLeast
, poetry-core
# propagates
, pylev
, pastel
# python36+
, crashtest
# python2
, typing
, enum34
# tests
, pytest-mock
, pytestCheckHook
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "clikit"; pname = "clikit";
version = "0.6.2"; version = "0.6.2";
format = "pyproject";
src = fetchPypi { src = fetchFromGitHub {
inherit pname version; owner = "sdispater";
sha256 = "0ngdkmb73gkp5y00q7r9k1cdlfn0wyzws2wrqlshc4hlkbdyabj4"; repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-xAsUNhVQBjtSFHyjjnicAKRC3+Tdn3AdGDUYhmOOIdA=";
}; };
propagatedBuildInputs = [ postPatch = ''
pylev pastel substituteInPlace pyproject.toml --replace \
] 'crashtest = { version = "^0.3.0", python = "^3.6" }' \
++ lib.optionals (pythonAtLeast "3.6") [ crashtest ] 'crashtest = { version = "*", python = "^3.6" }'
++ lib.optionals isPy27 [ typing enum34 ]; '';
# The Pypi tarball doesn't include tests, and the GitHub source isn't nativeBuildInputs = [
# buildable until we bootstrap poetry, see poetry-core
# https://github.com/NixOS/nixpkgs/pull/53599#discussion_r245855665 ];
doCheck = false;
propagatedBuildInputs = [
pylev
pastel
]
++ lib.optionals (pythonAtLeast "3.6") [ crashtest ]
++ lib.optionals isPy27 [ typing enum34 ];
checkInputs = [
pytest-mock
pytestCheckHook
];
pythonImportsCheck = [
"clikit"
];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/sdispater/clikit"; homepage = "https://github.com/sdispater/clikit";