1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 fetchFromGitHub,
6 cryptography,
7 ifaddr,
8 freezegun,
9 pytest-asyncio_0,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "xknx";
17 version = "3.9.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "XKNX";
24 repo = "xknx";
25 tag = version;
26 hash = "sha256-68Vt5jwtEND2Ej6JP10Rp+kqYc2qu9XbmgZgPOmkWWw=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [
32 cryptography
33 ifaddr
34 ]
35 ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
36
37 nativeCheckInputs = [
38 freezegun
39 pytest-asyncio_0
40 pytestCheckHook
41 ];
42
43 pythonImportsCheck = [ "xknx" ];
44
45 disabledTests = [
46 # Test requires network access
47 "test_routing_indication_multicast"
48 "test_scan_timeout"
49 "test_start_secure_routing_explicit_keyring"
50 "test_start_secure_routing_knx_keys"
51 "test_start_secure_routing_manual"
52 # RuntimeError: Event loop is closed
53 "test_has_group_address_localtime"
54 "test_invalid_authentication"
55 "test_invalid_frames"
56 "test_no_authentication"
57 "test_process_read_localtime"
58 "test_sync_date"
59 "test_sync_datetime"
60 "test_sync_time_local"
61 ];
62
63 meta = with lib; {
64 description = "KNX Library Written in Python";
65 longDescription = ''
66 XKNX is an asynchronous Python library for reading and writing KNX/IP
67 packets. It provides support for KNX/IP routing and tunneling devices.
68 '';
69 homepage = "https://github.com/XKNX/xknx";
70 changelog = "https://github.com/XKNX/xknx/releases/tag/${version}";
71 license = licenses.mit;
72 maintainers = with maintainers; [ fab ];
73 platforms = platforms.linux;
74 };
75}