Skip to contentSkip to conversation

python3-dbus: re-add recipe with latest patches and add ptest

PATCH Superseded Derek Straka 1 participant 1 message Mar 22, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 python3-dbus: re-add recipe with latest patches and add ptest

The python3-dbus package was removed in (dac933e). While the upstream project isn't active, other distributions (e.g. Fedora, Debian, etc) continue to offer the package and apply patches to resolve reported issues.

While other packages offer similar functionality (e.g. dasbus), they are not drop in replacements and the general dbus functionality works out of the box. The python package has accomplished it's goal of providing useful functionality, and the proposal is to continue to have it available in meta-python for use.

---
 .../ptest-packagelists-meta-python.inc        |   1 +
 .../packagegroups/packagegroup-meta-python.bb |   1 +
 ...ttribute-conforming-to-introspect.dt.patch |  38 ++
 .../0002-Support-asynchronous-calls-58.patch  | 204 ++++++++
 ...mation-between-D-Bus-errors-and-exce.patch | 493 ++++++++++++++++++
 .../python/python3-pydbus/run-ptest           |  15 +
 .../python/python3-pydbus_0.6.0.bb            |  26 +
 7 files changed, 778 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pydbus/0001-make-direction-attribute-conforming-to-introspect.dt.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-pydbus/0002-Support-asynchronous-calls-58.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-pydbus/0003-Support-transformation-between-D-Bus-errors-and-exce.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-pydbus/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-pydbus_0.6.0.bb
meta-python/conf/include/ptest-packagelists-meta-python.inc +1 -0
index 447e0b938..ec26f768e 100644
@@ -53,6 +53,7 @@ PTESTS_FAST_META_PYTHON = "\
     python3-pytest-mock \
     python3-pytoml \
     python3-pyyaml-include \
+    python3-pydbus \
     python3-rapidjson \
     python3-requests-file \
     python3-requests-toolbelt \
meta-python/recipes-core/packagegroups/packagegroup-meta-python.bb +1 -0
index eb5a26463..e0446da28 100644
@@ -311,6 +311,7 @@ RDEPENDS:packagegroup-meta-python3 = "\
     python3-pycodestyle \
     python3-pyconnman \
     python3-pycurl \
+    python3-pydbus \
     python3-pydicti \
     python3-pyephem \
     python3-pyexpect \
meta-python/recipes-devtools/python/python3-pydbus/0001-make-direction-attribute-conforming-to-introspect.dt.patch new file +38 -0
new file mode 100644
index 000000000..e1162f0ca
@@ -0,0 +1,38 @@
+From 5fe65a35e0e7106347639f0258206fadb451c439 Mon Sep 17 00:00:00 2001
+From: Hiroaki KAWAI <[email protected]>
+Date: Wed, 1 Feb 2017 18:00:33 +0900
+Subject: [PATCH 1/3] make direction attribute conforming to introspect.dtd
+
+direction attribute defaults to "in" as
+in the DTD(*1), direction attribute is defined as following:
+
+```
+<!ATTRLIST arg direction (in|out) "in">
+```
+
+*1) http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd
+
+Upstream-Status: Inactive-Upstream [https://src.fedoraproject.org/cgit/rpms/python-pydbus.git/]
+
+Signed-off-by: Derek Straka <[email protected]>
+---
+ pydbus/proxy_method.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pydbus/proxy_method.py b/pydbus/proxy_method.py
+index 8798edd..3e6e6ee 100644
+--- a/pydbus/proxy_method.py
++++ b/pydbus/proxy_method.py
+@@ -33,8 +33,8 @@ class ProxyMethod(object):
+ 		self.__name__ = method.attrib["name"]
+ 		self.__qualname__ = self._iface_name + "." + self.__name__
+ 
+-		self._inargs  = [(arg.attrib.get("name", ""), arg.attrib["type"]) for arg in method if arg.tag == "arg" and arg.attrib["direction"] == "in"]
+-		self._outargs = [arg.attrib["type"] for arg in method if arg.tag == "arg" and arg.attrib["direction"] == "out"]
++		self._inargs  = [(arg.attrib.get("name", ""), arg.attrib["type"]) for arg in method if arg.tag == "arg" and arg.attrib.get("direction", "in") == "in"]
++		self._outargs = [arg.attrib["type"] for arg in method if arg.tag == "arg" and arg.attrib.get("direction", "in") == "out"]
+ 		self._sinargs  = "(" + "".join(x[1] for x in self._inargs) + ")"
+ 		self._soutargs = "(" + "".join(self._outargs) + ")"
+ 
+-- 
+2.13.5
meta-python/recipes-devtools/python/python3-pydbus/0002-Support-asynchronous-calls-58.patch new file +204 -0

204 lines not on this page · raw message

meta-python/recipes-devtools/python/python3-pydbus/0003-Support-transformation-between-D-Bus-errors-and-exce.patch new file +493 -0

493 lines not on this page · raw message

meta-python/recipes-devtools/python/python3-pydbus/run-ptest new file +15 -0
new file mode 100644
index 000000000..782ceed3b
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+for case in `find tests -type f -name '*.sh'`; do
+    bash $case python3 >$case.output 2>&1
+    ret=$?
+    if [ $ret -ne 0 ]; then
+        cat $case.output
+        echo "FAIL: ${case}"
+    elif grep -i 'SKIP' $case.output; then
+        echo "SKIP: ${case}"
+    else
+        echo "PASS: ${case}"
+    fi
+    rm -f $case.output
+done
\ No newline at end of file
meta-python/recipes-devtools/python/python3-pydbus_0.6.0.bb new file +26 -0
new file mode 100644
index 000000000..ac9b8e8ab
@@ -0,0 +1,26 @@
+DESCRIPTION = "Pythonic DBus library"
+HOMEPAGE = "https://pypi.python.org/pypi/pydbus/"
+LICENSE = "LGPL-2.1-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a916467b91076e631dd8edb7424769c7"
+
+SRCREV = "f2e6355a88351e7d644ccb2b4d67b19305507312"
+SRC_URI = " \
+    git://github.com/LEW21/pydbus.git;protocol=https;branch=master \
+    file://0001-make-direction-attribute-conforming-to-introspect.dt.patch \
+    file://0002-Support-asynchronous-calls-58.patch \
+    file://0003-Support-transformation-between-D-Bus-errors-and-exce.patch \
+    file://run-ptest \
+"
+
+inherit ptest setuptools3
+
+S = "${WORKDIR}/git"
+
+RDEPENDS:${PN} = "${PYTHON_PN}-pygobject \
+                  ${PYTHON_PN}-io \
+                  ${PYTHON_PN}-logging"
+
+do_install_ptest() {
+        install -d ${D}${PTEST_PATH}/tests
+        cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
\ No newline at end of file
Signature · 1 line
2.34.1