1{
2 lib,
3 aiohttp,
4 aresponses,
5 awesomeversion,
6 backoff,
7 buildPythonPackage,
8 cachetools,
9 fetchFromGitHub,
10 poetry-core,
11 pytest-asyncio,
12 pytest-xdist,
13 pytestCheckHook,
14 pythonOlder,
15 typer,
16 yarl,
17 zeroconf,
18}:
19
20buildPythonPackage rec {
21 pname = "wled";
22 version = "0.18.0";
23 pyproject = true;
24
25 disabled = pythonOlder "3.11";
26
27 src = fetchFromGitHub {
28 owner = "frenck";
29 repo = "python-wled";
30 rev = "refs/tags/v${version}";
31 hash = "sha256-0BJgbyDhCPFlHxlEry7Rh/j0nv3D3kRhIqCSW+Irhqk=";
32 };
33
34 postPatch = ''
35 # Upstream doesn't set a version for the pyproject.toml
36 substituteInPlace pyproject.toml \
37 --replace-fail "0.0.0" "${version}" \
38 --replace-fail "--cov" ""
39 '';
40
41 build-system = [ poetry-core ];
42
43 dependencies = [
44 aiohttp
45 awesomeversion
46 backoff
47 cachetools
48 yarl
49 ];
50
51 passthru.optional-dependencies = {
52 cli = [
53 typer
54 zeroconf
55 ];
56 };
57
58 nativeCheckInputs = [
59 aresponses
60 pytest-asyncio
61 pytest-xdist
62 pytestCheckHook
63 ];
64
65 pythonImportsCheck = [ "wled" ];
66
67 meta = with lib; {
68 description = "Asynchronous Python client for WLED";
69 homepage = "https://github.com/frenck/python-wled";
70 changelog = "https://github.com/frenck/python-wled/releases/tag/v${version}";
71 license = licenses.mit;
72 maintainers = with maintainers; [ hexa ];
73 };
74}