1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pyserial,
6 pyserial-asyncio,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10 setuptools,
11 zigpy,
12}:
13
14buildPythonPackage rec {
15 pname = "zigpy-xbee";
16 version = "0.21.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "zigpy";
23 repo = "zigpy-xbee";
24 tag = version;
25 hash = "sha256-Ep7pP2vcH9YpSrGPVDi3nc+WkQgBVS+NLmoQU0o0aQQ=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace ', "setuptools-git-versioning<2"' "" \
31 --replace 'dynamic = ["version"]' 'version = "${version}"'
32 '';
33
34 nativeBuildInputs = [ setuptools ];
35
36 propagatedBuildInputs = [
37 pyserial
38 pyserial-asyncio
39 zigpy
40 ];
41
42 nativeCheckInputs = [
43 pytest-asyncio
44 pytestCheckHook
45 ];
46
47 disabledTests = [
48 # fixed in https://github.com/zigpy/zigpy-xbee/commit/f85233fc28ae01c08267965e99a29e43b00e1561
49 "test_shutdown"
50 ];
51
52 meta = with lib; {
53 changelog = "https://github.com/zigpy/zigpy-xbee/releases/tag/${version}";
54 description = "Library which communicates with XBee radios for zigpy";
55 homepage = "https://github.com/zigpy/zigpy-xbee";
56 license = licenses.gpl3Plus;
57 maintainers = with maintainers; [ mvnetbiz ];
58 platforms = platforms.linux;
59 };
60}