1{
2 lib,
3 beautifulsoup4,
4 buildPythonPackage,
5 envoy-utils,
6 fetchFromGitHub,
7 fetchpatch,
8 httpx,
9 pyjwt,
10 pytest-asyncio,
11 pytestCheckHook,
12 pytest-raises,
13 pythonOlder,
14 respx,
15}:
16
17buildPythonPackage rec {
18 pname = "envoy-reader";
19 version = "0.21.3";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "jesserizzo";
26 repo = "envoy_reader";
27 rev = version;
28 hash = "sha256-aIpZ4ln4L57HwK8H0FqsyNnXosnAp3ingrJI6/MPS90=";
29 };
30
31 propagatedBuildInputs = [
32 beautifulsoup4
33 envoy-utils
34 httpx
35 pyjwt
36 ];
37
38 nativeCheckInputs = [
39 pytest-raises
40 pytest-asyncio
41 pytestCheckHook
42 respx
43 ];
44
45 postPatch = ''
46 substituteInPlace setup.py \
47 --replace "pytest-runner>=5.2" "" \
48 --replace "pyjwt==2.1.0" "pyjwt>=2.1.0"
49 '';
50
51 pythonImportsCheck = [ "envoy_reader" ];
52
53 meta = with lib; {
54 description = "Python module to read from Enphase Envoy units";
55 homepage = "https://github.com/jesserizzo/envoy_reader";
56 license = licenses.mit;
57 maintainers = with maintainers; [ fab ];
58 };
59}