1{
2 lib,
3 stdenv,
4 aiohttp,
5 aioresponses,
6 aiosqlite,
7 async-timeout,
8 attrs,
9 buildPythonPackage,
10 crccheck,
11 cryptography,
12 fetchFromGitHub,
13 freezegun,
14 frozendict,
15 jsonschema,
16 pyserial-asyncio,
17 pytest-asyncio,
18 pytest-timeout,
19 pytestCheckHook,
20 pythonOlder,
21 setuptools,
22 typing-extensions,
23 voluptuous,
24}:
25
26buildPythonPackage rec {
27 pname = "zigpy";
28 version = "0.79.0";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 owner = "zigpy";
33 repo = "zigpy";
34 tag = version;
35 hash = "sha256-4bvVn9Pv37zngsiwy54g+z05uej5Bfwpt3mC9cxF2hk=";
36 };
37
38 postPatch = ''
39 substituteInPlace pyproject.toml \
40 --replace-fail '"setuptools-git-versioning<2"' "" \
41 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
42 '';
43
44 build-system = [ setuptools ];
45
46 dependencies = [
47 attrs
48 aiohttp
49 aiosqlite
50 crccheck
51 cryptography
52 frozendict
53 jsonschema
54 pyserial-asyncio
55 typing-extensions
56 voluptuous
57 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
58
59 nativeCheckInputs = [
60 aioresponses
61 freezegun
62 pytest-asyncio
63 pytest-timeout
64 pytestCheckHook
65 ];
66
67 disabledTests =
68 [
69 # assert quirked.quirk_metadata.quirk_location.endswith("zigpy/tests/test_quirks_v2.py]-line:104") is False
70 "test_quirks_v2"
71 ]
72 ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) [
73 "test_periodic_scan_priority"
74 ];
75
76 disabledTestPaths = [
77 # Tests require network access
78 "tests/ota/test_ota_providers.py"
79 ];
80
81 pythonImportsCheck = [
82 "zigpy.application"
83 "zigpy.config"
84 "zigpy.exceptions"
85 "zigpy.types"
86 "zigpy.zcl"
87 ];
88
89 meta = with lib; {
90 description = "Library implementing a ZigBee stack";
91 homepage = "https://github.com/zigpy/zigpy";
92 changelog = "https://github.com/zigpy/zigpy/releases/tag/${version}";
93 license = licenses.gpl3Plus;
94 maintainers = with maintainers; [ mvnetbiz ];
95 platforms = platforms.linux;
96 };
97}