about summary refs log tree commit diff
path: root/pkgs/development/python-modules/toggl-cli/default.nix
blob: 8e221c312bae09252956408f451b8de8489f3d3d (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{
  lib,
  buildPythonPackage,
  click,
  click-completion,
  factory-boy,
  faker,
  fetchPypi,
  inquirer,
  notify-py,
  pbr,
  pendulum,
  prettytable,
  pytest-mock,
  pytestCheckHook,
  pythonOlder,
  requests,
  setuptools,
  twine,
  validate-email,
}:

buildPythonPackage rec {
  pname = "toggl-cli";
  version = "2.4.4";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    pname = "togglCli";
    inherit version;
    hash = "sha256-P4pv6LMPIWXD04IQw01yo3z3voeV4OmsBOCSJgcrZ6g=";
  };

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace-fail "==" ">="
    substituteInPlace pytest.ini \
      --replace ' --cov toggl -m "not premium"' ""
  '';

  build-system = [
    pbr
    setuptools
    twine
  ];

  dependencies = [
    click
    click-completion
    inquirer
    notify-py
    pbr
    pendulum
    prettytable
    requests
    validate-email
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mock
    faker
    factory-boy
  ];

  preCheck = ''
    export TOGGL_API_TOKEN=your_api_token
    export TOGGL_PASSWORD=toggl_password
    export TOGGL_USERNAME=user@example.com
  '';

  disabledTests = [
    "integration"
    "premium"
    "test_basic_usage"
    "test_now"
    "test_parsing"
    "test_type_check"
  ];

  pythonImportsCheck = [ "toggl" ];

  # updates to a bogus tag
  passthru.skipBulkUpdate = true;

  meta = with lib; {
    description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
    homepage = "https://toggl.uhlir.dev/";
    license = licenses.mit;
    maintainers = with maintainers; [ mmahut ];
    mainProgram = "toggl";
  };
}