From d40e8fe85ca160f113266d43cc0bdcc7ce977f84 Mon Sep 17 00:00:00 2001 From: Kat Inskip Date: Sun, 16 Oct 2022 12:00:39 -0700 Subject: [PATCH] python3Packages.withings-api: init at 2.4.0 --- .../python-modules/withings-api/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/withings-api/default.nix diff --git a/pkgs/development/python-modules/withings-api/default.nix b/pkgs/development/python-modules/withings-api/default.nix new file mode 100644 index 000000000000..fbfab134b119 --- /dev/null +++ b/pkgs/development/python-modules/withings-api/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, poetry-core +, arrow +, requests-oauthlib +, typing-extensions +, pydantic +, responses +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "withings-api"; + version = "2.4.0"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "vangorra"; + repo = "python_withings_api"; + rev = "refs/tags/${version}"; + sha256 = "sha256-8cOLHYnodPGk1b1n6xbVyW2iju3cG6MgnzYTKDsP/nw="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'requests-oauth = ">=0.4.1"' ''' \ + --replace 'addopts = "--capture no --cov ./withings_api --cov-report html:build/coverage_report --cov-report term --cov-report xml:build/coverage.xml"' ''' + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + arrow + requests-oauthlib + typing-extensions + pydantic + ]; + + checkInputs = [ + pytestCheckHook + responses + ]; + + meta = with lib; { + description = "Library for the Withings Health API"; + homepage = "https://github.com/vangorra/python_withings_api"; + license = licenses.mit; + maintainers = with maintainers; [ kittywitch ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5823cd11d4ac..a80d9acfafbd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11961,6 +11961,8 @@ in { winsspi = callPackage ../development/python-modules/winsspi { }; + withings-api = callPackage ../development/python-modules/withings-api { }; + wktutils = callPackage ../development/python-modules/wktutils { }; wled = callPackage ../development/python-modules/wled { };