about summary refs log tree commit diff
path: root/pkgs/development/python-modules/habluetooth/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/habluetooth/default.nix')
-rw-r--r--pkgs/development/python-modules/habluetooth/default.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/habluetooth/default.nix b/pkgs/development/python-modules/habluetooth/default.nix
new file mode 100644
index 000000000000..f42d8413dd32
--- /dev/null
+++ b/pkgs/development/python-modules/habluetooth/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, cython
+, poetry-core
+, setuptools
+, wheel
+, bleak
+, pytestCheckHook
+, bleak-retry-connector
+, bluetooth-adapters
+, bluetooth-auto-recovery
+, bluetooth-data-tools
+, home-assistant-bluetooth
+, pythonOlder
+}:
+
+buildPythonPackage rec {
+  pname = "habluetooth";
+  version = "0.5.1";
+  pyproject = true;
+
+  disabled = pythonOlder "3.9";
+
+  src = fetchFromGitHub {
+    owner = "Bluetooth-Devices";
+    repo = "habluetooth";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-olR900l/xJug5DeXb8CR0vQBzjzegdiCLCp6AIQu7Tg=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace " --cov=habluetooth --cov-report=term-missing:skip-covered" ""
+  '';
+
+  nativeBuildInputs = [
+    cython
+    poetry-core
+    setuptools
+    wheel
+  ];
+
+  propagatedBuildInputs = [
+    bleak
+    bleak-retry-connector
+    bluetooth-adapters
+    bluetooth-auto-recovery
+    bluetooth-data-tools
+    home-assistant-bluetooth
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "habluetooth"
+  ];
+
+  meta = with lib; {
+    description = "Library for high availability Bluetooth";
+    homepage = "https://github.com/Bluetooth-Devices/habluetooth";
+    changelog = "https://github.com/Bluetooth-Devices/habluetooth/blob/${version}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ fab ];
+  };
+}