summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/toggl-cli/default.nix
blob: ce9c095b8de5cb404f463a9756be5edf3d58d66d (about) (plain)
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
96
97
98
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  pbr,
  setuptools,
  twine,

  # dependencies
  click,
  click-completion,
  inquirer,
  notify-py,
  pendulum,
  prettytable,
  requests,
  validate-email,

  # tests
  factory-boy,
  pytest-cov-stub,
  pytest-mock,
  pytestCheckHook,
  versionCheckHook,
}:

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

  src = fetchFromGitHub {
    owner = "AuHau";
    repo = "toggl-cli";
    tag = "v${version}";
    hash = "sha256-x73gs0L+/m1cJPRkzZfna5KxU2KNjsqeUCyFo2JjkdE=";
  };

  env.PBR_VERSION = version;

  build-system = [
    pbr
    setuptools
    twine
  ];

  pythonRelaxDeps = true;

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

  nativeCheckInputs = [
    factory-boy
    pytest-cov-stub
    pytest-mock
    pytestCheckHook
    versionCheckHook
  ];
  versionCheckProgram = "${placeholder "out"}/bin/toggl";
  versionCheckProgramArg = [ "--version" ];

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

  disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
    # PermissionError: [Errno 1] Operation not permitted: '/etc/localtime'
    "tests/unit/cli/test_types.py"
  ];

  pythonImportsCheck = [ "toggl" ];

  meta = {
    description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
    homepage = "https://toggl.uhlir.dev/";
    changelog = "https://github.com/AuHau/toggl-cli/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ mmahut ];
    mainProgram = "toggl";
  };
}