summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/withings-api/default.nix
blob: 60e4efc65cebf4f11c702ccf57b490723bb2369c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  arrow,
  buildPythonPackage,
  fetchFromGitHub,
  poetry-core,
  pydantic,
  pytest-cov-stub,
  pytestCheckHook,
  requests-oauthlib,
  responses,
  typing-extensions,
}:

buildPythonPackage rec {
  pname = "withings-api";
  version = "2.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "vangorra";
    repo = "python_withings_api";
    tag = version;
    hash = "sha256-8cOLHYnodPGk1b1n6xbVyW2iju3cG6MgnzYTKDsP/nw=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail 'requests-oauth = ">=0.4.1"' '''
  '';

  build-system = [ poetry-core ];

  dependencies = [
    arrow
    requests-oauthlib
    typing-extensions
    pydantic
  ];

  nativeCheckInputs = [
    pytest-cov-stub
    pytestCheckHook
    responses
  ];

  pythonImportsCheck = [ "withings_api" ];

  meta = {
    description = "Library for the Withings Health API";
    homepage = "https://github.com/vangorra/python_withings_api";
    changelog = "https://github.com/vangorra/python_withings_api/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ kittywitch ];
    broken = lib.versionAtLeast pydantic.version "2";
  };
}