depot/third_party/nixpkgs/pkgs/development/python-modules/bleak/default.nix
Default email 7bc014aa9c Project import generated by Copybara.
GitOrigin-RevId: c97e777ff06fcb8d37dcdf5e21e9eff1f34f0e90
2022-09-11 12:47:08 -03:00

51 lines
1,023 B
Nix

{ lib
, async-timeout
, bluez
, buildPythonPackage
, dbus-next
, fetchPypi
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "bleak";
version = "0.16.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-pUn0PjxdjeRkxytLkFU0w/R4F0bpgV7NUxtyVd4uGcc=";
};
propagatedBuildInputs = [
async-timeout
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\"
'';
pythonImportsCheck = [
"bleak"
];
meta = with lib; {
description = "Bluetooth Low Energy platform agnostic client";
homepage = "https://github.com/hbldh/bleak";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ oxzi ];
};
}