1{
2 lib,
3 async-timeout,
4 bluetooth-adapters,
5 btsocket,
6 buildPythonPackage,
7 fetchFromGitHub,
8 poetry-core,
9 pyric,
10 pytestCheckHook,
11 pythonOlder,
12 usb-devices,
13}:
14
15buildPythonPackage rec {
16 pname = "bluetooth-auto-recovery";
17 version = "1.4.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "Bluetooth-Devices";
24 repo = "bluetooth-auto-recovery";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-JaFazXjbHohj4+rPkQA/SaBP0irHrre3vaCqz7T2bwE=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail " --cov=bluetooth_auto_recovery --cov-report=term-missing:skip-covered" ""
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 async-timeout
38 bluetooth-adapters
39 btsocket
40 pyric
41 usb-devices
42 ];
43
44 nativeCheckInputs = [ pytestCheckHook ];
45
46 pythonImportsCheck = [ "bluetooth_auto_recovery" ];
47
48 meta = with lib; {
49 description = "Library for recovering Bluetooth adapters";
50 homepage = "https://github.com/Bluetooth-Devices/bluetooth-auto-recovery";
51 changelog = "https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/blob/v${version}/CHANGELOG.md";
52 license = with licenses; [ mit ];
53 maintainers = with maintainers; [ fab ];
54 };
55}