about summary refs log tree commit diff
path: root/pkgs/development/python-modules/fitbit/default.nix
blob: f53eba81b2ea12777d2a841a3279b5cce0ce017f (plain) (blame)
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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  freezegun,
  mock,
  pytestCheckHook,
  python-dateutil,
  pythonOlder,
  requests-mock,
  requests-oauthlib,
}:

buildPythonPackage rec {
  pname = "fitbit";
  version = "0.3.1";
  format = "setuptools";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "orcasgit";
    repo = "python-fitbit";
    rev = version;
    hash = "sha256-1u3h47lRBrJ7EUWBl5+RLGW4KHHqXqqrXbboZdy7VPA=";
  };

  postPatch = ''
    substituteInPlace fitbit_tests/test_api.py \
      --replace-fail assertRaisesRegexp assertRaisesRegex
  '';

  propagatedBuildInputs = [
    python-dateutil
    requests-oauthlib
  ];

  nativeCheckInputs = [
    freezegun
    mock
    pytestCheckHook
    requests-mock
  ];

  pythonImportsCheck = [ "fitbit" ];

  meta = with lib; {
    description = "Fitbit API Python Client Implementation";
    homepage = "https://github.com/orcasgit/python-fitbit";
    license = licenses.asl20;
    maintainers = [ ];
  };
}