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 25325652e657..b2e174c420c5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9060,6 +9060,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 { };