1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchFromGitHub
5, aiohttp
6, backoff
7, poetry-core
8, packaging
9, yarl
10, aresponses
11, pytest-asyncio
12, pytestCheckHook
13}:
14
15buildPythonPackage rec {
16 pname = "wled";
17 version = "0.8.0";
18 disabled = pythonOlder "3.8";
19 format = "pyproject";
20
21 src = fetchFromGitHub {
22 owner = "frenck";
23 repo = "python-wled";
24 rev = "v${version}";
25 sha256 = "1jhykilb81sp1srxk91222qglwdlr993ssvgfnl837nbcx6ws1hw";
26 };
27
28 nativeBuildInputs = [
29 poetry-core
30 ];
31
32 propagatedBuildInputs = [
33 aiohttp
34 backoff
35 packaging
36 yarl
37 ];
38
39 checkInputs = [
40 aresponses
41 pytest-asyncio
42 pytestCheckHook
43 ];
44
45 postPatch = ''
46 # Upstream doesn't set a version for the pyproject.toml
47 substituteInPlace pyproject.toml \
48 --replace "0.0.0" "${version}" \
49 --replace "--cov" ""
50 '';
51
52 pythonImportsCheck = [ "wled" ];
53
54 meta = with lib; {
55 description = "Asynchronous Python client for WLED";
56 homepage = "https://github.com/frenck/python-wled";
57 license = licenses.mit;
58 maintainers = with maintainers; [ hexa ];
59 };
60}