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