1{ stdenv, buildPythonPackage, fetchPypi, twine, pbr, click, click-completion, validate-email,
2pendulum, ptable, requests, inquirer, pythonOlder, pytest, pytestcov, pytest-mock, faker, factory_boy,
3setuptools }:
4
5
6buildPythonPackage rec {
7 pname = "toggl-cli";
8 version = "2.1.0";
9
10 disabled = pythonOlder "3.5";
11
12 src = fetchPypi {
13 pname = "togglCli";
14 inherit version;
15 sha256 = "0iirvvb8772569v28d36bnryksm1qkkw48d48fw26j7ka01qq6mm";
16 };
17
18 postPatch = ''
19 substituteInPlace requirements.txt \
20 --replace "pendulum==2.0.4" "pendulum>=2.0.4" \
21 --replace "click-completion==0.5.0" "click-completion>=0.5.0" \
22 --replace "pbr==5.1.2" "pbr>=5.1.2" \
23 --replace "inquirer==2.5.1" "inquirer>=2.5.1"
24 '';
25
26 nativeBuildInputs = [ pbr twine ];
27 checkInputs = [ pbr pytest pytestcov pytest-mock faker factory_boy ];
28
29 preCheck = ''
30 export TOGGL_API_TOKEN=your_api_token
31 export TOGGL_PASSWORD=toggl_password
32 export TOGGL_USERNAME=user@example.com
33 '';
34
35 checkPhase = ''
36 runHook preCheck
37 pytest -k "not premium and not TestDateTimeType and not TestDateTimeField" tests/unit --maxfail=20
38 runHook postCheck
39 '';
40
41 propagatedBuildInputs = [
42 setuptools
43 click
44 click-completion
45 validate-email
46 pendulum
47 ptable
48 requests
49 inquirer
50 pbr
51 ];
52
53 meta = with stdenv.lib; {
54 homepage = "https://toggl.uhlir.dev/";
55 description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
56 license = licenses.mit;
57 maintainers = [ maintainers.mmahut ];
58 broken = true;
59 };
60}
61