about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2024-02-21 14:51:19 +0100
committerFabian Affolter <mail@fabian-affolter.ch>2024-02-21 14:51:19 +0100
commit5ae56eac276165331acfb4eb5330b7a78429c73b (patch)
tree4f1846b8b6388db755335bae5d05e2e0c17c02f6
parentce0a397880466cf74b7d50fbe99aa7c53c8fb40f (diff)
python312Packages.oralb-ble: refactor
-rw-r--r--pkgs/development/python-modules/oralb-ble/default.nix23
1 files changed, 16 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/oralb-ble/default.nix b/pkgs/development/python-modules/oralb-ble/default.nix
index 369156b46bf08..08b0abb2ded85 100644
--- a/pkgs/development/python-modules/oralb-ble/default.nix
+++ b/pkgs/development/python-modules/oralb-ble/default.nix
@@ -1,4 +1,5 @@
 { lib
+, bleak
 , bleak-retry-connector
 , bluetooth-data-tools
 , bluetooth-sensor-state-data
@@ -6,6 +7,7 @@
 , fetchFromGitHub
 , home-assistant-bluetooth
 , poetry-core
+, pytest-asyncio
 , pytestCheckHook
 , pythonOlder
 }:
@@ -13,22 +15,28 @@
 buildPythonPackage rec {
   pname = "oralb-ble";
   version = "0.18.0";
-  format = "pyproject";
+  pyproject = true;
 
   disabled = pythonOlder "3.9";
 
   src = fetchFromGitHub {
     owner = "Bluetooth-Devices";
-    repo = pname;
+    repo = "oralb-ble";
     rev = "refs/tags/v${version}";
     hash = "sha256-e6L8HXpqOAHnEktIJ1N1atC5QXno669W3c/S7cISa48=";
   };
 
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace-fail " --cov=oralb_ble --cov-report=term-missing:skip-covered" ""
+  '';
+
   nativeBuildInputs = [
     poetry-core
   ];
 
   propagatedBuildInputs = [
+    bleak
     bleak-retry-connector
     bluetooth-data-tools
     bluetooth-sensor-state-data
@@ -36,18 +44,19 @@ buildPythonPackage rec {
   ];
 
   nativeCheckInputs = [
+    pytest-asyncio
     pytestCheckHook
   ];
 
-  postPatch = ''
-    substituteInPlace pyproject.toml \
-      --replace " --cov=oralb_ble --cov-report=term-missing:skip-covered" ""
-  '';
-
   pythonImportsCheck = [
     "oralb_ble"
   ];
 
+  disabledTests = [
+    # Test is outdated, TypeError: BLEDevice.__init__() missing 2 required...
+    "test_async_poll"
+  ];
+
   meta = with lib; {
     description = "Library for Oral B BLE devices";
     homepage = "https://github.com/Bluetooth-Devices/oralb-ble";