From 5f16f26d93eaae3dd9edad893284eab1432f7539 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 16 May 2021 01:44:37 +0200 Subject: [PATCH] python3Packages.growattserver: init at 1.0.1 --- .../python-modules/growattserver/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/growattserver/default.nix diff --git a/pkgs/development/python-modules/growattserver/default.nix b/pkgs/development/python-modules/growattserver/default.nix new file mode 100644 index 000000000000..64c6e7bf2b1b --- /dev/null +++ b/pkgs/development/python-modules/growattserver/default.nix @@ -0,0 +1,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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bda7bf671851..4f7eeaedfbf3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3019,6 +3019,8 @@ in { gremlinpython = callPackage ../development/python-modules/gremlinpython { }; + growattserver = callPackage ../development/python-modules/growattserver { }; + grip = callPackage ../development/python-modules/grip { }; grpc_google_iam_v1 = callPackage ../development/python-modules/grpc_google_iam_v1 { };