summary refs log tree commit diff
path: root/pkgs/development/python-modules/clize/default.nix
blob: f1e5b16320b602aa31a25db06dd1f6532298fc26 (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
70
71
72
73
74
75
76
{ lib
, buildPythonPackage
, fetchPypi

# build
, setuptools

# propagtes
, sigtools
, six
, attrs
, od
, docutils

# extras: datetime
, python-dateutil

# tests
, pygments
, unittest2
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "clize";
  version = "4.2.1";
  format = "pyproject";

  src = fetchPypi {
    inherit pname version;
    sha256 = "3177a028e4169d8865c79af82bdd441b24311d4bd9c0ae8803641882d340a51d";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "docutils ~= 0.17.0" "docutils" \
      --replace "attrs>=19.1.0,<22" "attrs>=19.1.0"
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    attrs
    docutils
    od
    sigtools
    six
  ];

  passthru.optional-dependencies = {
    datetime = [
      python-dateutil
    ];
  };

  # repeated_test no longer exists in nixpkgs
  # also see: https://github.com/epsy/clize/issues/74
  doCheck = false;
  checkInputs = [
    pytestCheckHook
    python-dateutil
    pygments
    unittest2
  ];

  pythonImportsCheck = [ "clize" ];

  meta = with lib; {
    description = "Command-line argument parsing for Python";
    homepage = "https://github.com/epsy/clize";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}