1{ lib
2, awesomeversion
3, buildPythonPackage
4, envoy-utils
5, fetchFromGitHub
6, httpx
7, lxml
8, orjson
9, poetry-core
10, pyjwt
11, pytest-asyncio
12, pytestCheckHook
13, pythonOlder
14, respx
15, syrupy
16, tenacity
17}:
18
19buildPythonPackage rec {
20 pname = "pyenphase";
21 version = "1.14.3";
22 format = "pyproject";
23
24 disabled = pythonOlder "3.11";
25
26 src = fetchFromGitHub {
27 owner = "pyenphase";
28 repo = "pyenphase";
29 rev = "refs/tags/v${version}";
30 hash = "sha256-cjkmRGieSKynL8cZORp11/ViK8oCBAZXrgbFKumWKaM=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace " --cov=pyenphase --cov-report=term-missing:skip-covered" ""
36 '';
37
38 nativeBuildInputs = [
39 poetry-core
40 ];
41
42 propagatedBuildInputs = [
43 awesomeversion
44 envoy-utils
45 httpx
46 lxml
47 orjson
48 pyjwt
49 tenacity
50 ];
51
52 nativeCheckInputs = [
53 pytest-asyncio
54 pytestCheckHook
55 respx
56 syrupy
57 ];
58
59 disabledTests = [
60 # https://github.com/pyenphase/pyenphase/issues/97
61 "test_with_7_x_firmware"
62 ];
63
64 pythonImportsCheck = [
65 "pyenphase"
66 ];
67
68 meta = with lib; {
69 description = "Library to control enphase envoy";
70 homepage = "https://github.com/pyenphase/pyenphase";
71 changelog = "https://github.com/pyenphase/pyenphase/blob/${version}/CHANGELOG.md";
72 license = licenses.mit;
73 maintainers = with maintainers; [ fab ];
74 };
75}