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 [
33 dbus
34 pytest
35 pytest-trio
36 pytest-asyncio
37 testpath
38 trio
39 ]
40 ++ lib.optionals (pythonOlder "3.11") [
41 async-timeout
42 ];
43
44 checkPhase = ''
45 runHook preCheck
46
47 dbus-run-session --config-file=${dbus}/share/dbus-1/session.conf -- pytest ${lib.optionalString stdenv.hostPlatform.isDarwin "--ignore=jeepney/io/tests"}
48
49 runHook postCheck
50 '';
51
52 pythonImportsCheck = [
53 "jeepney"
54 "jeepney.auth"
55 "jeepney.io"
56 "jeepney.io.asyncio"
57 "jeepney.io.blocking"
58 "jeepney.io.threading"
59 "jeepney.io.trio"
60 ];
61
62 meta = with lib; {
63 changelog = "https://gitlab.com/takluyver/jeepney/-/blob/${src.tag}/docs/release-notes.rst";
64 homepage = "https://gitlab.com/takluyver/jeepney";
65 description = "Pure Python DBus interface";
66 license = licenses.mit;
67 maintainers = with maintainers; [ dotlambda ];
68 };
69}