2021-02-05 17:12:51 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, pythonAtLeast, pythonOlder
|
2020-06-18 07:06:33 +00:00
|
|
|
, click
|
|
|
|
, click-completion
|
|
|
|
, factory_boy
|
|
|
|
, faker
|
|
|
|
, inquirer
|
2020-10-07 09:15:18 +00:00
|
|
|
, notify-py
|
2020-06-18 07:06:33 +00:00
|
|
|
, pbr
|
|
|
|
, pendulum
|
|
|
|
, ptable
|
|
|
|
, pytest
|
|
|
|
, pytestcov
|
|
|
|
, pytest-mock
|
|
|
|
, requests
|
|
|
|
, twine
|
|
|
|
, validate-email
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "toggl-cli";
|
2021-01-05 17:05:55 +00:00
|
|
|
version = "2.4.1";
|
2020-10-07 09:15:18 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "togglCli";
|
|
|
|
inherit version;
|
2021-01-05 17:05:55 +00:00
|
|
|
sha256 = "19lry8adcznzmzbvghyid3yl4j05db6931bw38af5vrkkyzyf62i";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2020-10-07 09:15:18 +00:00
|
|
|
--replace "inquirer==2.6.3" "inquirer>=2.6.3" \
|
|
|
|
--replace "notify-py==0.2.2" "notify-py>=0.2.2"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pbr twine ];
|
|
|
|
checkInputs = [ pbr pytest pytestcov pytest-mock faker factory_boy ];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export TOGGL_API_TOKEN=your_api_token
|
|
|
|
export TOGGL_PASSWORD=toggl_password
|
|
|
|
export TOGGL_USERNAME=user@example.com
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
pytest -k "not premium and not TestDateTimeType and not TestDateTimeField" tests/unit --maxfail=20
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
click
|
|
|
|
click-completion
|
2020-10-07 09:15:18 +00:00
|
|
|
inquirer
|
|
|
|
notify-py
|
2020-04-24 23:36:52 +00:00
|
|
|
pendulum
|
|
|
|
ptable
|
|
|
|
requests
|
|
|
|
pbr
|
2020-10-07 09:15:18 +00:00
|
|
|
validate-email
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://toggl.uhlir.dev/";
|
|
|
|
description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.mmahut ];
|
|
|
|
};
|
|
|
|
}
|