git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #60953 from delroth/fitbit-hass

Fix home-assistant fitbit support

commitb029d12b541368ab1005f8c0834f916c92cf3847 authorRobert Schütz <rschuetz17@gmail.com> dateMon 20 May 2019, 13:30 (8 years ago) parent042d76ffb455c6
2 files changed+43
pkgs/development/python-modules/fitbit/default.nix+41 pkgs/top-level/python-packages.nix+2
pkgs/development/python-modules/fitbit/default.nixnew file+41
@@ -0,0 +1,41 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, coverage
5+, dateutil
6+, freezegun
7+, mock
8+, requests-mock
9+, requests_oauthlib
10+, sphinx
11+}:
12+
13+buildPythonPackage rec {
14+ pname = "fitbit";
15+ version = "0.3.0";
16+
17+ checkInputs = [ coverage freezegun mock requests-mock sphinx ];
18+ propagatedBuildInputs = [ dateutil requests_oauthlib ];
19+
20+ # The source package on PyPi is missing files required for unit testing.
21+ # https://github.com/orcasgit/python-fitbit/issues/148
22+ src = fetchFromGitHub {
23+ rev = version;
24+ owner = "orcasgit";
25+ repo = "python-fitbit";
26+ sha256 = "0s1kp4qcxvxghqf9nb71843slm4r5lhl2rlvj3yvhbby3cqs4g84";
27+ };
28+
29+ postPatch = ''
30+ substituteInPlace requirements/test.txt \
31+ --replace 'Sphinx>=1.2,<1.4' 'Sphinx' \
32+ --replace 'coverage>=3.7,<4.0' 'coverage'
33+ '';
34+
35+ meta = with lib; {
36+ description = "Fitbit API Python Client Implementation";
37+ license = licenses.asl20;
38+ homepage = https://github.com/orcasgit/python-fitbit;
39+ maintainers = with maintainers; [ delroth ];
40+ };
41+}
pkgs/top-level/python-packages.nix+2
@@ -2608,6 +2608,8 @@ in {
26082608
26092609 fiona = callPackage ../development/python-modules/fiona { gdal = pkgs.gdal; };
26102610
2611+ fitbit = callPackage ../development/python-modules/fitbit { };
2612+
26112613 flake8 = callPackage ../development/python-modules/flake8 { };
26122614
26132615 flake8-blind-except = callPackage ../development/python-modules/flake8-blind-except { };