From eff2b5ae789f980c13a4ea20b905d9010b683034 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 28 Jul 2022 20:38:51 +0200 Subject: [PATCH] python310Packages.bleak: disable on older Python releases - add missing input --- .../python-modules/bleak/default.nix | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/bleak/default.nix b/pkgs/development/python-modules/bleak/default.nix index 2a401955317c..a06b31b64a6d 100644 --- a/pkgs/development/python-modules/bleak/default.nix +++ b/pkgs/development/python-modules/bleak/default.nix @@ -1,32 +1,46 @@ -{ lib, buildPythonPackage, isPy3k, fetchPypi -, bluez, dbus-next, pytestCheckHook, pytest-cov +{ lib +, bluez +, buildPythonPackage +, dbus-next +, fetchPypi +, pytestCheckHook +, pythonOlder +, typing-extensions }: buildPythonPackage rec { pname = "bleak"; version = "0.14.3"; + format = "setuptools"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - sha256 = "sha256-dg5bsegECH92JXa5uVY9Y7R9UhsWUpiOKMPLXmS2GZA="; + hash = "sha256-dg5bsegECH92JXa5uVY9Y7R9UhsWUpiOKMPLXmS2GZA="; }; + propagatedBuildInputs = [ + dbus-next + typing-extensions + ]; + + checkInputs = [ + pytestCheckHook + ]; + postPatch = '' # bleak checks BlueZ's version with a call to `bluetoothctl --version` substituteInPlace bleak/backends/bluezdbus/__init__.py \ --replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\" ''; - propagatedBuildInputs = [ dbus-next ]; - - checkInputs = [ pytestCheckHook pytest-cov ]; - - pythonImportsCheck = [ "bleak" ]; + pythonImportsCheck = [ + "bleak" + ]; meta = with lib; { - description = "Bluetooth Low Energy platform Agnostic Klient for Python"; + description = "Bluetooth Low Energy platform agnostic client"; homepage = "https://github.com/hbldh/bleak"; license = licenses.mit; platforms = platforms.linux;