2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchpatch
|
2021-12-06 16:07:01 +00:00
|
|
|
, flit-core
|
2023-10-09 19:29:22 +00:00
|
|
|
, dos2unix
|
2021-12-06 16:07:01 +00:00
|
|
|
, httpx
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-mock
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "zeversolarlocal";
|
|
|
|
version = "1.1.0";
|
2023-10-09 19:29:22 +00:00
|
|
|
format = "pyproject";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "ExZy5k5RE7k+D0lGmuIkGWrWQ+m24K2oqbUEg4BAVuY=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
2023-10-09 19:29:22 +00:00
|
|
|
dos2unix
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
httpx
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# the patch below won't apply unless we fix the line endings
|
|
|
|
prePatch = ''
|
|
|
|
dos2unix pyproject.toml
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Raise the flit-core limit
|
|
|
|
# https://github.com/sander76/zeversolarlocal/pull/4
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/sander76/zeversolarlocal/commit/bff072ea046de07eced77bc79eb8e90dfef1f53f.patch";
|
|
|
|
hash = "sha256-tzFCwPzhAfwVfN5mLY/DMwRv7zGzx3ScBe+kKzkYcvo=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "--cov zeversolarlocal --cov-report xml:cov.xml --cov-report term-missing -vv" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Test requires network access
|
|
|
|
"test_httpx_timeout"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"zeversolarlocal"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to interact with Zeversolar inverters";
|
|
|
|
homepage = "https://github.com/sander76/zeversolarlocal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|