1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 mashumaro,
8 orjson,
9 poetry-core,
10 pytest-asyncio,
11 pytestCheckHook,
12 pythonOlder,
13 pythonRelaxDepsHook,
14 syrupy,
15 yarl,
16}:
17
18buildPythonPackage rec {
19 pname = "autarco";
20 version = "0.3.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "klaasnicolaas";
27 repo = "python-autarco";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-IBf6Dw2Yf7m+5bQ72K0kPxGdtpl8JowQ9IO3gWS3Vso=";
30 };
31
32 pythonRelaxDeps = [ "orjson" ];
33
34 postPatch = ''
35 # Upstream doesn't set a version for the pyproject.toml
36 substituteInPlace pyproject.toml \
37 --replace "0.0.0" "${version}" \
38 --replace "--cov" ""
39 '';
40
41 nativeBuildInputs = [
42 poetry-core
43 pythonRelaxDepsHook
44 ];
45
46 propagatedBuildInputs = [
47 aiohttp
48 mashumaro
49 orjson
50 yarl
51 ];
52
53 __darwinAllowLocalNetworking = true;
54
55 nativeCheckInputs = [
56 aresponses
57 pytest-asyncio
58 pytestCheckHook
59 syrupy
60 ];
61
62 pythonImportsCheck = [ "autarco" ];
63
64 meta = with lib; {
65 description = "Module for the Autarco Inverter";
66 homepage = "https://github.com/klaasnicolaas/python-autarco";
67 changelog = "https://github.com/klaasnicolaas/python-autarco/releases/tag/v${version}";
68 license = with licenses; [ mit ];
69 maintainers = with maintainers; [ fab ];
70 };
71}