2022-10-21 18:38:19 +00:00
|
|
|
{ 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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-8cOLHYnodPGk1b1n6xbVyW2iju3cG6MgnzYTKDsP/nw=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-10-21 18:38:19 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|