From 618e9a86e16117ad0b437b461ba674a6ba97c03e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 7 Sep 2023 09:54:44 +0200 Subject: [PATCH] python311Packages.pyenphase: init at 1.9.1 https://github.com/pyenphase/pyenphase --- .../python-modules/pyenphase/default.nix | 70 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 72 insertions(+) create mode 100644 pkgs/development/python-modules/pyenphase/default.nix diff --git a/pkgs/development/python-modules/pyenphase/default.nix b/pkgs/development/python-modules/pyenphase/default.nix new file mode 100644 index 000000000000..9861c376bb64 --- /dev/null +++ b/pkgs/development/python-modules/pyenphase/default.nix @@ -0,0 +1,70 @@ +{ lib +, awesomeversion +, buildPythonPackage +, envoy-utils +, fetchFromGitHub +, httpx +, lxml +, orjson +, poetry-core +, pyjwt +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, respx +, syrupy +, tenacity +}: + +buildPythonPackage rec { + pname = "pyenphase"; + version = "1.9.1"; + format = "pyproject"; + + disabled = pythonOlder "3.11"; + + src = fetchFromGitHub { + owner = "pyenphase"; + repo = "pyenphase"; + rev = "refs/tags/v${version}"; + hash = "sha256-6ThUly9ITs2UMCCBFTyKSNnD5Y87GmBA+iaTjk/mJWw="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace " --cov=pyenphase --cov-report=term-missing:skip-covered" "" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + awesomeversion + envoy-utils + httpx + lxml + orjson + pyjwt + tenacity + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + respx + syrupy + ]; + + pythonImportsCheck = [ + "pyenphase" + ]; + + meta = with lib; { + description = "Library to control enphase envoy"; + homepage = "https://github.com/pyenphase/pyenphase"; + changelog = "https://github.com/pyenphase/pyenphase/blob/${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f096bc9503d8..6541327376dc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9046,6 +9046,8 @@ self: super: with self; { inherit (pkgs) enchant2; }; + pyenphase = callPackage ../development/python-modules/pyenphase { }; + pyenvisalink = callPackage ../development/python-modules/pyenvisalink { }; pyephember = callPackage ../development/python-modules/pyephember { };