Skip to contentSkip to conversation

package/python-sdbus-systemd: new package

PATCH Superseded Marcus Hoffmann 2 participants 4 messages Nov 20, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/python-sdbus-systemd: new package

---
 DEVELOPERS                                         |  3 +++
 package/Config.in                                  |  1 +
 package/python-sdbus-systemd/Config.in             | 11 +++++++++++
 .../python-sdbus-systemd/python-sdbus-systemd.hash |  5 +++++
 .../python-sdbus-systemd/python-sdbus-systemd.mk   | 14 ++++++++++++++
 .../tests/package/sample_python_sdbus_systemd.py   | 11 +++++++++++
 .../tests/package/test_python_sdbus_systemd.py     | 14 ++++++++++++++
 7 files changed, 59 insertions(+)
 create mode 100644 package/python-sdbus-systemd/Config.in
 create mode 100644 package/python-sdbus-systemd/python-sdbus-systemd.hash
 create mode 100644 package/python-sdbus-systemd/python-sdbus-systemd.mk
 create mode 100644 support/testing/tests/package/sample_python_sdbus_systemd.py
 create mode 100644 support/testing/tests/package/test_python_sdbus_systemd.py
DEVELOPERS +3 -0
index 0272b4ba33..b9e7e12a86 100644
@@ -2273,6 +2273,7 @@ F:	package/python-ruamel-yaml-clib/
 F:	package/python-typing-inspection/
 F:	package/python-tzlocal/
 F:	package/python-sdbus-modemmanager/
+F:	package/python-sdbus-systemd/
 F:	package/python-waitress/
 F:	package/python-whitenoise/
 F:	support/testing/tests/package/test_python_apscheduler.py
@@ -2283,6 +2284,7 @@ F:	support/testing/tests/package/test_python_pydantic.py
 F:	support/testing/tests/package/test_python_pydantic_settings.py
 F:	support/testing/tests/package/test_python_ruamel_yaml.py
 F:	support/testing/tests/package/test_python_sdbus_modemmanager.py
+F:	support/testing/tests/package/test_python_sdbus_systemd.py
 F:	support/testing/tests/package/test_python_tzlocal.py
 F:	support/testing/tests/package/test_python_waitress.py
 F:	support/testing/tests/package/test_python_whitenoise.py
@@ -2294,6 +2296,7 @@ F:	support/testing/tests/package/sample_python_pydantic.py
 F:	support/testing/tests/package/sample_python_pydantic_settings.py
 F:	support/testing/tests/package/sample_python_ruamel_yaml.py
 F:	support/testing/tests/package/sample_python_sdbus_modemmanager.py
+F:	support/testing/tests/package/sample_python_sdbus_systemd.py
 
 N:	Marek Belisko <[email protected]>
 F:	package/libatasmart/
package/Config.in +1 -0
index 12f327cb27..1cd4a64290 100644
@@ -1385,6 +1385,7 @@ menu "External python modules"
 	source "package/python-sdbus/Config.in"
 	source "package/python-sdbus-modemmanager/Config.in"
 	source "package/python-sdbus-networkmanager/Config.in"
+	source "package/python-sdbus-systemd/Config.in"
 	source "package/python-sdnotify/Config.in"
 	source "package/python-secretstorage/Config.in"
 	source "package/python-see/Config.in"
