2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
click,
|
|
|
|
click-completion,
|
|
|
|
factory-boy,
|
|
|
|
faker,
|
|
|
|
fetchPypi,
|
|
|
|
inquirer,
|
|
|
|
notify-py,
|
|
|
|
pbr,
|
|
|
|
pendulum,
|
|
|
|
prettytable,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
setuptools,
|
|
|
|
twine,
|
|
|
|
validate-email,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "toggl-cli";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.4.4";
|
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "togglCli";
|
|
|
|
inherit version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-P4pv6LMPIWXD04IQw01yo3z3voeV4OmsBOCSJgcrZ6g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace-fail "==" ">="
|
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace ' --cov toggl -m "not premium"' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pbr
|
2024-04-21 15:54:59 +00:00
|
|
|
setuptools
|
2021-12-06 16:07:01 +00:00
|
|
|
twine
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2021-12-06 16:07:01 +00:00
|
|
|
click
|
|
|
|
click-completion
|
|
|
|
inquirer
|
|
|
|
notify-py
|
|
|
|
pbr
|
|
|
|
pendulum
|
2024-04-21 15:54:59 +00:00
|
|
|
prettytable
|
2021-12-06 16:07:01 +00:00
|
|
|
requests
|
|
|
|
validate-email
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-mock
|
|
|
|
faker
|
2023-10-19 13:55:26 +00:00
|
|
|
factory-boy
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = ''
|
|
|
|
export TOGGL_API_TOKEN=your_api_token
|
|
|
|
export TOGGL_PASSWORD=toggl_password
|
|
|
|
export TOGGL_USERNAME=user@example.com
|
|
|
|
'';
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
disabledTests = [
|
|
|
|
"integration"
|
|
|
|
"premium"
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_basic_usage"
|
|
|
|
"test_now"
|
2021-06-06 07:54:09 +00:00
|
|
|
"test_parsing"
|
|
|
|
"test_type_check"
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "toggl" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
# updates to a bogus tag
|
|
|
|
passthru.skipBulkUpdate = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Command line tool and set of Python wrapper classes for interacting with toggl's API";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://toggl.uhlir.dev/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ mmahut ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "toggl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|