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