1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5
6# build-system
7, setuptools
8, setuptools-git-versioning
9, wheel
10
11# dependencies
12, async-timeout
13, bellows
14, click
15, coloredlogs
16, crc
17, libgpiod
18, typing-extensions
19, zigpy
20
21# tests
22, pytestCheckHook
23, pytest-asyncio
24, pytest-mock
25, pytest-timeout
26}:
27
28buildPythonPackage rec {
29 pname = "universal-silabs-flasher";
30 version = "0.0.14";
31 format = "pyproject";
32
33 src = fetchFromGitHub {
34 owner = "NabuCasa";
35 repo = "universal-silabs-flasher";
36 rev = "v${version}";
37 hash = "sha256-0c9b571gJXFOAe5ct8O/qy7D6rDosmBHDYEv6odLQ2s=";
38 };
39
40 nativeBuildInputs = [
41 setuptools
42 setuptools-git-versioning
43 wheel
44 ];
45
46 propagatedBuildInputs = [
47 async-timeout
48 bellows
49 click
50 coloredlogs
51 crc
52 typing-extensions
53 zigpy
54 ] ++ lib.optionals (stdenv.hostPlatform.isLinux) [
55 libgpiod
56 ];
57
58 nativeCheckInputs = [
59 pytestCheckHook
60 pytest-asyncio
61 pytest-mock
62 pytest-timeout
63 ];
64
65 pythonImportsCheck = [ "universal_silabs_flasher" ];
66
67 meta = with lib; {
68 description = "Flashes Silicon Labs radios running EmberZNet or CPC multi-pan firmware";
69 homepage = "https://github.com/NabuCasa/universal-silabs-flasher";
70 license = licenses.gpl3Only;
71 maintainers = with maintainers; [ hexa ];
72 };
73}