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