1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, requests
6}:
7
8buildPythonPackage rec {
9 pname = "growattserver";
10 version = "1.1.0";
11 disabled = pythonOlder "3.6";
12
13 src = fetchFromGitHub {
14 owner = "indykoning";
15 repo = "PyPi_GrowattServer";
16 rev = version;
17 sha256 = "sha256-Vooy+czqhrsWVw35zJb5paC5G0WwOlI5hF8PXxJG0cY=";
18 };
19
20 propagatedBuildInputs = [
21 requests
22 ];
23
24 postPatch = ''
25 # https://github.com/indykoning/PyPi_GrowattServer/issues/2
26 substituteInPlace setup.py \
27 --replace "tag = os.environ['LATEST_TAG']" "" \
28 --replace "version=tag," 'version="${version}",'
29 '';
30
31 # Project has no tests
32 doCheck = false;
33
34 pythonImportsCheck = [ "growattServer" ];
35
36 meta = with lib; {
37 description = "Python package to retrieve information from Growatt units";
38 homepage = "https://github.com/indykoning/PyPi_GrowattServer";
39 license = licenses.mit;
40 maintainers = with maintainers; [ fab ];
41 };
42}