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