From 82a5e222b03ad521adf69dcbd977f1bbc2294ab1 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 23 Feb 2024 07:19:36 +0100 Subject: [PATCH 1/3] pyproject: adjust to new ruff settings layout --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e1ae523c..302fc85a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ ignore_missing_imports = true line-length = 130 preview = true +[tool.ruff.lint] select = [ "A", # flake8-builtins "B", # flake8-bugbear From 53c0ec3bac4b04b7241ecdc82f0c937359e25efb Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 23 Feb 2024 07:42:01 +0100 Subject: [PATCH 2/3] power_profiles_daemon: Move to org.freedesktop.UPower.PowerProfiles Version 0.20 moved to D-Bus name `org.freedesktop.UPower.PowerProfiles`, and corresponding changes to the object path/interface: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/releases/0.20 The real daemon also still listens to the old name, but we can't do that in dbusmock: BUS_NAME and friends cannot be parameterized, as their loading and instantiation happens before calling the `load()` function. `powerprofilesctl` now only looks at the new name, so we need to adjust the template. The new version is in Fedora 39 to rawhide and also in Debian testing, so for ongoing development it's more useful to present the current API. --- dbusmock/templates/power_profiles_daemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbusmock/templates/power_profiles_daemon.py b/dbusmock/templates/power_profiles_daemon.py index 9211050c..bd863ade 100644 --- a/dbusmock/templates/power_profiles_daemon.py +++ b/dbusmock/templates/power_profiles_daemon.py @@ -15,14 +15,14 @@ __author__ = "Bastien Nocera" __copyright__ = """ (c) 2021, Red Hat Inc. -(c) 2017 - 2022 Martin Pitt +(c) 2017 - 2024 Martin Pitt """ import dbus -BUS_NAME = "net.hadess.PowerProfiles" -MAIN_OBJ = "/net/hadess/PowerProfiles" -MAIN_IFACE = "net.hadess.PowerProfiles" +BUS_NAME = "org.freedesktop.UPower.PowerProfiles" +MAIN_OBJ = "/org/freedesktop/UPower/PowerProfiles" +MAIN_IFACE = "org.freedesktop.UPower.PowerProfiles" SYSTEM_BUS = True From f5c4caa5d49f1bb78b4c3eccae72bcc9b079eb71 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 23 Feb 2024 07:50:20 +0100 Subject: [PATCH 3/3] tests: Run power-profiles-daemon on Debian --- tests/run-debian | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/run-debian b/tests/run-debian index 0db1640b..bcd9456c 100644 --- a/tests/run-debian +++ b/tests/run-debian @@ -16,6 +16,12 @@ eatmydata apt-get install --no-install-recommends -y git \ python3-dbus python3-pytest python3-gi gir1.2-glib-2.0 \ dbus libnotify-bin upower network-manager bluez ofono ofono-scripts +# power-profiles-daemon 0.20 did not yet land in Ubuntu 24.04 +. /etc/os-release +if [ "$ID" = "debian" ]; then + eatmydata apt-get install -y power-profiles-daemon +fi + # systemd's tools otherwise fail on "not been booted with systemd" mkdir -p /run/systemd/system