2021-05-28 09:39:13 +00:00
|
|
|
{ lib
|
|
|
|
, 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
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-raises
|
|
|
|
, pytestCheckHook
|
|
|
|
, respx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "envoy-reader";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.20.0";
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jesserizzo";
|
|
|
|
repo = "envoy_reader";
|
|
|
|
rev = version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-nPB1Fvb1qwLHeFkXP2jXixD2ZGA09MtS1qXRhYGt0fM=";
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2021-09-18 10:52:07 +00:00
|
|
|
envoy-utils
|
2021-05-28 09:39:13 +00:00
|
|
|
httpx
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest-raises
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
respx
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "pytest-runner>=5.2" ""
|
|
|
|
'';
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
patches = [
|
|
|
|
# Support for later httpx, https://github.com/jesserizzo/envoy_reader/pull/82
|
|
|
|
(fetchpatch {
|
|
|
|
name = "support-later-httpx.patch";
|
|
|
|
url = "https://github.com/jesserizzo/envoy_reader/commit/6019a89419fe9c830ba839be7d39ec54725268b0.patch";
|
|
|
|
sha256 = "17vsrx13rskvh8swvjisb2dk6x1jdbjcm8ikkpidia35pa24h272";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|