about summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiomysensors/default.nix
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-08-11 02:54:25 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2022-08-11 02:54:25 +0200
commit29585a363835b26b5437076a466d5e5cbbeeec74 (patch)
treec4256296fc005893a22a09b3b69d41cca7cb54f9 /pkgs/development/python-modules/aiomysensors/default.nix
parentd6417bd3069397ee3a7bf20a7704c0d7325b39f7 (diff)
python310Packages.aiomysensors: init at 0.3.0
Diffstat (limited to 'pkgs/development/python-modules/aiomysensors/default.nix')
-rw-r--r--pkgs/development/python-modules/aiomysensors/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/aiomysensors/default.nix b/pkgs/development/python-modules/aiomysensors/default.nix
new file mode 100644
index 0000000000000..dfa02c9794333
--- /dev/null
+++ b/pkgs/development/python-modules/aiomysensors/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, aiofiles
+, asyncio-mqtt
+, awesomeversion
+, buildPythonPackage
+, click
+, fetchFromGitHub
+, marshmallow
+, poetry-core
+, pyserial-asyncio
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "aiomysensors";
+  version = "0.3.0";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "MartinHjelmare";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-EGVoHEJrpGtp8OrhQhRZVaN1GhL4QCo/azp6pzgYYcs=";
+  };
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aiofiles
+    asyncio-mqtt
+    awesomeversion
+    click
+    marshmallow
+    pyserial-asyncio
+  ];
+
+  checkInputs = [
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace " --cov=src --cov-report=term-missing:skip-covered" "" \
+      --replace 'marshmallow = "^3.17"' 'marshmallow = "*"'
+  '';
+
+  pythonImportsCheck = [
+    "aiomysensors"
+  ];
+
+  meta = with lib; {
+    description = "Library to connect to MySensors gateways";
+    homepage = "https://github.com/MartinHjelmare/aiomysensors";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}