2023-10-12 08:52:47 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
2024-01-07 13:20:58 +00:00
|
|
|
aioresponses,
|
2023-10-12 08:52:47 +00:00
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
poetry-core,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
syrupy,
|
|
|
|
yarl,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aiowithings";
|
2024-11-14 08:36:15 +00:00
|
|
|
version = "3.1.3";
|
2023-10-12 08:52:47 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.11";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "joostlek";
|
|
|
|
repo = "python-withings";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-11-14 08:36:15 +00:00
|
|
|
hash = "sha256-QHf2UOEU4623Htlaekk7AQldlZOYVQzmqDfHhaMzglI=";
|
2023-10-12 08:52:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "--cov" ""
|
|
|
|
'';
|
|
|
|
|
2024-09-27 21:58:30 +00:00
|
|
|
build-system = [ poetry-core ];
|
2023-10-12 08:52:47 +00:00
|
|
|
|
2024-09-27 21:58:30 +00:00
|
|
|
dependencies = [
|
2023-10-12 08:52:47 +00:00
|
|
|
aiohttp
|
|
|
|
yarl
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2024-01-07 13:20:58 +00:00
|
|
|
aioresponses
|
2023-10-12 08:52:47 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
syrupy
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "aiowithings" ];
|
|
|
|
|
2024-09-27 21:58:30 +00:00
|
|
|
pytestFlagsArray = [ "--snapshot-update" ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test_creating_own_session"
|
|
|
|
"test_error_codes"
|
|
|
|
"test_get_activities"
|
|
|
|
"test_get_devices"
|
|
|
|
"test_get_goals"
|
|
|
|
"test_get_measurement"
|
|
|
|
"test_get_new_device"
|
|
|
|
"test_get_sleep_summary"
|
|
|
|
"test_get_sleep"
|
|
|
|
"test_get_workouts"
|
|
|
|
"test_list_all_subscriptions"
|
|
|
|
"test_list_subscriptions"
|
|
|
|
"test_putting_in_own_session"
|
|
|
|
"test_revoking"
|
|
|
|
"test_subscribing"
|
|
|
|
"test_timeout"
|
|
|
|
"test_unexpected_server_response"
|
|
|
|
];
|
|
|
|
|
2023-10-12 08:52:47 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Module to interact with Withings";
|
|
|
|
homepage = "https://github.com/joostlek/python-withings";
|
|
|
|
changelog = "https://github.com/joostlek/python-withings/releases/tag/v${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|