1{
2 lib,
3 aiohttp,
4 aresponses,
5 buildPythonPackage,
6 fetchFromGitHub,
7 mashumaro,
8 orjson,
9 poetry-core,
10 pytest-asyncio,
11 pytest-cov-stub,
12 pytestCheckHook,
13 pythonOlder,
14 syrupy,
15 yarl,
16}:
17
18buildPythonPackage rec {
19 pname = "autarco";
20 version = "3.1.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.11";
24
25 src = fetchFromGitHub {
26 owner = "klaasnicolaas";
27 repo = "python-autarco";
28 tag = "v${version}";
29 hash = "sha256-zSqIEtQucrrAFEY7pBJ14Cevq8xbcGOheEmEE7Jd4qk=";
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-fail "0.0.0" "${version}"
38 '';
39
40 build-system = [ poetry-core ];
41
42 dependencies = [
43 aiohttp
44 mashumaro
45 orjson
46 yarl
47 ];
48
49 __darwinAllowLocalNetworking = true;
50
51 nativeCheckInputs = [
52 aresponses
53 pytest-asyncio
54 pytest-cov-stub
55 pytestCheckHook
56 syrupy
57 ];
58
59 pythonImportsCheck = [ "autarco" ];
60
61 meta = with lib; {
62 description = "Module for the Autarco Inverter";
63 homepage = "https://github.com/klaasnicolaas/python-autarco";
64 changelog = "https://github.com/klaasnicolaas/python-autarco/releases/tag/v${version}";
65 license = licenses.mit;
66 maintainers = with maintainers; [ fab ];
67 };
68}