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