1{
2 lib,
3 async-timeout,
4 bleak,
5 bluetooth-adapters,
6 dbus-fast,
7 buildPythonPackage,
8 fetchFromGitHub,
9 poetry-core,
10 pytestCheckHook,
11 pythonOlder,
12 pytest-asyncio,
13}:
14
15buildPythonPackage rec {
16 pname = "bleak-retry-connector";
17 version = "3.5.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "Bluetooth-Devices";
24 repo = "bleak-retry-connector";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-oqc997siTg43Ulrc539G3utfQvHjcBZJgQ8/CfcSduc=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail " --cov=bleak_retry_connector --cov-report=term-missing:skip-covered" ""
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 async-timeout
38 bleak
39 bluetooth-adapters
40 dbus-fast
41 ];
42
43 nativeCheckInputs = [
44 pytest-asyncio
45 pytestCheckHook
46 ];
47
48 disabledTests = [
49 # broken mocking
50 "test_establish_connection_can_cache_services_services_missing"
51 "test_establish_connection_with_dangerous_use_cached_services"
52 "test_establish_connection_without_dangerous_use_cached_services"
53 ];
54
55 pythonImportsCheck = [ "bleak_retry_connector" ];
56
57 meta = with lib; {
58 description = "Connector for Bleak Clients that handles transient connection failures";
59 homepage = "https://github.com/bluetooth-devices/bleak-retry-connector";
60 changelog = "https://github.com/bluetooth-devices/bleak-retry-connector/blob/v${version}/CHANGELOG.md";
61 license = licenses.mit;
62 maintainers = with maintainers; [ fab ];
63 };
64}