1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 cython,
6 dbus,
7 fetchFromGitHub,
8 poetry-core,
9 pytest,
10 pytest-asyncio,
11 pytest-codspeed,
12 pytest-cov-stub,
13 python,
14 pythonOlder,
15 setuptools,
16}:
17
18buildPythonPackage rec {
19 pname = "dbus-fast";
20 version = "2.44.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.9";
24
25 src = fetchFromGitHub {
26 owner = "Bluetooth-Devices";
27 repo = "dbus-fast";
28 tag = "v${version}";
29 hash = "sha256-r9F/3H/Bagi9QJHZDEsa80dglVE9vS1f9Cqt7CZWn8Y=";
30 };
31
32 # The project can build both an optimized cython version and an unoptimized
33 # python version. This ensures we fail if we build the wrong one.
34 env.REQUIRE_CYTHON = 1;
35
36 build-system = [
37 cython
38 poetry-core
39 setuptools
40 ];
41
42 dependencies = [ async-timeout ];
43
44 nativeCheckInputs = [
45 dbus
46 pytest
47 pytest-asyncio
48 pytest-codspeed
49 pytest-cov-stub
50 ];
51
52 pythonImportsCheck = [
53 "dbus_fast"
54 "dbus_fast.aio"
55 "dbus_fast.service"
56 "dbus_fast.message"
57 ];
58
59 checkPhase = ''
60 runHook preCheck
61
62 # test_peer_interface times out
63 dbus-run-session \
64 --config-file=${dbus}/share/dbus-1/session.conf \
65 ${python.interpreter} -m pytest -k "not test_peer_interface"
66
67 runHook postCheck
68 '';
69
70 meta = with lib; {
71 description = "Faster version of dbus-next";
72 homepage = "https://github.com/bluetooth-devices/dbus-fast";
73 changelog = "https://github.com/Bluetooth-Devices/dbus-fast/blob/${src.tag}/CHANGELOG.md";
74 license = licenses.mit;
75 maintainers = with maintainers; [ fab ];
76 };
77}