1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7 setuptools,
8}:
9
10buildPythonPackage rec {
11 pname = "goodwe";
12 version = "0.4.8";
13 pyproject = true;
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "marcelblijleven";
19 repo = "goodwe";
20 tag = "v${version}";
21 hash = "sha256-EsMv4hzGsAV9OTFo2b/omM4hx7XxUcdO6rrMzQ3DmNQ=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.cfg \
26 --replace-fail "'marcelblijleven@gmail.com" "marcelblijleven@gmail.com" \
27 --replace-fail "version: file: VERSION" "version = ${version}"
28 '';
29
30 build-system = [ setuptools ];
31
32 nativeCheckInputs = [ pytestCheckHook ];
33
34 pythonImportsCheck = [ "goodwe" ];
35
36 meta = with lib; {
37 description = "Python library for connecting to GoodWe inverter";
38 homepage = "https://github.com/marcelblijleven/goodwe";
39 changelog = "https://github.com/marcelblijleven/goodwe/releases/tag/v${version}";
40 license = licenses.mit;
41 maintainers = with maintainers; [ fab ];
42 };
43}