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