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-deconz";
16 version = "0.24.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "zigpy";
23 repo = pname;
24 tag = version;
25 hash = "sha256-el29EqCK9p3AII9LsMw+ikplHfDKNUIhaU3HJI0gfu8=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail ', "setuptools-git-versioning<2"' "" \
31 --replace-fail '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 pythonImportsCheck = [ "zigpy_deconz" ];
48
49 meta = with lib; {
50 description = "Library which communicates with Deconz radios for zigpy";
51 homepage = "https://github.com/zigpy/zigpy-deconz";
52 changelog = "https://github.com/zigpy/zigpy-deconz/releases/tag/${src.tag}";
53 license = licenses.gpl3Plus;
54 maintainers = with maintainers; [ mvnetbiz ];
55 platforms = platforms.linux;
56 };
57}