package/python-sdbus-systemd/Config.in new file +11 -0
new file mode 100644
index 0000000000..0244f4dc0f
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_SDBUS_SYSTEMD
+	bool "python-sdbus-systemd"
+	depends on BR2_PACKAGE_SYSTEMD
+	select BR2_PACKAGE_PYTHON_SDBUS # runtime
+	help
+	  Systemd bindings for python-sdbus.
+
+	  https://github.com/bernhardkaindl/python-sdbus-systemd
+
+comment "python-sdbus-systemd needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
package/python-sdbus-systemd/python-sdbus-systemd.hash new file +5 -0
new file mode 100644
index 0000000000..31eb2a0c64
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/sdbus-modemmanager/json
+md5  726a016b518e3ac47fde0e51b751b6b0  sdbus-systemd-1.0.0.tar.gz
+sha256  80aef69a69685ac7807ba1cc7db48e10e59104260beda1deef6cd5f81e1ad297  sdbus-systemd-1.0.0.tar.gz
+# Locally computed sha256 checksums
+sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LESSER
package/python-sdbus-systemd/python-sdbus-systemd.mk new file +14 -0
new file mode 100644
index 0000000000..0599d2794a
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-sdbus-systemd
+#
+################################################################################
+
+PYTHON_SDBUS_SYSTEMD_VERSION = 1.0.0
+PYTHON_SDBUS_SYSTEMD_SOURCE = sdbus-systemd-$(PYTHON_SDBUS_SYSTEMD_VERSION).tar.gz
+PYTHON_SDBUS_SYSTEMD_SITE = https://files.pythonhosted.org/packages/e1/84/911de0ea63a0dab814dc94f73e7b916bfd4675e1e983b58a725a26a65db4
+PYTHON_SDBUS_SYSTEMD_SETUP_TYPE = setuptools
+PYTHON_SDBUS_SYSTEMD_LICENSE = LGPL-2.1+
+PYTHON_SDBUS_SYSTEMD_LICENSE_FILES = COPYING.LESSER
+
+$(eval $(python-package))
support/testing/tests/package/sample_python_sdbus_systemd.py new file +11 -0
new file mode 100644
index 0000000000..6cb1925ac3
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import sdbus
+
+from sdbus_block.systemd.objects import Systemd, SystemdUnit
+
+sdbus.set_default_bus(sdbus.sd_bus_open_system())
+unit_object_path = Systemd().load_unit("systemd-journald.service")
+unit = SystemdUnit(unit_object_path)
+
+assert unit.active_enter_timestamp != None
support/testing/tests/package/test_python_sdbus_systemd.py new file +14 -0
new file mode 100644
index 0000000000..9e97df6465
@@ -0,0 +1,14 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3SdbusSystemd(TestPythonPackageBase):
+    __test__ = True
+    config = (
+        TestPythonPackageBase.config
+        + """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_INIT_SYSTEMD=y
+        BR2_PACKAGE_PYTHON_SDBUS_SYSTEMD=y
+        """
+    )
+    sample_scripts = ["tests/package/sample_python_sdbus_systemd.py"]
Signature · 6 lines
2.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 3/3 support/testing: fix test_python_sdbus_modemmanager

The test currently fails because kbd fails to compile but this is unrelated to the actual package being tested. We can work around this by disabling systemd-vconsole which pulls in kbd.

---
 support/testing/tests/package/test_python_sdbus_modemmanager.py | 1 +
 1 file changed, 1 insertion(+)
support/testing/tests/package/test_python_sdbus_modemmanager.py +1 -0
index 58e02f99ef..736c34b724 100644
@@ -8,6 +8,7 @@ class TestPythonPy3SdbusModemmanager(TestPythonPackageBase):
         + """
         BR2_PACKAGE_PYTHON3=y
         BR2_INIT_SYSTEMD=y
+        # BR2_PACKAGE_SYSTEMD_VCONSOLE is not set
         BR2_PACKAGE_MODEM_MANAGER=y
         BR2_PACKAGE_PYTHON_SDBUS_MODEMMANAGER=y
         """
Signature · 6 lines
2.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

PATCH 2/3 support/testing: fix SdbusModemmanager/SdbusNetworkmanager duplicate test name

In reply to Marcus Hoffmann
---
 support/testing/tests/package/test_python_sdbus_modemmanager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/testing/tests/package/test_python_sdbus_modemmanager.py +1 -1
index 34ab66e3bf..58e02f99ef 100644
@@ -1,7 +1,7 @@
 from tests.package.test_python import TestPythonPackageBase
 
 
