From 611c110bf5d5de986daf1a6db80c4c28702266e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Wed, 11 Oct 2023 20:50:18 +0200 Subject: [PATCH] Remove unused dbus dependency --- Makefile | 6 +----- doc/md/installation.md | 6 +----- docker/mypy.docker | 1 - docker/pep8.docker | 1 - docker/pytest_centos_stream8.docker | 1 - docker/pytest_debian_bullseye.docker | 1 - docker/pytest_debian_buster.docker | 1 - docker/pytest_fedora_36.docker | 1 - eduvpn/nm.py | 27 --------------------------- setup.py | 1 - 10 files changed, 2 insertions(+), 44 deletions(-) diff --git a/Makefile b/Makefile index 143ae59d..5a2b6db0 100644 --- a/Makefile +++ b/Makefile @@ -40,12 +40,10 @@ deb: gir1.2-gtk-3.0 \ gir1.2-notify-0.7 \ libgirepository1.0-dev \ - libdbus-glib-1-dev \ python3-gi \ python3-setuptools \ python3-pytest \ python3-wheel \ - python3-dbus \ network-manager-openvpn-gnome # install all required binary packages on a rpm based system @@ -54,13 +52,11 @@ dnf: libnotify \ libsecret \ gtk3 \ - python3-dbus \ python3-gobject \ python3-pytest \ python3-cairo-devel \ gobject-introspection-devel \ - cairo-gobject-devel \ - dbus-python-devel + cairo-gobject-devel doc: $(VENV)/ $(VENV)/bin/pip install -r doc/requirements.txt diff --git a/doc/md/installation.md b/doc/md/installation.md index 5d93a612..79f8977b 100644 --- a/doc/md/installation.md +++ b/doc/md/installation.md @@ -157,12 +157,10 @@ $ sudo apt install \ gir1.2-gtk-3.0 \ gir1.2-notify-0.7 \ libgirepository1.0-dev \ - libdbus-glib-1-dev \ python3-gi \ python3-setuptools \ python3-pytest \ python3-wheel \ - python3-dbus \ network-manager-openvpn-gnome ``` @@ -173,13 +171,11 @@ $ sudo dnf install \ libnotify \ libsecret \ gtk3 \ - python3-dbus \ python3-gobject \ python3-pytest \ python3-cairo-devel \ gobject-introspection-devel \ - cairo-gobject-devel \ - dbus-python-devel + cairo-gobject-devel ``` #### Pip commands diff --git a/docker/mypy.docker b/docker/mypy.docker index 60b63279..d16ceb80 100644 --- a/docker/mypy.docker +++ b/docker/mypy.docker @@ -8,7 +8,6 @@ RUN docker-apt-install \ libnotify4 \ python3-gi \ python3-nacl \ - python3-dbus \ python3-requests-oauthlib \ python3-pip \ python3-venv \ diff --git a/docker/pep8.docker b/docker/pep8.docker index aa4b0139..c98503da 100644 --- a/docker/pep8.docker +++ b/docker/pep8.docker @@ -7,7 +7,6 @@ RUN docker-apt-install \ gir1.2-nm-1.0 \ libnotify4 \ python3-gi \ - python3-dbus \ python3-requests-oauthlib \ python3-pip \ python3-pytest \ diff --git a/docker/pytest_centos_stream8.docker b/docker/pytest_centos_stream8.docker index 570688ff..2a650d22 100644 --- a/docker/pytest_centos_stream8.docker +++ b/docker/pytest_centos_stream8.docker @@ -12,7 +12,6 @@ RUN dnf install -y \ python3-gobject \ python3-pytest \ python3-cryptography \ - python3-dbus \ NetworkManager-libnm ADD docker/docker-dnf-install-common /usr/local/bin/docker-dnf-install-common diff --git a/docker/pytest_debian_bullseye.docker b/docker/pytest_debian_bullseye.docker index e12f5876..b8a1f56a 100644 --- a/docker/pytest_debian_bullseye.docker +++ b/docker/pytest_debian_bullseye.docker @@ -13,7 +13,6 @@ RUN docker-apt-install \ python3-nacl \ python3-pytest \ python3-pip \ - python3-dbus \ pkg-config \ libcairo2-dev \ build-essential \ diff --git a/docker/pytest_debian_buster.docker b/docker/pytest_debian_buster.docker index e0e17045..a4d8aef4 100644 --- a/docker/pytest_debian_buster.docker +++ b/docker/pytest_debian_buster.docker @@ -12,7 +12,6 @@ RUN docker-apt-install \ python3-setuptools \ python3-nacl \ python3-pytest \ - python3-dbus \ pkg-config \ libcairo2-dev \ build-essential \ diff --git a/docker/pytest_fedora_36.docker b/docker/pytest_fedora_36.docker index cb69e6e7..a5656225 100644 --- a/docker/pytest_fedora_36.docker +++ b/docker/pytest_fedora_36.docker @@ -8,7 +8,6 @@ RUN dnf install -y \ python3-pytest \ python3-pynacl \ python3-cryptography \ - python3-dbus \ python3-pip \ python3-wheel \ NetworkManager-libnm diff --git a/eduvpn/nm.py b/eduvpn/nm.py index b77ec672..ed40ee1d 100644 --- a/eduvpn/nm.py +++ b/eduvpn/nm.py @@ -35,11 +35,6 @@ _logger.warning("Network Manager not available") NM = None -try: - import dbus -except ImportError: - dbus = None - class ConnectionState(enum.Enum): CONNECTING = enum.auto() @@ -754,28 +749,6 @@ def connection_status( return uuid, status -@lru_cache(maxsize=1) -def get_dbus() -> Optional["dbus.SystemBus"]: - """ - Get the DBus system bus. - - None is returned on failure. - """ - if dbus is None: - logging.debug("DBus module could not be imported") - return None - try: - from dbus.mainloop.glib import DBusGMainLoop - - DBusGMainLoop(set_as_default=True) - bus = dbus.SystemBus(private=True) - except Exception: - logging.debug("Unable to access dbus", exc_info=True) - return None - else: - return bus - - def action_with_mainloop(action: Callable): _logger.debug("calling action with CLI mainloop") main_loop = GLib.MainLoop() diff --git a/setup.py b/setup.py index e7bba91b..18936cdc 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,6 @@ ] gui_require = [ - 'dbus-python', 'pygobject', ]