1{ stdenv
2, lib
3, buildPythonPackage
4, fetchFromGitHub
5, python
6, dbus, pytest, pytest-cov, pytest-asyncio, pytest-timeout
7}:
8
9buildPythonPackage rec {
10 pname = "dbus-next";
11 version = "0.2.3";
12
13 src = fetchFromGitHub {
14 owner = "altdesktop";
15 repo = "python-dbus-next";
16 rev = "v${version}";
17 hash = "sha256-EKEQZFRUe+E65Z6DNCJFL5uCI5kbXrN7Tzd4O0X5Cqo=";
18 };
19
20 nativeCheckInputs = [
21 dbus
22 pytest
23 pytest-cov
24 pytest-asyncio
25 pytest-timeout
26 ];
27
28 # test_peer_interface hits a timeout
29 # test_tcp_connection_with_forwarding fails due to dbus
30 # creating unix socket anyway on v1.14.4
31 checkPhase = ''
32 dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf \
33 ${python.interpreter} -m pytest -sv --cov=dbus_next \
34 -k "not test_peer_interface and not test_tcp_connection_with_forwarding"
35 '';
36
37 meta = with lib; {
38 description = "A zero-dependency DBus library for Python with asyncio support";
39 homepage = "https://github.com/altdesktop/python-dbus-next";
40 changelog = "https://github.com/altdesktop/python-dbus-next/releases/tag/v${version}";
41 license = licenses.mit;
42 maintainers = with maintainers; [ sfrijters ];
43 broken = stdenv.isDarwin;
44 };
45}