depot/third_party/nixpkgs/pkgs/development/python-modules/bleak/default.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

61 lines
1.2 KiB
Nix

{ lib
, async-timeout
, bluez
, buildPythonPackage
, dbus-fast
, fetchFromGitHub
, poetry-core
, pytest-asyncio
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "bleak";
version = "0.21.1";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "hbldh";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-T0im8zKyNLbskAEDeUUFS/daJtvttlHlttjscqP8iSk=";
};
postPatch = ''
# bleak checks BlueZ's version with a call to `bluetoothctl --version`
substituteInPlace bleak/backends/bluezdbus/version.py \
--replace \"bluetoothctl\" \"${bluez}/bin/bluetoothctl\"
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
async-timeout
dbus-fast
typing-extensions
];
nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
];
pythonImportsCheck = [
"bleak"
];
meta = with lib; {
description = "Bluetooth Low Energy platform agnostic client";
homepage = "https://github.com/hbldh/bleak";
changelog = "https://github.com/hbldh/bleak/blob/v${version}/CHANGELOG.rst";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ oxzi ];
};
}