1{
2 lib,
3 async-interrupt,
4 bleak-retry-connector,
5 bleak,
6 bluetooth-adapters,
7 bluetooth-auto-recovery,
8 bluetooth-data-tools,
9 buildPythonPackage,
10 cython,
11 fetchFromGitHub,
12 freezegun,
13 poetry-core,
14 pytest-asyncio,
15 pytest-codspeed,
16 pytest-cov-stub,
17 pytestCheckHook,
18 pythonOlder,
19 setuptools,
20}:
21
22buildPythonPackage rec {
23 pname = "habluetooth";
24 version = "4.0.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.11";
28
29 src = fetchFromGitHub {
30 owner = "Bluetooth-Devices";
31 repo = "habluetooth";
32 tag = "v${version}";
33 hash = "sha256-82eV76oY/exkHbhZt3OaifOoKxN2D6npstvfBDVgszw=";
34 };
35
36 postPatch = ''
37 substituteInPlace pyproject.toml \
38 --replace-fail 'Cython>=3,<3.1' 'Cython'
39 '';
40
41 build-system = [
42 cython
43 poetry-core
44 setuptools
45 ];
46
47 dependencies = [
48 async-interrupt
49 bleak
50 bleak-retry-connector
51 bluetooth-adapters
52 bluetooth-auto-recovery
53 bluetooth-data-tools
54 ];
55
56 nativeCheckInputs = [
57 freezegun
58 pytest-asyncio
59 pytest-codspeed
60 pytest-cov-stub
61 pytestCheckHook
62 ];
63
64 pythonImportsCheck = [ "habluetooth" ];
65
66 meta = with lib; {
67 description = "Library for high availability Bluetooth";
68 homepage = "https://github.com/Bluetooth-Devices/habluetooth";
69 changelog = "https://github.com/Bluetooth-Devices/habluetooth/blob/${src.tag}/CHANGELOG.md";
70 license = licenses.asl20;
71 maintainers = with maintainers; [ fab ];
72 };
73}