1{ lib
2, buildPythonPackage
3, fetchPypi
4, pdm-backend
5, pydantic
6, pytest-vcr
7, pytestCheckHook
8, pythonOlder
9, requests
10, requests-oauthlib
11}:
12
13buildPythonPackage rec {
14 pname = "garth";
15 version = "0.4.41";
16 format = "pyproject";
17
18 disabled = pythonOlder "3.9";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-1CnRgPJTG7cpfa/SyhBwVw0Lj6ENI/YY/q2yNeve9c0=";
23 };
24
25 nativeBuildInputs = [
26 pdm-backend
27 ];
28
29 propagatedBuildInputs = [
30 pydantic
31 requests
32 requests-oauthlib
33 ];
34
35 nativeCheckInputs = [
36 pytest-vcr
37 pytestCheckHook
38 ];
39
40 pythonImportsCheck = [
41 "garth"
42 ];
43
44 disabledTests = [
45 # Tests require network access
46 "test_client_request"
47 "test_connectapi"
48 "test_daily"
49 "test_download"
50 "test_exchange"
51 "test_hrv_data_get"
52 "test_login"
53 "test_refresh_oauth2_token"
54 "test_sleep_data"
55 "test_username"
56 "test_weekly"
57 ];
58
59 meta = with lib; {
60 description = "Garmin SSO auth and connect client";
61 homepage = "https://github.com/matin/garth";
62 license = licenses.mit;
63 maintainers = with maintainers; [ fab ];
64 };
65}