-class TestPythonPy3SdbusNetworkmanager(TestPythonPackageBase):
+class TestPythonPy3SdbusModemmanager(TestPythonPackageBase):
     __test__ = True
     config = (
         TestPythonPackageBase.config
Signature · 6 lines
2.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Marcus Hoffmann

Forgot the sign-off. So adding that here for the whole series:

Quoted 130 lines · Marcus Hoffmann
---
  DEVELOPERS                                         |  3 +++
  package/Config.in                                  |  1 +
  package/python-sdbus-systemd/Config.in             | 11 +++++++++++
  .../python-sdbus-systemd/python-sdbus-systemd.hash |  5 +++++
  .../python-sdbus-systemd/python-sdbus-systemd.mk   | 14 ++++++++++++++
  .../tests/package/sample_python_sdbus_systemd.py   | 11 +++++++++++
  .../tests/package/test_python_sdbus_systemd.py     | 14 ++++++++++++++
  7 files changed, 59 insertions(+)

create mode 100644 package/python-sdbus-systemd/Config.in
create mode 100644 package/python-sdbus-systemd/python-sdbus-systemd.hash create mode 100644 package/python-sdbus-systemd/python-sdbus-systemd.mk create mode 100644 support/testing/tests/package/sample_python_sdbus_systemd.py create mode 100644 support/testing/tests/package/test_python_sdbus_systemd.py

DEVELOPERS +3 -0
index 0272b4ba33..b9e7e12a86 100644
@@ -2273,6 +2273,7 @@ F:	package/python-ruamel-yaml-clib/
  F:	package/python-typing-inspection/
  F:	package/python-tzlocal/
  F:	package/python-sdbus-modemmanager/
+F:	package/python-sdbus-systemd/
  F:	package/python-waitress/
  F:	package/python-whitenoise/
  F:	support/testing/tests/package/test_python_apscheduler.py
@@ -2283,6 +2284,7 @@ F:	support/testing/tests/package/test_python_pydantic.py
  F:	support/testing/tests/package/test_python_pydantic_settings.py
  F:	support/testing/tests/package/test_python_ruamel_yaml.py
  F:	support/testing/tests/package/test_python_sdbus_modemmanager.py
+F:	support/testing/tests/package/test_python_sdbus_systemd.py
  F:	support/testing/tests/package/test_python_tzlocal.py
  F:	support/testing/tests/package/test_python_waitress.py
  F:	support/testing/tests/package/test_python_whitenoise.py
@@ -2294,6 +2296,7 @@ F:	support/testing/tests/package/sample_python_pydantic.py
  F:	support/testing/tests/package/sample_python_pydantic_settings.py
  F:	support/testing/tests/package/sample_python_ruamel_yaml.py
  F:	support/testing/tests/package/sample_python_sdbus_modemmanager.py
+F:	support/testing/tests/package/sample_python_sdbus_systemd.py
 
  N:	Marek Belisko <[email protected]>
  F:	package/libatasmart/
package/Config.in +1 -0
index 12f327cb27..1cd4a64290 100644
@@ -1385,6 +1385,7 @@ menu "External python modules"
  	source "package/python-sdbus/Config.in"
  	source "package/python-sdbus-modemmanager/Config.in"
  	source "package/python-sdbus-networkmanager/Config.in"
+	source "package/python-sdbus-systemd/Config.in"
  	source "package/python-sdnotify/Config.in"
  	source "package/python-secretstorage/Config.in"
  	source "package/python-see/Config.in"
package/python-sdbus-systemd/Config.in new file +11 -0
new file mode 100644
index 0000000000..0244f4dc0f
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_SDBUS_SYSTEMD
+	bool "python-sdbus-systemd"
+	depends on BR2_PACKAGE_SYSTEMD
+	select BR2_PACKAGE_PYTHON_SDBUS # runtime
+	help
+	  Systemd bindings for python-sdbus.
+
+	  https://github.com/bernhardkaindl/python-sdbus-systemd
+
+comment "python-sdbus-systemd needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
package/python-sdbus-systemd/python-sdbus-systemd.hash new file +5 -0
new file mode 100644
index 0000000000..31eb2a0c64
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/sdbus-modemmanager/json
+md5  726a016b518e3ac47fde0e51b751b6b0  sdbus-systemd-1.0.0.tar.gz
+sha256  80aef69a69685ac7807ba1cc7db48e10e59104260beda1deef6cd5f81e1ad297  sdbus-systemd-1.0.0.tar.gz
+# Locally computed sha256 checksums
+sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LESSER
package/python-sdbus-systemd/python-sdbus-systemd.mk new file +14 -0
new file mode 100644
index 0000000000..0599d2794a
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-sdbus-systemd
+#
+################################################################################
+
+PYTHON_SDBUS_SYSTEMD_VERSION = 1.0.0
+PYTHON_SDBUS_SYSTEMD_SOURCE = sdbus-systemd-$(PYTHON_SDBUS_SYSTEMD_VERSION).tar.gz
+PYTHON_SDBUS_SYSTEMD_SITE = https://files.pythonhosted.org/packages/e1/84/911de0ea63a0dab814dc94f73e7b916bfd4675e1e983b58a725a26a65db4
+PYTHON_SDBUS_SYSTEMD_SETUP_TYPE = setuptools
+PYTHON_SDBUS_SYSTEMD_LICENSE = LGPL-2.1+
+PYTHON_SDBUS_SYSTEMD_LICENSE_FILES = COPYING.LESSER
+
+$(eval $(python-package))
support/testing/tests/package/sample_python_sdbus_systemd.py new file +11 -0
new file mode 100644
index 0000000000..6cb1925ac3
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+
+import sdbus
+
+from sdbus_block.systemd.objects import Systemd, SystemdUnit
+
+sdbus.set_default_bus(sdbus.sd_bus_open_system())
+unit_object_path = Systemd().load_unit("systemd-journald.service")
+unit = SystemdUnit(unit_object_path)
+
+assert unit.active_enter_timestamp != None
support/testing/tests/package/test_python_sdbus_systemd.py new file +4 -0
new file mode 100644
index 0000000000..9e97df6465
@@ -0,0 +1,14 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3SdbusSystemd(TestPythonPackageBase):

support/testing/tests/package/test_python_sdbus_systemd.py line 14

Quoted 10 lines
support/testing/tests/package/test_python_sdbus_systemd.py new file +10 -0
+    __test__ = True
+    config = (
+        TestPythonPackageBase.config
+        + """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_INIT_SYSTEMD=y
+        BR2_PACKAGE_PYTHON_SDBUS_SYSTEMD=y
+        """
+    )
+    sample_scripts = ["tests/package/sample_python_sdbus_systemd.py"]

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot