1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 isPy27,
6 pythonAtLeast,
7 poetry-core,
8
9 # propagates
10 pylev,
11 pastel,
12
13 # python36+
14 crashtest,
15
16 # python2
17 typing,
18 enum34,
19
20 # tests
21 pytest-mock,
22 pytestCheckHook,
23}:
24
25buildPythonPackage rec {
26 pname = "clikit";
27 version = "0.6.2";
28 format = "pyproject";
29
30 src = fetchFromGitHub {
31 owner = "sdispater";
32 repo = pname;
33 rev = "refs/tags/${version}";
34 hash = "sha256-xAsUNhVQBjtSFHyjjnicAKRC3+Tdn3AdGDUYhmOOIdA=";
35 };
36
37 postPatch = ''
38 substituteInPlace pyproject.toml --replace \
39 'crashtest = { version = "^0.3.0", python = "^3.6" }' \
40 'crashtest = { version = "*", python = "^3.6" }'
41 '';
42
43 nativeBuildInputs = [ poetry-core ];
44
45 propagatedBuildInputs =
46 [
47 pylev
48 pastel
49 ]
50 ++ lib.optionals (pythonAtLeast "3.6") [ crashtest ]
51 ++ lib.optionals isPy27 [
52 typing
53 enum34
54 ];
55
56 nativeCheckInputs = [
57 pytest-mock
58 pytestCheckHook
59 ];
60
61 pythonImportsCheck = [ "clikit" ];
62
63 meta = with lib; {
64 homepage = "https://github.com/sdispater/clikit";
65 description = "Group of utilities to build beautiful and testable command line interfaces";
66 license = licenses.mit;
67 maintainers = with maintainers; [ jakewaksbaum ];
68 };
69}