about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/growattserver/default.nix
blob: 64c6e7bf2b1beb76c508d432d23d2b974fb93f8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, requests
}:

buildPythonPackage rec {
  pname = "growattserver";
  version = "1.0.1";
  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "indykoning";
    repo = "PyPi_GrowattServer";
    rev = version;
    sha256 = "1vgb92axlz1kkszmamjbsqgi74afnbr2mc1np3pmbn3bx5rmk1d9";
  };

  propagatedBuildInputs = [
    requests
  ];

  postPatch = ''
    # https://github.com/indykoning/PyPi_GrowattServer/issues/2
    substituteInPlace setup.py \
      --replace "tag = os.environ['LATEST_TAG']" "" \
      --replace "version=tag," 'version="${version}",'
  '';

  # Project has no tests
  doCheck = false;

  pythonImportsCheck = [ "growattServer" ];

  meta = with lib; {
    description = "Python package to retrieve information from Growatt units";
    homepage = "https://github.com/indykoning/PyPi_GrowattServer";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}