1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 gpiozero,
6 mock,
7 pyserial,
8 pyserial-asyncio,
9 pyusb,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14 zigpy,
15}:
16
17buildPythonPackage rec {
18 pname = "zigpy-zigate";
19 version = "0.13.3";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "zigpy";
26 repo = "zigpy-zigate";
27 tag = version;
28 hash = "sha256-reOt0bPPkKDKeu8CESJtLDEmpkOmgopXk65BqBlBIhY=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace ', "setuptools-git-versioning<2"' "" \
34 --replace 'dynamic = ["version"]' 'version = "${version}"'
35 '';
36
37 nativeBuildInputs = [ setuptools ];
38
39 propagatedBuildInputs = [
40 gpiozero
41 pyserial
42 pyserial-asyncio
43 pyusb
44 zigpy
45 ];
46
47 nativeCheckInputs = [
48 mock
49 pytest-asyncio
50 pytestCheckHook
51 ];
52
53 pythonImportsCheck = [ "zigpy_zigate" ];
54
55 disabledTestPaths = [
56 # Fails in sandbox
57 "tests/test_application.py "
58 ];
59
60 meta = with lib; {
61 description = "Library which communicates with ZiGate radios for zigpy";
62 homepage = "https://github.com/zigpy/zigpy-zigate";
63 changelog = "https://github.com/zigpy/zigpy-zigate/releases/tag/${version}";
64 license = licenses.gpl3Plus;
65 maintainers = with maintainers; [ mvnetbiz ];
66 platforms = platforms.linux;
67 };
68}