about summary refs log tree commit diff
path: root/pkgs/development/python-modules/clikit/default.nix
blob: 0ecca4ea0fa8bd08bd352365e5496edf125a4114 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  isPy27,
  pythonAtLeast,
  poetry-core,

  # propagates
  pylev,
  pastel,

  # python36+
  crashtest,

  # python2
  typing,
  enum34,

  # tests
  pytest-mock,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "clikit";
  version = "0.6.2";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "sdispater";
    repo = pname;
    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" }'
  '';

  nativeBuildInputs = [ poetry-core ];

  propagatedBuildInputs =
    [
      pylev
      pastel
    ]
    ++ lib.optionals (pythonAtLeast "3.6") [ crashtest ]
    ++ lib.optionals isPy27 [
      typing
      enum34
    ];

  nativeCheckInputs = [
    pytest-mock
    pytestCheckHook
  ];

  pythonImportsCheck = [ "clikit" ];

  meta = with lib; {
    homepage = "https://github.com/sdispater/clikit";
    description = "Group of utilities to build beautiful and testable command line interfaces";
    license = licenses.mit;
    maintainers = with maintainers; [ jakewaksbaum ];
  };
}