1{
2 lib,
3 buildPythonPackage,
4 click,
5 click-completion,
6 factory-boy,
7 faker,
8 fetchPypi,
9 inquirer,
10 notify-py,
11 pbr,
12 pendulum,
13 prettytable,
14 pytest-mock,
15 pytestCheckHook,
16 pythonOlder,
17 requests,
18 setuptools,
19 twine,
20 validate-email,
21}:
22
23buildPythonPackage rec {
24 pname = "toggl-cli";
25 version = "2.4.4";
26 pyproject = true;
27
28 disabled = pythonOlder "3.7";
29
30 src = fetchPypi {
31 pname = "togglCli";
32 inherit version;
33 hash = "sha256-P4pv6LMPIWXD04IQw01yo3z3voeV4OmsBOCSJgcrZ6g=";
34 };
35
36 postPatch = ''
37 substituteInPlace requirements.txt \
38 --replace-fail "==" ">="
39 substituteInPlace pytest.ini \
40 --replace ' --cov toggl -m "not premium"' ""
41 '';
42
43 build-system = [
44 pbr
45 setuptools
46 twine
47 ];
48
49 dependencies = [
50 click
51 click-completion
52 inquirer
53 notify-py
54 pbr
55 pendulum
56 prettytable
57 requests
58 validate-email
59 ];
60
61 nativeCheckInputs = [
62 pytestCheckHook
63 pytest-mock
64 faker
65 factory-boy
66 ];
67
68 preCheck = ''
69 export TOGGL_API_TOKEN=your_api_token
70 export TOGGL_PASSWORD=toggl_password
71 export TOGGL_USERNAME=user@example.com
72 '';
73
74 disabledTests = [
75 "integration"
76 "premium"
77 "test_basic_usage"
78 "test_now"
79 "test_parsing"
80 "test_type_check"
81 ];
82
83 pythonImportsCheck = [ "toggl" ];
84
85 # updates to a bogus tag
86 passthru.skipBulkUpdate = true;
87
88 meta = with lib; {
89 description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
90 homepage = "https://toggl.uhlir.dev/";
91 license = licenses.mit;
92 maintainers = with maintainers; [ mmahut ];
93 mainProgram = "toggl";
94 };
95}