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 { };