2021-05-28 09:39:13 +00:00
|
|
|
{ lib
|
2022-01-26 04:04:25 +00:00
|
|
|
, beautifulsoup4
|
2021-05-28 09:39:13 +00:00
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, envoy-utils
|
2021-05-28 09:39:13 +00:00
|
|
|
, fetchFromGitHub
|
2021-12-26 17:43:05 +00:00
|
|
|
, fetchpatch
|
2021-05-28 09:39:13 +00:00
|
|
|
, httpx
|
2022-01-26 04:04:25 +00:00
|
|
|
, pyjwt
|
2021-05-28 09:39:13 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
2022-01-26 04:04:25 +00:00
|
|
|
, pytest-raises
|
|
|
|
, pythonOlder
|
2021-05-28 09:39:13 +00:00
|
|
|
, respx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "envoy-reader";
|
2022-01-26 04:04:25 +00:00
|
|
|
version = "0.21.3";
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jesserizzo";
|
|
|
|
repo = "envoy_reader";
|
|
|
|
rev = version;
|
2022-01-26 04:04:25 +00:00
|
|
|
sha256 = "sha256-aIpZ4ln4L57HwK8H0FqsyNnXosnAp3ingrJI6/MPS90=";
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2022-01-26 04:04:25 +00:00
|
|
|
beautifulsoup4
|
2021-09-18 10:52:07 +00:00
|
|
|
envoy-utils
|
2021-05-28 09:39:13 +00:00
|
|
|
httpx
|
2022-01-26 04:04:25 +00:00
|
|
|
pyjwt
|
2021-05-28 09:39:13 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-28 09:39:13 +00:00
|
|
|
pytest-raises
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2022-01-26 04:04:25 +00:00
|
|
|
--replace "pytest-runner>=5.2" "" \
|
|
|
|
--replace "pyjwt==2.1.0" "pyjwt>=2.1.0"
|
2021-09-18 10:52:07 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"envoy_reader"
|
|
|
|
];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to read from Enphase Envoy units";
|
|
|
|
homepage = "https://github.com/jesserizzo/envoy_reader";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|