1{
2 lib,
3 beautifulsoup4,
4 buildPythonPackage,
5 envoy-utils,
6 fetchFromGitHub,
7 setuptools,
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 pyproject = true;
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 build-system = [ setuptools ];
32
33 dependencies = [
34 beautifulsoup4
35 envoy-utils
36 httpx
37 pyjwt
38 ];
39
40 nativeCheckInputs = [
41 pytest-raises
42 pytest-asyncio
43 pytestCheckHook
44 respx
45 ];
46
47 pythonRelaxDeps = [ "pyjwt" ];
48
49 postPatch = ''
50 substituteInPlace setup.py \
51 --replace-fail "pytest-runner>=5.2" ""
52 '';
53
54 pythonImportsCheck = [ "envoy_reader" ];
55
56 meta = with lib; {
57 description = "Python module to read from Enphase Envoy units";
58 homepage = "https://github.com/jesserizzo/envoy_reader";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}