1{
2 lib,
3 aiohttp,
4 assertpy,
5 buildPythonPackage,
6 fetchFromGitHub,
7 freezegun,
8 poetry-core,
9 pycryptodome,
10 pytest-asyncio,
11 pytest-mockservers,
12 pytest-resource-path,
13 pytestCheckHook,
14 pythonAtLeast,
15 pythonOlder,
16 pytz,
17 time-machine,
18}:
19
20buildPythonPackage rec {
21 pname = "aioswitcher";
22 version = "6.0.2";
23 pyproject = true;
24
25 disabled = pythonOlder "3.9";
26
27 src = fetchFromGitHub {
28 owner = "TomerFi";
29 repo = "aioswitcher";
30 tag = version;
31 hash = "sha256-DtTrfwT8Xvw5byWzTGpO/o2PI7/4Zt++xgKVnNMwA1k=";
32 };
33
34 __darwinAllowLocalNetworking = true;
35
36 build-system = [ poetry-core ];
37
38 pythonRelaxDeps = [ "aiohttp" ];
39
40 dependencies = [
41 aiohttp
42 pycryptodome
43 ];
44
45 preCheck = ''
46 export TZ=Asia/Jerusalem
47 '';
48
49 nativeCheckInputs = [
50 assertpy
51 freezegun
52 pytest-asyncio
53 pytest-mockservers
54 pytest-resource-path
55 pytestCheckHook
56 pytz
57 time-machine
58 ];
59
60 disabledTests = [
61 # AssertionError: Expected <14:00> to be equal to <17:00>, but was not.
62 "test_schedule_parser_with_a_weekly_recurring_enabled_schedule_data"
63 "test_schedule_parser_with_a_daily_recurring_enabled_schedule_data"
64 "test_schedule_parser_with_a_partial_daily_recurring_enabled_schedule_data"
65 "test_schedule_parser_with_a_non_recurring_enabled_schedule_data"
66 ]
67 ++ lib.optionals (pythonAtLeast "3.12") [
68 # ssertionError: Expected <'I' format requires 0 <= number <= 4294967295> to be equal to <argument out of range>, but was not.
69 "test_minutes_to_hexadecimal_seconds_with_a_negative_value_should_throw_an_error"
70 "test_current_timestamp_to_hexadecimal_with_errornous_value_should_throw_an_error"
71 ];
72
73 pythonImportsCheck = [ "aioswitcher" ];
74
75 meta = with lib; {
76 description = "Python module to interact with Switcher water heater";
77 homepage = "https://github.com/TomerFi/aioswitcher";
78 changelog = "https://github.com/TomerFi/aioswitcher/releases/tag/${src.tag}";
79 license = licenses.asl20;
80 maintainers = with maintainers; [ fab ];
81 };
82}