1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 coloredlogs,
6 fetchFromGitHub,
7 jsonschema,
8 pytest-asyncio,
9 pytest-mock,
10 pytest-rerunfailures,
11 pytest-timeout,
12 pytest-xdist,
13 pytestCheckHook,
14 pythonOlder,
15 setuptools,
16 voluptuous,
17 zigpy,
18}:
19
20buildPythonPackage rec {
21 pname = "zigpy-znp";
22 version = "0.12.3";
23 pyproject = true;
24
25 disabled = pythonOlder "3.7";
26
27 src = fetchFromGitHub {
28 owner = "zigpy";
29 repo = pname;
30 rev = "refs/tags/v${version}";
31 hash = "sha256-qrIYcGumOHu3/gG9MOyKngAhOkeZEmCgXIDDcghoYn0=";
32 };
33
34 nativeBuildInputs = [ setuptools ];
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace "timeout = 20" "timeout = 300" \
39 --replace ', "setuptools-git-versioning<2"' "" \
40 --replace 'dynamic = ["version"]' 'version = "${version}"'
41 '';
42
43 propagatedBuildInputs = [
44 async-timeout
45 coloredlogs
46 jsonschema
47 voluptuous
48 zigpy
49 ];
50
51 nativeCheckInputs = [
52 pytest-asyncio
53 pytest-mock
54 pytest-rerunfailures
55 pytest-timeout
56 pytest-xdist
57 pytestCheckHook
58 ];
59
60 pytestFlagsArray = [ "--reruns=3" ];
61
62 disabledTests = [
63 # failing since zigpy 0.60.0
64 "test_join_device"
65 "test_nonstandard_profile"
66 "test_permit_join"
67 "test_request_recovery_route_rediscovery_zdo"
68 "test_watchdog"
69 "test_zigpy_request"
70 "test_zigpy_request_failure"
71 ];
72
73 pythonImportsCheck = [ "zigpy_znp" ];
74
75 meta = with lib; {
76 description = "Library for zigpy which communicates with TI ZNP radios";
77 homepage = "https://github.com/zigpy/zigpy-znp";
78 changelog = "https://github.com/zigpy/zigpy-znp/releases/tag/v${version}";
79 license = licenses.gpl3Plus;
80 maintainers = with maintainers; [ mvnetbiz ];
81 platforms = platforms.linux;
82 };
83}