From 044670c79be20d52d5f6ac54824c52fff4fedcc4 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 7 Mar 2023 23:44:46 +0100 Subject: [PATCH] python310Packages.energyzero: init at 0.4.0 --- .../python-modules/energyzero/default.nix | 61 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/development/python-modules/energyzero/default.nix diff --git a/pkgs/development/python-modules/energyzero/default.nix b/pkgs/development/python-modules/energyzero/default.nix new file mode 100644 index 000000000000..ae70514ed863 --- /dev/null +++ b/pkgs/development/python-modules/energyzero/default.nix @@ -0,0 +1,61 @@ +{ lib +, aiohttp +, aresponses +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytest-asyncio +, pytest-freezer +, pytestCheckHook +, pythonOlder +, yarl +}: + +buildPythonPackage rec { + pname = "energyzero"; + version = "0.4.0"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "klaasnicolaas"; + repo = "python-energyzero"; + rev = "refs/tags/v${version}"; + hash = "sha256-QSxr4hfNlpIbLpeQ8tcdRP3dARB/OxTP9cVgf+P63Lw="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace '"0.0.0"' '"${version}"' \ + --replace 'addopts = "--cov"' "" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + aiohttp + yarl + ]; + + nativeCheckInputs = [ + aresponses + pytest-asyncio + pytest-freezer + pytestCheckHook + ]; + + pythonImportsCheck = [ + "energyzero" + ]; + + meta = with lib; { + description = "Module for getting the dynamic prices from EnergyZero"; + homepage = "https://github.com/klaasnicolaas/python-energyzero"; + changelog = "https://github.com/klaasnicolaas/python-energyzero/releases/tag/v${version}"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1ac6c38143bb..108d9e6788d3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3063,6 +3063,8 @@ self: super: with self; { energyflow = callPackage ../development/python-modules/energyflow { }; + energyzero = callPackage ../development/python-modules/energyzero { }; + enhancements = callPackage ../development/python-modules/enhancements { }; enlighten = callPackage ../development/python-modules/enlighten { };