1{
2 lib,
3 aiohttp,
4 aiooui,
5 async-timeout,
6 bleak,
7 buildPythonPackage,
8 dbus-fast,
9 fetchFromGitHub,
10 mac-vendor-lookup,
11 myst-parser,
12 poetry-core,
13 pytest-asyncio,
14 pytestCheckHook,
15 pythonOlder,
16 sphinx-rtd-theme,
17 sphinxHook,
18 uart-devices,
19 usb-devices,
20}:
21
22buildPythonPackage rec {
23 pname = "bluetooth-adapters";
24 version = "0.20.2";
25 pyproject = true;
26
27 disabled = pythonOlder "3.9";
28
29 src = fetchFromGitHub {
30 owner = "Bluetooth-Devices";
31 repo = "bluetooth-adapters";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-JeYqzwlR0zY0BGC6iFCTu9EDlYnu+wdpGeje2xKwcVI=";
34 };
35
36 postPatch = ''
37 # Drop pytest arguments (coverage, ...)
38 sed -i '/addopts/d' pyproject.toml
39 '';
40
41 outputs = [
42 "out"
43 "doc"
44 ];
45
46 build-system = [
47 myst-parser
48 poetry-core
49 sphinx-rtd-theme
50 sphinxHook
51 ];
52
53 dependencies = [
54 aiohttp
55 aiooui
56 async-timeout
57 bleak
58 dbus-fast
59 mac-vendor-lookup
60 uart-devices
61 usb-devices
62 ];
63
64 nativeCheckInputs = [
65 pytest-asyncio
66 pytestCheckHook
67 ];
68
69 pythonImportsCheck = [ "bluetooth_adapters" ];
70
71 meta = with lib; {
72 description = "Tools to enumerate and find Bluetooth Adapters";
73 homepage = "https://github.com/Bluetooth-Devices/bluetooth-adapters";
74 changelog = "https://github.com/bluetooth-devices/bluetooth-adapters/blob/v${version}/CHANGELOG.md";
75 license = licenses.asl20;
76 maintainers = teams.home-assistant.members;
77 };
78}