From 30e1bb0d4d5445f6d0ca5c4a3abc23afee3aed6a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 17 Sep 2023 11:21:49 +0200 Subject: [PATCH 1/2] python311Packages.garth: init at 0.4.25 --- .../python-modules/garth/default.nix | 65 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/garth/default.nix diff --git a/pkgs/development/python-modules/garth/default.nix b/pkgs/development/python-modules/garth/default.nix new file mode 100644 index 000000000000..1ffdff5c7edd --- /dev/null +++ b/pkgs/development/python-modules/garth/default.nix @@ -0,0 +1,65 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pdm-backend +, pydantic +, pytest-vcr +, pytestCheckHook +, pythonOlder +, requests +, requests-oauthlib +}: + +buildPythonPackage rec { + pname = "garth"; + version = "0.4.25"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-n+vy9MCSBvxFOcD/jk2oPSa/bzf550mk+dZYSVa0rm0="; + }; + + nativeBuildInputs = [ + pdm-backend + ]; + + propagatedBuildInputs = [ + pydantic + requests + requests-oauthlib + ]; + + nativeCheckInputs = [ + pytest-vcr + pytestCheckHook + ]; + + pythonImportsCheck = [ + "garth" + ]; + + disabledTests = [ + # Tests require network access + "test_client_request" + "test_connectapi" + "test_daily" + "test_download" + "test_exchange" + "test_hrv_data_get" + "test_login" + "test_refresh_oauth2_token" + "test_sleep_data" + "test_username" + "test_weekly" + ]; + + meta = with lib; { + description = "Garmin SSO auth and connect client"; + homepage = "https://github.com/matin/garth"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4cf1f0a21474..f4c26a2ecce1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4191,6 +4191,8 @@ self: super: with self; { garminconnect = callPackage ../development/python-modules/garminconnect { }; + garth = callPackage ../development/python-modules/garth { }; + gassist-text = callPackage ../development/python-modules/gassist-text { }; gast = callPackage ../development/python-modules/gast { }; From 01c56051f8865524c15ede9c16633ec61b6d1586 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 17 Sep 2023 13:03:14 +0200 Subject: [PATCH 2/2] python311Packages.garminconnect: 0.1.55 -> 0.2.4 Changelog: https://github.com/cyberjunky/python-garminconnect/releases/tag/0.2.4 --- .../python-modules/garminconnect/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/garminconnect/default.nix b/pkgs/development/python-modules/garminconnect/default.nix index 815b695ce1c2..0b7565164df9 100644 --- a/pkgs/development/python-modules/garminconnect/default.nix +++ b/pkgs/development/python-modules/garminconnect/default.nix @@ -2,14 +2,16 @@ , buildPythonPackage , cloudscraper , fetchFromGitHub +, garth +, pdm-backend , pythonOlder , requests }: buildPythonPackage rec { pname = "garminconnect"; - version = "0.1.55"; - format = "setuptools"; + version = "0.2.4"; + format = "pyproject"; disabled = pythonOlder "3.7"; @@ -17,15 +19,20 @@ buildPythonPackage rec { owner = "cyberjunky"; repo = "python-garminconnect"; rev = "refs/tags/${version}"; - hash = "sha256-YPLlrlV8UyoaNtE+LgX7jpZkR7jbSe/2WRR0v0cfACY="; + hash = "sha256-C+LldV7TyyubaH8HVdFl7NnaPSLf4bzM03+r72vkOk8="; }; + nativeBuildInputs = [ + pdm-backend + ]; + propagatedBuildInputs = [ cloudscraper + garth requests ]; - # Module has no tests + # Tests require a token doCheck = false; pythonImportsCheck = [