1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 pbr,
9 setuptools,
10 twine,
11
12 # dependencies
13 click,
14 click-completion,
15 inquirer,
16 notify-py,
17 pendulum,
18 prettytable,
19 requests,
20 validate-email,
21
22 # tests
23 factory-boy,
24 pytest-cov-stub,
25 pytest-mock,
26 pytestCheckHook,
27 versionCheckHook,
28}:
29
30buildPythonPackage rec {
31 pname = "toggl-cli";
32 version = "4.0.0";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "AuHau";
37 repo = "toggl-cli";
38 tag = "v${version}";
39 hash = "sha256-d/0w6VCth1TszolqkaWxHs6SLNiRg3sZj3H4CY+yPdw=";
40 };
41
42 env.PBR_VERSION = version;
43
44 build-system = [
45 pbr
46 setuptools
47 twine
48 ];
49
50 pythonRelaxDeps = true;
51
52 dependencies = [
53 click
54 click-completion
55 inquirer
56 notify-py
57 pbr
58 pendulum
59 prettytable
60 requests
61 setuptools
62 validate-email
63 ];
64
65 nativeCheckInputs = [
66 factory-boy
67 pytest-cov-stub
68 pytest-mock
69 pytestCheckHook
70 versionCheckHook
71 ];
72 versionCheckProgram = "${placeholder "out"}/bin/toggl";
73 versionCheckProgramArg = "--version";
74
75 disabledTests = [
76 "integration"
77 "premium"
78 "test_now"
79 "test_parsing"
80 "test_type_check"
81 ];
82
83 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
84 # PermissionError: [Errno 1] Operation not permitted: '/etc/localtime'
85 "tests/unit/cli/test_types.py"
86 ];
87
88 pythonImportsCheck = [ "toggl" ];
89
90 meta = {
91 description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
92 homepage = "https://toggl.uhlir.dev/";
93 changelog = "https://github.com/AuHau/toggl-cli/releases/tag/${src.tag}";
94 license = lib.licenses.mit;
95 maintainers = with lib.maintainers; [ mmahut ];
96 mainProgram = "toggl";
97 };
98}