1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitLab,
6 pythonOlder,
7 flit-core,
8 async-timeout,
9 dbus,
10 pytest,
11 pytest-trio,
12 pytest-asyncio,
13 testpath,
14 trio,
15}:
16
17buildPythonPackage rec {
18 pname = "jeepney";
19 version = "0.9";
20 pyproject = true;
21
22 src = fetchFromGitLab {
23 owner = "takluyver";
24 repo = "jeepney";
25 tag = version;
26 hash = "sha256-d8w/4PtDviTYDHO4EwaVbxlYk7CXtlv7vuR+o4LhfRs=";
27 };
28
29 build-system = [ flit-core ];
30
31 nativeCheckInputs = [
32 dbus
33 pytest
34 pytest-trio
35 pytest-asyncio
36 testpath
37 trio
38 ]
39 ++ lib.optionals (pythonOlder "3.11") [
40 async-timeout
41 ];
42
43 checkPhase = ''
44 runHook preCheck
45
46 dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf -- pytest ${lib.optionalString stdenv.hostPlatform.isDarwin "--ignore=jeepney/io/tests"}
47
48 runHook postCheck
49 '';
50
51 pythonImportsCheck = [
52 "jeepney"
53 "jeepney.auth"
54 "jeepney.io"
55 "jeepney.io.asyncio"
56 "jeepney.io.blocking"
57 "jeepney.io.threading"
58 "jeepney.io.trio"
59 ];
60
61 meta = with lib; {
62 changelog = "https://gitlab.com/takluyver/jeepney/-/blob/${src.tag}/docs/release-notes.rst";
63 homepage = "https://gitlab.com/takluyver/jeepney";
64 description = "Pure Python DBus interface";
65 license = licenses.mit;
66 maintainers = with maintainers; [ dotlambda ];
67 };
68}