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