Skip to content

Commit

Permalink
build: replace dbus_next with dbus_fast
Browse files Browse the repository at this point in the history
The dbus_next dependency is no longer maintained.  Replace
it with dbus_fast, which is a fork and drop in compatible.

Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Jan 12, 2025
1 parent 73ad860 commit fccffa9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
14 changes: 7 additions & 7 deletions moonraker/components/dbus_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import asyncio
import pathlib
import logging
import dbus_next
from dbus_next.aio import MessageBus, ProxyInterface
from dbus_next.constants import BusType
import dbus_fast
from dbus_fast.aio import MessageBus, ProxyInterface
from dbus_fast.constants import BusType

# Annotation imports
from typing import (
Expand All @@ -30,8 +30,8 @@
)

class DbusManager:
Variant = dbus_next.Variant
DbusError = dbus_next.errors.DBusError
Variant = dbus_fast.Variant
DbusError = dbus_fast.errors.DBusError
def __init__(self, config: ConfigHelper) -> None:
self.server = config.get_server()
self.bus: Optional[MessageBus] = None
Expand All @@ -46,8 +46,8 @@ def __init__(self, config: ConfigHelper) -> None:
self.polkit_subject = [
"unix-process",
{
"pid": dbus_next.Variant("u", os.getpid()),
"start-time": dbus_next.Variant("t", start_clk_ticks)
"pid": dbus_fast.Variant("u", os.getpid()),
"start-time": dbus_fast.Variant("t", start_clk_ticks)
}
]

Expand Down
4 changes: 2 additions & 2 deletions moonraker/components/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
from .announcements import Announcements
from .proc_stats import ProcStats
from .dbus_manager import DbusManager
from dbus_next.aio.proxy_object import ProxyInterface
from dbus_next.signature import Variant
from dbus_fast.aio.proxy_object import ProxyInterface
from dbus_fast.signature import Variant
SudoReturn = Union[Awaitable[Tuple[str, bool]], Tuple[str, bool]]
SudoCallback = Callable[[], SudoReturn]

Expand Down
4 changes: 2 additions & 2 deletions moonraker/components/update_manager/system_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from ..dbus_manager import DbusManager
from ..machine import Machine
from .update_manager import CommandHelper
from dbus_next import Variant
from dbus_next.aio import ProxyInterface
from dbus_fast import Variant
from dbus_fast.aio import ProxyInterface
JsonType = Union[List[Any], Dict[str, Any]]


Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ dependencies = [
"zeroconf==0.131.0",
"preprocess-cancellation==0.2.1",
"jinja2==3.1.4",
"dbus-next==0.2.3",
"dbus-fast==2.28.0 ; python_version>='3.9'",
"dbus-fast<=2.28.0 ; python_version<'3.9'",
"apprise==1.8.0",
"ldap3==2.9.1",
"python-periphery==2.4.1",
Expand Down
3 changes: 2 additions & 1 deletion scripts/moonraker-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ paho-mqtt==1.6.1
zeroconf==0.131.0
preprocess-cancellation==0.2.1
jinja2==3.1.4
dbus-next==0.2.3
dbus-fast==2.28.0 ; python_version>='3.9'
dbus-fast<=2.28.0 ; python_version<'3.9'
apprise==1.8.0
ldap3==2.9.1
python-periphery==2.4.1
Expand Down

0 comments on commit fccffa9

Please sign in to comment.