2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-09-19 14:19:46 +00:00
|
|
|
aiohttp,
|
2024-06-05 15:53:02 +00:00
|
|
|
assertpy,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-09-19 14:19:46 +00:00
|
|
|
freezegun,
|
2024-06-05 15:53:02 +00:00
|
|
|
poetry-core,
|
2024-09-19 14:19:46 +00:00
|
|
|
pycryptodome,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytest-asyncio,
|
|
|
|
pytest-mockservers,
|
|
|
|
pytest-resource-path,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonAtLeast,
|
|
|
|
pythonOlder,
|
|
|
|
time-machine,
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "aioswitcher";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "4.0.3";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TomerFi";
|
2024-09-19 14:19:46 +00:00
|
|
|
repo = "aioswitcher";
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-QSnroxVHlfZd6QDaqUTMyoctiEsxWmGmFxzql1YIAD0=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ poetry-core ];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [ "aiohttp" ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
aiohttp
|
|
|
|
pycryptodome
|
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
preCheck = ''
|
|
|
|
export TZ=Asia/Jerusalem
|
|
|
|
'';
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-08 23:34:03 +00:00
|
|
|
assertpy
|
2024-09-19 14:19:46 +00:00
|
|
|
freezegun
|
2021-01-15 22:18:51 +00:00
|
|
|
pytest-asyncio
|
2021-08-08 23:34:03 +00:00
|
|
|
pytest-mockservers
|
|
|
|
pytest-resource-path
|
2021-01-15 22:18:51 +00:00
|
|
|
pytestCheckHook
|
2021-08-08 23:34:03 +00:00
|
|
|
time-machine
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# AssertionError: Expected <14:00> to be equal to <17:00>, but was not.
|
|
|
|
"test_schedule_parser_with_a_weekly_recurring_enabled_schedule_data"
|
|
|
|
"test_schedule_parser_with_a_daily_recurring_enabled_schedule_data"
|
|
|
|
"test_schedule_parser_with_a_partial_daily_recurring_enabled_schedule_data"
|
|
|
|
"test_schedule_parser_with_a_non_recurring_enabled_schedule_data"
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonAtLeast "3.12") [
|
|
|
|
# ssertionError: Expected <'I' format requires 0 <= number <= 4294967295> to be equal to <argument out of range>, but was not.
|
|
|
|
"test_minutes_to_hexadecimal_seconds_with_a_negative_value_should_throw_an_error"
|
|
|
|
"test_current_timestamp_to_hexadecimal_with_errornous_value_should_throw_an_error"
|
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "aioswitcher" ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to interact with Switcher water heater";
|
|
|
|
homepage = "https://github.com/TomerFi/aioswitcher";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/TomerFi/aioswitcher/releases/tag/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
license = licenses.asl20;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|