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 syrupy,
14 yarl,
15}:
16
17buildPythonPackage rec {
18 pname = "autarco";
19 version = "2.0.0";
20 pyproject = true;
21
22 disabled = pythonOlder "3.11";
23
24 src = fetchFromGitHub {
25 owner = "klaasnicolaas";
26 repo = "python-autarco";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-e/wi4suDMSQTaSdyYsTiBxVUNvisYBVPqy9Rpk0lwJw=";
29 };
30
31 pythonRelaxDeps = [ "orjson" ];
32
33 postPatch = ''
34 # Upstream doesn't set a version for the pyproject.toml
35 substituteInPlace pyproject.toml \
36 --replace "0.0.0" "${version}" \
37 --replace "--cov" ""
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 pytestCheckHook
55 syrupy
56 ];
57
58 pythonImportsCheck = [ "autarco" ];
59
60 meta = with lib; {
61 description = "Module for the Autarco Inverter";
62 homepage = "https://github.com/klaasnicolaas/python-autarco";
63 changelog = "https://github.com/klaasnicolaas/python-autarco/releases/tag/v${version}";
64 license = licenses.mit;
65 maintainers = with maintainers; [ fab ];
66 };
67}