1{
2 lib,
3 async-timeout,
4 buildPythonPackage,
5 cython,
6 fetchFromGitHub,
7 poetry-core,
8 pytest-asyncio,
9 pytestCheckHook,
10 pythonOlder,
11 setuptools,
12 wheel,
13}:
14
15buildPythonPackage rec {
16 pname = "dbus-fast";
17 version = "2.22.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "Bluetooth-Devices";
24 repo = "dbus-fast";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-WT32nkRcS+JFCJCZNXXFm38nzttYLsqU98tJD7YBn9w=";
27 };
28
29 # The project can build both an optimized cython version and an unoptimized
30 # python version. This ensures we fail if we build the wrong one.
31 env.REQUIRE_CYTHON = 1;
32
33 build-system = [
34 cython
35 poetry-core
36 setuptools
37 wheel
38 ];
39
40 dependencies = [ async-timeout ];
41
42 nativeCheckInputs = [
43 pytest-asyncio
44 pytestCheckHook
45 ];
46
47 postPatch = ''
48 substituteInPlace pyproject.toml \
49 --replace " --cov=dbus_fast --cov-report=term-missing:skip-covered" ""
50 '';
51
52 pythonImportsCheck = [
53 "dbus_fast"
54 "dbus_fast.aio"
55 "dbus_fast.service"
56 "dbus_fast.message"
57 ];
58
59 disabledTests = [
60 # Test require a running Dbus instance
61 "test_aio_big_message"
62 "test_aio_properties"
63 "test_aio_proxy_object"
64 "test_bus_disconnect_before_reply"
65 "test_error_handling"
66 "test_export_alias"
67 "test_export_introspection"
68 "test_export_unexport"
69 "test_fast_disconnect"
70 "test_glib_big_message"
71 "test_high_level_service_fd_passing"
72 "test_interface_add_remove_signal"
73 "test_introspectable_interface"
74 "test_methods"
75 "test_multiple_flags_in_message"
76 "test_name_requests"
77 "test_object_manager"
78 "test_peer_interface"
79 "test_property_changed_signal"
80 "test_property_changed_signal"
81 "test_property_methods"
82 "test_sending_file_descriptor_low_level"
83 "test_sending_file_descriptor_with_proxy"
84 "test_sending_messages_between_buses"
85 "test_sending_signals_between_buses"
86 "test_signals"
87 "test_standard_interface_properties"
88 "test_standard_interfaces"
89 "test_tcp_connection_with_forwarding"
90 "test_unexpected_disconnect"
91 # NameError: name '_cast_uint32_native' is not defined
92 "test_unmarshall_bluez_interfaces_added_message"
93 "test_unmarshall_bluez_interfaces_removed_message"
94 "test_unmarshall_bluez_message"
95 "test_unmarshall_bluez_properties_changed_with_service_data"
96 "test_unmarshall_can_resume"
97 "test_unmarshalling_with_table"
98 "test_ay_buffer"
99 ];
100
101 meta = with lib; {
102 description = "Faster version of dbus-next";
103 homepage = "https://github.com/bluetooth-devices/dbus-fast";
104 changelog = "https://github.com/Bluetooth-Devices/dbus-fast/releases/tag/v${version}";
105 license = licenses.mit;
106 maintainers = with maintainers; [ fab ];
107 };
108}