From 63bb864b34cb863beef0907eb95947f927a20a22 Mon Sep 17 00:00:00 2001 From: Marek Mahut Date: Sun, 16 Jun 2019 14:39:40 +0200 Subject: [PATCH] python3Packages.toggl-cli: init at 2.1.0 --- .../python-modules/toggl-cli/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/toggl-cli/default.nix diff --git a/pkgs/development/python-modules/toggl-cli/default.nix b/pkgs/development/python-modules/toggl-cli/default.nix new file mode 100644 index 000000000000..2c43ebf2c7e7 --- /dev/null +++ b/pkgs/development/python-modules/toggl-cli/default.nix @@ -0,0 +1,57 @@ +{ stdenv, buildPythonPackage, fetchPypi, twine, pbr, click, click-completion, validate-email, +pendulum, ptable, requests, inquirer, pythonOlder, pytest, pytestcov, pytest-mock, faker, factory_boy }: + + +buildPythonPackage rec { + pname = "toggl-cli"; + version = "2.1.0"; + + disabled = pythonOlder "3.5"; + + src = fetchPypi { + pname = "togglCli"; + inherit version; + sha256 = "0iirvvb8772569v28d36bnryksm1qkkw48d48fw26j7ka01qq6mm"; + }; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "click-completion==0.5.0" "click-completion>=0.5.0" \ + --replace "pbr==5.1.2" "pbr>=5.1.2" \ + --replace "inquirer==2.5.1" "inquirer>=2.5.1" + ''; + + 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 + validate-email + pendulum + ptable + requests + inquirer + pbr + ]; + + meta = with stdenv.lib; { + 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 ]; + }; +} + diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 69c1d46f0db2..60ade77b04d1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -980,6 +980,8 @@ in { tomlkit = callPackage ../development/python-modules/tomlkit { }; + toggl-cli = callPackage ../development/python-modules/toggl-cli { }; + unifi = callPackage ../development/python-modules/unifi { }; uvloop = callPackage ../development/python-modules/uvloop { };