From 161a56994befd4659fdbd8710e80c80f9a8375bf Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 4 Dec 2024 14:20:51 +0100 Subject: [PATCH] python312Packages.toggl-cli: 2.4.4 -> 3.0.2 --- .../python-modules/toggl-cli/default.nix | 87 ++++++++++--------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/pkgs/development/python-modules/toggl-cli/default.nix b/pkgs/development/python-modules/toggl-cli/default.nix index 5c0cd5a17b1c..2798c8544e0f 100644 --- a/pkgs/development/python-modules/toggl-cli/default.nix +++ b/pkgs/development/python-modules/toggl-cli/default.nix @@ -1,45 +1,45 @@ { lib, + stdenv, buildPythonPackage, - click, - click-completion, - factory-boy, - faker, - fetchPypi, - inquirer, - notify-py, + fetchFromGitHub, + + # build-system pbr, - pendulum, - prettytable, - pytest-mock, - pytestCheckHook, - pytest-cov-stub, - pythonOlder, - requests, setuptools, twine, + + # dependencies + click, + click-completion, + inquirer, + notify-py, + pendulum, + prettytable, + requests, validate-email, + + # tests + factory-boy, + pytest-cov-stub, + pytest-mock, + pytestCheckHook, + versionCheckHook, }: buildPythonPackage rec { pname = "toggl-cli"; - version = "2.4.4"; + version = "3.0.2"; pyproject = true; - disabled = pythonOlder "3.7"; - - src = fetchPypi { - pname = "togglCli"; - inherit version; - hash = "sha256-P4pv6LMPIWXD04IQw01yo3z3voeV4OmsBOCSJgcrZ6g="; + src = fetchFromGitHub { + owner = "AuHau"; + repo = "toggl-cli"; + rev = "refs/tags/v${version}"; + hash = "sha256-RYOnlZxg3TZQO5JpmWlnUdL2hNFu4bjkdGU4c2ysqpA="; }; - postPatch = '' - substituteInPlace requirements.txt \ - --replace-fail "==" ">=" - substituteInPlace pytest.ini \ - --replace-fail ' -m "not premium"' "" - ''; + env.PBR_VERSION = version; build-system = [ pbr @@ -47,6 +47,8 @@ buildPythonPackage rec { twine ]; + pythonRelaxDeps = true; + dependencies = [ click click-completion @@ -56,42 +58,41 @@ buildPythonPackage rec { pendulum prettytable requests + setuptools validate-email ]; nativeCheckInputs = [ - pytestCheckHook + factory-boy pytest-cov-stub pytest-mock - faker - factory-boy + pytestCheckHook + versionCheckHook ]; - - preCheck = '' - export TOGGL_API_TOKEN=your_api_token - export TOGGL_PASSWORD=toggl_password - export TOGGL_USERNAME=user@example.com - ''; + versionCheckProgram = "${placeholder "out"}/bin/toggl"; + versionCheckProgramArg = [ "--version" ]; disabledTests = [ "integration" "premium" - "test_basic_usage" "test_now" "test_parsing" "test_type_check" ]; + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ + # PermissionError: [Errno 1] Operation not permitted: '/etc/localtime' + "tests/unit/cli/test_types.py" + ]; + pythonImportsCheck = [ "toggl" ]; - # updates to a bogus tag - passthru.skipBulkUpdate = true; - - meta = with lib; { + meta = { description = "Command line tool and set of Python wrapper classes for interacting with toggl's API"; homepage = "https://toggl.uhlir.dev/"; - license = licenses.mit; - maintainers = with maintainers; [ mmahut ]; + changelog = "https://github.com/AuHau/toggl-cli/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mmahut ]; mainProgram = "toggl"; }; }