From patchwork Sun May 9 08:09:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Niestroj X-Patchwork-Id: 1475947 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FdH1Q6BQVz9tlM for ; Sun, 9 May 2021 18:10:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 59FA84047F; Sun, 9 May 2021 08:10:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dpy5rbeTphnt; Sun, 9 May 2021 08:10:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 8B9FB4011B; Sun, 9 May 2021 08:10:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 772681BF35C for ; Sun, 9 May 2021 08:10:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 668974011B for ; Sun, 9 May 2021 08:10:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CXASF3Xg8Gp9 for ; Sun, 9 May 2021 08:10:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.grinn-global.com (mail.grinn-global.com [77.55.128.204]) by smtp2.osuosl.org (Postfix) with ESMTPS id 49BEF40111 for ; Sun, 9 May 2021 08:10:23 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV (21) Received: from zm.localdomain (pub-206.183.29.194.multiplay.pl [194.29.183.206]) by server220076.nazwa.pl (Postfix) with ESMTP id F37031C4445; Sun, 9 May 2021 10:10:19 +0200 (CEST) From: Marcin Niestroj To: buildroot@buildroot.org Date: Sun, 9 May 2021 10:09:50 +0200 Message-Id: <20210509080952.3984565-1-m.niestroj@grinn-global.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] package/python-dbus-next: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcin Niestroj , Asaf Kahlon , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Marcin Niestroj --- DEVELOPERS | 1 + package/Config.in | 1 + package/python-dbus-next/Config.in | 9 +++++++++ package/python-dbus-next/python-dbus-next.hash | 5 +++++ package/python-dbus-next/python-dbus-next.mk | 14 ++++++++++++++ 5 files changed, 30 insertions(+) create mode 100644 package/python-dbus-next/Config.in create mode 100644 package/python-dbus-next/python-dbus-next.hash create mode 100644 package/python-dbus-next/python-dbus-next.mk diff --git a/DEVELOPERS b/DEVELOPERS index bbbb0ecfa8..610fd37e06 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1641,6 +1641,7 @@ F: package/murata-cyw-fw/ F: package/netdata/ F: package/python-ansicolors/ F: package/python-bleak/ +F: package/python-dbus-next/ F: package/python-iniconfig/ F: package/python-intelhex/ F: package/python-packaging/ diff --git a/package/Config.in b/package/Config.in index 82b28d2835..1a8dd8f204 100644 --- a/package/Config.in +++ b/package/Config.in @@ -960,6 +960,7 @@ menu "External python modules" source "package/python-daphne/Config.in" source "package/python-dataproperty/Config.in" source "package/python-dateutil/Config.in" + source "package/python-dbus-next/Config.in" source "package/python-decorator/Config.in" source "package/python-defusedxml/Config.in" source "package/python-dialog/Config.in" diff --git a/package/python-dbus-next/Config.in b/package/python-dbus-next/Config.in new file mode 100644 index 0000000000..bafead8986 --- /dev/null +++ b/package/python-dbus-next/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_PYTHON_DBUS_NEXT + bool "python-dbus-next" + depends on BR2_PACKAGE_PYTHON3 + select BR2_PACKAGE_PYTHON3_PYEXPAT # runtime + help + A zero-dependency DBus library for Python with asyncio + support. + + https://github.com/altdesktop/python-dbus-next diff --git a/package/python-dbus-next/python-dbus-next.hash b/package/python-dbus-next/python-dbus-next.hash new file mode 100644 index 0000000000..fa1cbc9da7 --- /dev/null +++ b/package/python-dbus-next/python-dbus-next.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/dbus-next/json +md5 fcf7443b379ef69f95727bec0221ebc9 dbus_next-0.2.2.tar.gz +sha256 f656a3d3450b670f228248ffb1c3a703a69c4a8cb10cce63b108f17c8bd6c3de dbus_next-0.2.2.tar.gz +# Locally computed sha256 checksums +sha256 c454ab6b8e0653a8eab828a8cbaaa368a1bbfba982178bb18b6177e311eae4cc LICENSE diff --git a/package/python-dbus-next/python-dbus-next.mk b/package/python-dbus-next/python-dbus-next.mk new file mode 100644 index 0000000000..9aab9ac92b --- /dev/null +++ b/package/python-dbus-next/python-dbus-next.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# python-dbus-next +# +################################################################################ + +PYTHON_DBUS_NEXT_VERSION = 0.2.2 +PYTHON_DBUS_NEXT_SOURCE = dbus_next-$(PYTHON_DBUS_NEXT_VERSION).tar.gz +PYTHON_DBUS_NEXT_SITE = https://files.pythonhosted.org/packages/cb/fb/5ab0485c6460e39be75e16af95c0e23c2531c1ac5a482fffb9ee7d576e6f +PYTHON_DBUS_NEXT_SETUP_TYPE = setuptools +PYTHON_DBUS_NEXT_LICENSE = MIT +PYTHON_DBUS_NEXT_LICENSE_FILES = LICENSE + +$(eval $(python-package)) From patchwork Sun May 9 08:09:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Niestroj X-Patchwork-Id: 1475948 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FdH1b6Jy1z9tlM for ; Sun, 9 May 2021 18:10:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F1CE160667; Sun, 9 May 2021 08:10:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1fTBxHqGwDXs; Sun, 9 May 2021 08:10:40 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 46A95606DF; Sun, 9 May 2021 08:10:39 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 849681BF9AD for ; Sun, 9 May 2021 08:10:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 81FAF83A35 for ; Sun, 9 May 2021 08:10:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8BTzrxvqmoqP for ; Sun, 9 May 2021 08:10:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.grinn-global.com (mail.grinn-global.com [77.55.128.204]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4ED3A83A1C for ; Sun, 9 May 2021 08:10:24 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV (21) Received: from zm.localdomain (pub-206.183.29.194.multiplay.pl [194.29.183.206]) by server220076.nazwa.pl (Postfix) with ESMTP id 16A661C482D; Sun, 9 May 2021 10:10:21 +0200 (CEST) From: Marcin Niestroj To: buildroot@buildroot.org Date: Sun, 9 May 2021 10:09:51 +0200 Message-Id: <20210509080952.3984565-2-m.niestroj@grinn-global.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210509080952.3984565-1-m.niestroj@grinn-global.com> References: <20210509080952.3984565-1-m.niestroj@grinn-global.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] support/testing: add python-dbus-next test X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcin Niestroj , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Marcin Niestroj --- DEVELOPERS | 2 + .../tests/package/sample_python_dbus_next.py | 44 +++++++++++++++++++ .../tests/package/test_python_dbus_next.py | 40 +++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 support/testing/tests/package/sample_python_dbus_next.py create mode 100644 support/testing/tests/package/test_python_dbus_next.py diff --git a/DEVELOPERS b/DEVELOPERS index 610fd37e06..b5270e1c7d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1652,9 +1652,11 @@ F: package/python-typing-extensions/ F: package/python-xmodem/ F: package/rs485conf/ F: package/turbolua/ +F: support/testing/tests/package/sample_python_dbus_next.py F: support/testing/tests/package/sample_python_pytest.py F: support/testing/tests/package/sample_python_pytest_asyncio.py F: support/testing/tests/package/test_netdata.py +F: support/testing/tests/package/test_python_dbus_next.py F: support/testing/tests/package/test_python_pytest.py F: support/testing/tests/package/test_python_pytest_asyncio.py diff --git a/support/testing/tests/package/sample_python_dbus_next.py b/support/testing/tests/package/sample_python_dbus_next.py new file mode 100644 index 0000000000..1fcb76f45a --- /dev/null +++ b/support/testing/tests/package/sample_python_dbus_next.py @@ -0,0 +1,44 @@ +import asyncio +from dbus_next.aio import MessageBus +from dbus_next.service import ServiceInterface, method +import dbus_next.introspection as intr +from dbus_next import BusType + + +class SampleInterface(ServiceInterface): + def __init__(self): + super().__init__('test.interface') + + @method() + def Ping(self): + pass + + @method() + def ConcatStrings(self, what1: 's', what2: 's') -> 's': + return what1 + what2 + + +async def main(): + bus_name = 'dbus.next.sample' + + bus = await MessageBus(bus_type=BusType.SYSTEM).connect() + bus2 = await MessageBus(bus_type=BusType.SYSTEM).connect() + + await bus.request_name(bus_name) + + service_interface = SampleInterface() + bus.export('/test/path', service_interface) + + introspection = await bus2.introspect(bus_name, '/test/path') + assert type(introspection) is intr.Node + obj = bus2.get_proxy_object(bus_name, '/test/path', introspection) + interface = obj.get_interface(service_interface.name) + + result = await interface.call_ping() + assert result is None + + result = await interface.call_concat_strings('hello ', 'world') + assert result == 'hello world' + + +asyncio.run(main()) diff --git a/support/testing/tests/package/test_python_dbus_next.py b/support/testing/tests/package/test_python_dbus_next.py new file mode 100644 index 0000000000..3c597ad198 --- /dev/null +++ b/support/testing/tests/package/test_python_dbus_next.py @@ -0,0 +1,40 @@ +import textwrap + + +from tests.package.test_python import TestPythonPackageBase + + +class TestPythonPy3DBusNext(TestPythonPackageBase): + __test__ = True + config = TestPythonPackageBase.config + \ + """ + BR2_PACKAGE_DBUS=y + BR2_PACKAGE_PYTHON3=y + BR2_PACKAGE_PYTHON_DBUS_NEXT=y + """ + sample_scripts = ["tests/package/sample_python_dbus_next.py"] + + def run_sample_scripts(self): + config = \ + """ + + + + + + + + """ + config = textwrap.dedent(config) + config_dir = "/etc/dbus-1/system.d" + config_fn = "dbus.next.sample.conf" + + # Setup and reload D-Bus configuration + self.emulator.run("mkdir -p " + config_dir) + self.emulator.run("cat > " + config_dir + "/" + config_fn + + " <