about summary refs log tree commit diff
path: root/pkgs/development/python-modules/omnikinverter
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-12-19 15:50:14 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2021-12-19 15:50:14 +0100
commit0ccf186eb63fc0f0ebb60dea0ab1cfd1bb7d0644 (patch)
tree7583727cbc1811e2c1fc20810f2e9c984f3467bb /pkgs/development/python-modules/omnikinverter
parentcf66057e81c0327efd905d5f6316124b56eee515 (diff)
python3Packages.omnikinverter: init at 0.6.2
Diffstat (limited to 'pkgs/development/python-modules/omnikinverter')
-rw-r--r--pkgs/development/python-modules/omnikinverter/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/omnikinverter/default.nix b/pkgs/development/python-modules/omnikinverter/default.nix
new file mode 100644
index 0000000000000..6f347d9672a0c
--- /dev/null
+++ b/pkgs/development/python-modules/omnikinverter/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, aiohttp
+, aresponses
+, buildPythonPackage
+, fetchFromGitHub
+, poetry-core
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+, yarl
+}:
+
+buildPythonPackage rec {
+  pname = "omnikinverter";
+  version = "0.6.2";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "klaasnicolaas";
+    repo = "python-omnikinverter";
+    rev = "v${version}";
+    sha256 = "sha256-NnwjiaFUi2vzORu8sndtfdVpZEAIMCvT+9VEr2ZOx3k=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aiohttp
+    yarl
+  ];
+
+  checkInputs = [
+    aresponses
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    # Upstream doesn't set a version for the pyproject.toml
+    substituteInPlace pyproject.toml \
+      --replace "0.0.0" "${version}" \
+      --replace "--cov" ""
+  '';
+
+  pythonImportsCheck = [
+    "omnikinverter"
+  ];
+
+  meta = with lib; {
+    description = "Python module for the Omnik Inverter";
+    homepage = "https://github.com/klaasnicolaas/python-omnikinverter";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}