Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / python-dbusmock / default.nix
blob2a676f72832e2f7b4f9244eadef6eb0ee2fafbf0
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , nose
5 , dbus
6 , dbus-python
7 , pygobject3
8 , bluez
9 , networkmanager
10 , setuptools-scm
11 , runCommand
14 let
15   # Cannot just add it to path in preCheck since that attribute will be passed to
16   # mkDerivation even with doCheck = false, causing a dependency cycle.
17   pbap-client = runCommand "pbap-client" { } ''
18     mkdir -p "$out/bin"
19     ln -s "${bluez.test}/test/pbap-client" "$out/bin/pbap-client"
20   '';
21 in buildPythonPackage rec {
22   pname = "python-dbusmock";
23   version = "0.31.1";
24   format = "setuptools";
26   src = fetchFromGitHub {
27     owner = "martinpitt";
28     repo = pname;
29     rev = "refs/tags/${version}";
30     hash = "sha256-DdV78o089Jkc7mSsGvlJgVpv8kPpMILo7lC6EbLxkxg=";
31   };
33   nativeBuildInputs = [
34     setuptools-scm
35   ];
37   propagatedBuildInputs = [
38     dbus-python
39   ];
41   nativeCheckInputs = [
42     dbus
43     pygobject3
44     bluez
45     pbap-client
46     networkmanager
47     nose
48   ];
50   # TODO: Get the rest of these tests running?
51   NOSE_EXCLUDE = lib.concatStringsSep "," [
52     "test_bluez4" # NixOS ships BlueZ5
53     # These appear to fail because they're expecting to run in an Ubuntu chroot?
54     "test_everything" # BlueZ5 OBEX
55     "test_polkitd"
56     "test_consolekit"
57     "test_api"
58     "test_logind"
59     "test_notification_daemon"
60     "test_ofono"
61     "test_gnome_screensaver"
62     "test_cli"
63     "test_timedated"
64     "test_upower"
65     # needs glib
66     "test_accounts_service"
67     # needs dbus-daemon active
68     "test_systemd"
69     # Very slow, consider disabling?
70     # "test_networkmanager"
71   ];
73   checkPhase = ''
74     runHook preCheck
75     nosetests -v
76     runHook postCheck
77   '';
79   meta = with lib; {
80     description = "Mock D-Bus objects for tests";
81     homepage = "https://github.com/martinpitt/python-dbusmock";
82     license = licenses.lgpl3Plus;
83     maintainers = with maintainers; [ callahad ];
84     platforms = platforms.linux;
85   };