1{ lib
2, async-timeout
3, buildPythonPackage
4, base36
5, chacha20poly1305-reuseable
6, cryptography
7, fetchFromGitHub
8, h11
9, orjson
10, pyqrcode
11, pytest-asyncio
12, pytest-timeout
13, pytestCheckHook
14, pythonOlder
15, zeroconf
16}:
17
18buildPythonPackage rec {
19 pname = "hap-python";
20 version = "4.9.1";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchFromGitHub {
26 owner = "ikalchev";
27 repo = "HAP-python";
28 rev = "refs/tags/${version}";
29 hash = "sha256-nnh8PSEcuPN1qGuInJ7uYe83zdne8axbTrHd4g1xoJs=";
30 };
31
32 propagatedBuildInputs = [
33 async-timeout
34 chacha20poly1305-reuseable
35 cryptography
36 h11
37 orjson
38 zeroconf
39 ];
40
41 passthru.optional-dependencies.QRCode = [
42 base36
43 pyqrcode
44 ];
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytest-timeout
49 pytestCheckHook
50 ]
51 ++ passthru.optional-dependencies.QRCode;
52
53 disabledTestPaths = [
54 # Disable tests requiring network access
55 "tests/test_accessory_driver.py"
56 "tests/test_hap_handler.py"
57 "tests/test_hap_protocol.py"
58 ];
59
60 disabledTests = [
61 "test_persist_and_load"
62 "test_we_can_connect"
63 "test_idle_connection_cleanup"
64 "test_we_can_start_stop"
65 "test_push_event"
66 "test_bridge_run_stop"
67 "test_migration_to_include_client_properties"
68 ];
69
70 pythonImportsCheck = [
71 "pyhap"
72 ];
73
74 meta = with lib; {
75 description = "HomeKit Accessory Protocol implementation";
76 homepage = "https://github.com/ikalchev/HAP-python";
77 changelog = "https://github.com/ikalchev/HAP-python/blob/${version}/CHANGELOG.md";
78 license = licenses.asl20;
79 maintainers = with maintainers; [ oro ];
80 };
81}