From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Marcin Niestroj <m.niestroj@grinn-global.com>
Cc: James Hilliard <james.hilliard1@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Asaf Kahlon <asafka7@gmail.com>,
buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2 1/2] package/python-dbus-fast: new package
Date: Mon, 2 Jan 2023 22:37:45 +0100 [thread overview]
Message-ID: <20230102213745.GY2498764@scaer> (raw)
In-Reply-To: <20221103102102.924370-1-m.niestroj@grinn-global.com>
Narcin, All,
On 2022-11-03 11:21 +0100, Marcin Niestroj spake thusly:
> Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
[--SNIP--]
> diff --git a/package/python-dbus-fast/python-dbus-fast.mk b/package/python-dbus-fast/python-dbus-fast.mk
> new file mode 100644
> index 0000000000..de7049ba22
> --- /dev/null
> +++ b/package/python-dbus-fast/python-dbus-fast.mk
> @@ -0,0 +1,16 @@
> +################################################################################
> +#
> +# python-dbus-fast
> +#
> +################################################################################
> +
> +PYTHON_DBUS_FAST_VERSION = 1.61.1
> +PYTHON_DBUS_FAST_SOURCE = dbus_fast-$(PYTHON_DBUS_FAST_VERSION).tar.gz
> +PYTHON_DBUS_FAST_SITE = https://files.pythonhosted.org/packages/dd/f4/a280d46b119d59f6a3d84abf474452ae76651558b0963ab8c48ae13b5a44
> +PYTHON_DBUS_FAST_SETUP_TYPE = setuptools
> +PYTHON_DBUS_FAST_LICENSE = MIT
> +PYTHON_DBUS_FAST_LICENSE_FILES = LICENSE
> +PYTHON_DBUS_FAST_ENV = REQUIRE_CYTHON=1
> +PYTHON_DBUS_FAST_DEPENDENCIES = host-python-cython
Since there is a Kconfig symbol for host-python-cython, I've added the
appropriate select in Config.in.
> +$(eval $(python-package))
> diff --git a/support/testing/tests/package/sample_python_dbus_fast.py b/support/testing/tests/package/sample_python_dbus_fast.py
> new file mode 100644
> index 0000000000..c2855464a1
> --- /dev/null
> +++ b/support/testing/tests/package/sample_python_dbus_fast.py
> @@ -0,0 +1,44 @@
> +import asyncio
> +from dbus_fast.aio import MessageBus
> +from dbus_fast.service import ServiceInterface, method
> +import dbus_fast.introspection as intr
> +from dbus_fast 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': # noqa: F821
> + return what1 + what2
> +
> +
> +async def main():
> + bus_name = 'dbus.fast.sample'
I've introduced obj_path = '/test/path', and...
> +
> + 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)
... used it here, and...
> + introspection = await bus2.introspect(bus_name, '/test/path')
... here, and....
> + assert type(introspection) is intr.Node
> + obj = bus2.get_proxy_object(bus_name, '/test/path', introspection)
... here.
Applied to master, thanks.
Sorry for missing this patch when I got to apply python-bleak's bump a
few weeks ago; thanks for reminding me.
Regards,
Yann E. MORIN.
> + 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_fast.py b/support/testing/tests/package/test_python_dbus_fast.py
> new file mode 100644
> index 0000000000..5f67cfd8cc
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_dbus_fast.py
> @@ -0,0 +1,40 @@
> +import textwrap
> +
> +
> +from tests.package.test_python import TestPythonPackageBase
> +
> +
> +class TestPythonPy3DBusFast(TestPythonPackageBase):
> + __test__ = True
> + config = TestPythonPackageBase.config + \
> + """
> + BR2_PACKAGE_DBUS=y
> + BR2_PACKAGE_PYTHON3=y
> + BR2_PACKAGE_PYTHON_DBUS_FAST=y
> + """
> + sample_scripts = ["tests/package/sample_python_dbus_fast.py"]
> +
> + def run_sample_scripts(self):
> + config = \
> + """
> + <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
> + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
> + <busconfig>
> + <policy user="root">
> + <allow own="dbus.fast.sample"/>
> + <allow send_destination="dbus.fast.sample"/>
> + </policy>
> + </busconfig>
> + """
> + config = textwrap.dedent(config)
> + config_dir = "/etc/dbus-1/system.d"
> + config_fn = "dbus.fast.sample.conf"
> +
> + # Setup and reload D-Bus configuration
> + self.emulator.run("mkdir -p " + config_dir)
> + self.emulator.run("cat > " + config_dir + "/" + config_fn +
> + " <<EOF" + config + "EOF")
> + self.emulator.run("killall -SIGHUP dbus-daemon")
> +
> + # Run test scripts
> + super().run_sample_scripts()
> --
> 2.38.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
prev parent reply other threads:[~2023-01-02 21:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 10:21 [Buildroot] [PATCH v2 1/2] package/python-dbus-fast: new package Marcin Niestroj
2022-11-03 10:21 ` [Buildroot] [PATCH v2 2/2] package/python-bleak: bump version to 0.19.1 Marcin Niestroj
2022-11-03 12:12 ` James Hilliard
2022-12-11 9:10 ` Yann E. MORIN
2023-01-02 11:23 ` Marcin Niestrój
2023-01-02 18:08 ` Yann E. MORIN
2022-11-03 12:13 ` [Buildroot] [PATCH v2 1/2] package/python-dbus-fast: new package James Hilliard
2023-01-02 21:37 ` Yann E. MORIN [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230102213745.GY2498764@scaer \
--to=yann.morin.1998@free.fr \
--cc=asafka7@gmail.com \
--cc=buildroot@buildroot.org \
--cc=james.hilliard1@gmail.com \
--cc=m.niestroj@grinn-global.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.