1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 click,
6 click-log,
7 fetchFromGitHub,
8 pytest-asyncio,
9 pytest-timeout,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13 voluptuous,
14 zigpy,
15}:
16
17buildPythonPackage rec {
18 pname = "bellows";
19 version = "0.45.0";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "zigpy";
24 repo = "bellows";
25 tag = version;
26 hash = "sha256-wIi6LXfo1ykNT9DMmlRORspiWnBzJUAn6kA/t4rdTpY=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail '"setuptools-git-versioning<2"' "" \
32 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
33 '';
34
35 build-system = [ setuptools ];
36
37 dependencies = [
38 click
39 click-log
40 voluptuous
41 zigpy
42 ] ++ lib.optionals (pythonOlder "3.11") [ async-timeout ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 pytest-asyncio
47 pytest-timeout
48 ];
49
50 pythonImportsCheck = [ "bellows" ];
51
52 meta = with lib; {
53 description = "Python module to implement EZSP for EmberZNet devices";
54 homepage = "https://github.com/zigpy/bellows";
55 changelog = "https://github.com/zigpy/bellows/releases/tag/${src.tag}";
56 license = licenses.gpl3Plus;
57 maintainers = with maintainers; [ mvnetbiz ];
58 mainProgram = "bellows";
59 };
60}