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