summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/bleak-retry-connector/default.nix
blob: 5bb97948c6d68a64af7285bed55a2544e6e32b0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
  lib,
  stdenv,
  bleak,
  blockbuster,
  bluetooth-adapters,
  buildPythonPackage,
  dbus-fast,
  fetchFromGitHub,
  poetry-core,
  pytest-asyncio,
  pytest-cov-stub,
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "bleak-retry-connector";
  version = "4.7.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Bluetooth-Devices";
    repo = "bleak-retry-connector";
    tag = "v${finalAttrs.version}";
    hash = "sha256-r3aBADooshin8Gkkf2EVFEHz82ENB07F+XMPzaGO/9I=";
  };

  build-system = [ poetry-core ];

  dependencies = [
    bleak
  ]
  ++ lib.optionals stdenv.hostPlatform.isLinux [
    dbus-fast
    bluetooth-adapters
  ];

  nativeCheckInputs = [
    blockbuster
    pytest-asyncio
    pytest-cov-stub
    pytestCheckHook
  ];

  # ModuleNotFoundError: No module named 'dbus_fast'
  doCheck = stdenv.hostPlatform.isLinux;

  pythonImportsCheck = [ "bleak_retry_connector" ];

  meta = {
    description = "Connector for Bleak Clients that handles transient connection failures";
    homepage = "https://github.com/bluetooth-devices/bleak-retry-connector";
    changelog = "https://github.com/Bluetooth-Devices/bleak-retry-connector/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
})