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