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