Skip to content

Commit

Permalink
Remove unused dbus dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
André Apitzsch committed Oct 11, 2023
1 parent 6f2c93f commit 611c110
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 44 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 1 addition & 5 deletions doc/md/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion docker/mypy.docker
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN docker-apt-install \
libnotify4 \
python3-gi \
python3-nacl \
python3-dbus \
python3-requests-oauthlib \
python3-pip \
python3-venv \
Expand Down
1 change: 0 additions & 1 deletion docker/pep8.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion docker/pytest_centos_stream8.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docker/pytest_debian_bullseye.docker
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ RUN docker-apt-install \
python3-nacl \
python3-pytest \
python3-pip \
python3-dbus \
pkg-config \
libcairo2-dev \
build-essential \
Expand Down
1 change: 0 additions & 1 deletion docker/pytest_debian_buster.docker
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ RUN docker-apt-install \
python3-setuptools \
python3-nacl \
python3-pytest \
python3-dbus \
pkg-config \
libcairo2-dev \
build-essential \
Expand Down
1 change: 0 additions & 1 deletion docker/pytest_fedora_36.docker
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN dnf install -y \
python3-pytest \
python3-pynacl \
python3-cryptography \
python3-dbus \
python3-pip \
python3-wheel \
NetworkManager-libnm
Expand Down
27 changes: 0 additions & 27 deletions eduvpn/nm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
]

gui_require = [
'dbus-python',
'pygobject',
]

Expand Down

0 comments on commit 611c110

Please sign in to comment.