* [Buildroot] [PATCH 1/2] package/python-varlink: new package
@ 2025-11-24 14:05 Marcus Hoffmann via buildroot
2025-11-24 14:05 ` [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test Marcus Hoffmann
2025-12-27 20:56 ` [Buildroot] [PATCH 1/2] package/python-varlink: new package Thomas Petazzoni via buildroot
0 siblings, 2 replies; 4+ messages in thread
From: Marcus Hoffmann via buildroot @ 2025-11-24 14:05 UTC (permalink / raw)
To: buildroot; +Cc: James Hilliard, Thomas Petazzoni, Marcus Hoffmann
There are currently problems in updating the pypi.org release[1], so we
pull the package from the github generated tarball instead. This in turn
then requires manually setting the version for setuptools_scm in the
environment.
[1] https://github.com/varlink/python/issues/81
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/python-varlink/Config.in | 6 ++++++
package/python-varlink/python-varlink.hash | 3 +++
package/python-varlink/python-varlink.mk | 15 +++++++++++++++
5 files changed, 26 insertions(+)
create mode 100644 package/python-varlink/Config.in
create mode 100644 package/python-varlink/python-varlink.hash
create mode 100644 package/python-varlink/python-varlink.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index db001d6bb0..658023a4f4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -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-varlink/
F: package/python-waitress/
F: package/python-whitenoise/
F: support/testing/tests/package/test_python_apscheduler.py
diff --git a/package/Config.in b/package/Config.in
index 12f327cb27..2fb9cd8472 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1476,6 +1476,7 @@ menu "External python modules"
source "package/python-uvicorn/Config.in"
source "package/python-uvloop/Config.in"
source "package/python-validators/Config.in"
+ source "package/python-varlink/Config.in"
source "package/python-versiontools/Config.in"
source "package/python-visitor/Config.in"
source "package/python-waitress/Config.in"
diff --git a/package/python-varlink/Config.in b/package/python-varlink/Config.in
new file mode 100644
index 0000000000..609fa22219
--- /dev/null
+++ b/package/python-varlink/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PYTHON_VARLINK
+ bool "python-varlink"
+ help
+ Python implementation of the Varlink protocol.
+
+ https://github.com/varlink/python
diff --git a/package/python-varlink/python-varlink.hash b/package/python-varlink/python-varlink.hash
new file mode 100644
index 0000000000..5d8dfa9d8e
--- /dev/null
+++ b/package/python-varlink/python-varlink.hash
@@ -0,0 +1,3 @@
+# Locally computed sha256 checksums
+sha256 d31aee370ded51bc2bf8ad375fcd8b4cf3b7587306c0e05cffb45026ea9b9c40 python-varlink-32.1.0.tar.gz
+sha256 b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1 LICENSE.txt
diff --git a/package/python-varlink/python-varlink.mk b/package/python-varlink/python-varlink.mk
new file mode 100644
index 0000000000..1180cc4cc3
--- /dev/null
+++ b/package/python-varlink/python-varlink.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-varlink
+#
+################################################################################
+
+PYTHON_VARLINK_VERSION = 32.1.0
+PYTHON_VARLINK_SITE = $(call github,varlink,python,$(PYTHON_VARLINK_VERSION))
+PYTHON_VARLINK_SETUP_TYPE = setuptools
+PYTHON_VARLINK_DEPENDENCIES = host-python-setuptools-scm
+PYTHON_VARLINK_LICENSE = Apache-2.0
+PYTHON_VARLINK_LICENSE_FILES = LICENSE.txt
+PYTHON_VARLINK_ENV = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_VARLINK=$(PYTHON_VARLINK_VERSION)
+
+$(eval $(python-package))
--
2.52.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test
2025-11-24 14:05 [Buildroot] [PATCH 1/2] package/python-varlink: new package Marcus Hoffmann via buildroot
@ 2025-11-24 14:05 ` Marcus Hoffmann
2025-12-27 20:57 ` Thomas Petazzoni via buildroot
2025-12-27 20:56 ` [Buildroot] [PATCH 1/2] package/python-varlink: new package Thomas Petazzoni via buildroot
1 sibling, 1 reply; 4+ messages in thread
From: Marcus Hoffmann @ 2025-11-24 14:05 UTC (permalink / raw)
To: buildroot; +Cc: Marcus Hoffmann
Add new runtime test for python-varlink. Add this in a subdirectory, so
the separate example interface file (which should be named in reverse
DNS notation) does not sit loosly in the general package test dir.
As always when we need to start a separate server process inside a test
case this gets slightly fiddly.
We override the test_run() function to first start the varlink example server,
then call the packages cli interface to do a varlink call against the
server. The cli defaults to pretty printing the result, which makes it
more annoying to compare to the expected result in the test case, so we
un-prettyprint it with python's builtin json.tool module.
Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
---
DEVELOPERS | 1 +
.../org.example.test.varlink | 5 +++
.../sample_python_varlink.py | 22 +++++++++++++
.../test_python_varlink.py | 31 +++++++++++++++++++
4 files changed, 59 insertions(+)
create mode 100644 support/testing/tests/package/test_python_varlink/org.example.test.varlink
create mode 100644 support/testing/tests/package/test_python_varlink/sample_python_varlink.py
create mode 100644 support/testing/tests/package/test_python_varlink/test_python_varlink.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 658023a4f4..695b738d7e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2285,6 +2285,7 @@ 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_tzlocal.py
+F: support/testing/tests/package/test_python_varlink/
F: support/testing/tests/package/test_python_waitress.py
F: support/testing/tests/package/test_python_whitenoise.py
F: support/testing/tests/package/sample_python_apscheduler.py
diff --git a/support/testing/tests/package/test_python_varlink/org.example.test.varlink b/support/testing/tests/package/test_python_varlink/org.example.test.varlink
new file mode 100644
index 0000000000..c199824e6e
--- /dev/null
+++ b/support/testing/tests/package/test_python_varlink/org.example.test.varlink
@@ -0,0 +1,5 @@
+# Example Varlink service
+interface org.example.test
+
+# Returns the same string
+method Ping(ping: string) -> (pong: string)
diff --git a/support/testing/tests/package/test_python_varlink/sample_python_varlink.py b/support/testing/tests/package/test_python_varlink/sample_python_varlink.py
new file mode 100644
index 0000000000..6cf0378d88
--- /dev/null
+++ b/support/testing/tests/package/test_python_varlink/sample_python_varlink.py
@@ -0,0 +1,22 @@
+import os
+
+import varlink
+
+service = varlink.Service(interface_dir=os.path.dirname(__file__))
+
+
+class ServiceRequestHandler(varlink.RequestHandler):
+ service = service
+
+
+@service.interface("org.example.test")
+class Example:
+ def Ping(self, ping):
+ return {"pong": ping}
+
+def run_server(address):
+ with varlink.ThreadingServer(address, ServiceRequestHandler) as server:
+ print("Listening on", server.server_address)
+ server.serve_forever()
+
+run_server("unix:@test")
diff --git a/support/testing/tests/package/test_python_varlink/test_python_varlink.py b/support/testing/tests/package/test_python_varlink/test_python_varlink.py
new file mode 100644
index 0000000000..0979f22847
--- /dev/null
+++ b/support/testing/tests/package/test_python_varlink/test_python_varlink.py
@@ -0,0 +1,31 @@
+import os
+import time
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Varlink(TestPythonPackageBase):
+ __test__ = True
+ config = TestPythonPackageBase.config + \
+ """
+ BR2_PACKAGE_PYTHON3=y
+ BR2_PACKAGE_PYTHON_VARLINK=y
+ """
+ sample_scripts = ["tests/package/test_python_varlink/sample_python_varlink.py",
+ "tests/package/test_python_varlink/org.example.test.varlink"]
+
+ def test_run(self):
+ self.login()
+ self.check_sample_scripts_exist()
+ # we need to supress any output here as otherwise the commnd output parsing
+ # gets confused for the second command
+ cmd = "%s %s > /dev/null 2>&1 &" % (self.interpreter, os.path.basename(self.sample_scripts[0]))
+
+ _, exit_code = self.emulator.run(cmd, timeout=self.timeout)
+
+ varlink_cli_call = "-m varlink.cli call 'unix:@test/org.example.test.Ping' '{\"ping\": \"hello\"}'"
+ unprettyprint = "| python -m json.tool --compact"
+ cmd = "%s %s %s" % (self.interpreter, varlink_cli_call, unprettyprint)
+ output, exit_code = self.emulator.run(cmd, timeout=self.timeout)
+ self.assertEqual(exit_code, 0)
+ self.assertEqual(output[0], '{"pong":"hello"}')
--
2.52.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test
2025-11-24 14:05 ` [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test Marcus Hoffmann
@ 2025-12-27 20:57 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-12-27 20:57 UTC (permalink / raw)
To: Marcus Hoffmann; +Cc: buildroot, Marcus Hoffmann
On Mon, 24 Nov 2025 15:05:16 +0100
Marcus Hoffmann <buildroot@bubu1.eu> wrote:
> Add new runtime test for python-varlink. Add this in a subdirectory, so
> the separate example interface file (which should be named in reverse
> DNS notation) does not sit loosly in the general package test dir.
I changed this to not have the test in a subdir. I kept the interface
file and sample script in a subdir, but not the test itself.
The reason: consistency with other tests, that have the same
organization, the test is in support/testing/tests/packages/, and there
is a subdir for the artifacts that are needed for the test to run.
Applied with this small change. Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH 1/2] package/python-varlink: new package
2025-11-24 14:05 [Buildroot] [PATCH 1/2] package/python-varlink: new package Marcus Hoffmann via buildroot
2025-11-24 14:05 ` [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test Marcus Hoffmann
@ 2025-12-27 20:56 ` Thomas Petazzoni via buildroot
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-12-27 20:56 UTC (permalink / raw)
To: Marcus Hoffmann via buildroot
Cc: Marcus Hoffmann, James Hilliard, Marcus Hoffmann
On Mon, 24 Nov 2025 15:05:15 +0100
Marcus Hoffmann via buildroot <buildroot@buildroot.org> wrote:
> There are currently problems in updating the pypi.org release[1], so we
> pull the package from the github generated tarball instead. This in turn
> then requires manually setting the version for setuptools_scm in the
> environment.
>
> [1] https://github.com/varlink/python/issues/81
>
> Signed-off-by: Marcus Hoffmann <buildroot@bubu1.eu>
> ---
> DEVELOPERS | 1 +
> package/Config.in | 1 +
> package/python-varlink/Config.in | 6 ++++++
> package/python-varlink/python-varlink.hash | 3 +++
> package/python-varlink/python-varlink.mk | 15 +++++++++++++++
> 5 files changed, 26 insertions(+)
> create mode 100644 package/python-varlink/Config.in
> create mode 100644 package/python-varlink/python-varlink.hash
> create mode 100644 package/python-varlink/python-varlink.mk
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-27 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24 14:05 [Buildroot] [PATCH 1/2] package/python-varlink: new package Marcus Hoffmann via buildroot
2025-11-24 14:05 ` [Buildroot] [PATCH 2/2] support/testing: python-varlink: new runtime test Marcus Hoffmann
2025-12-27 20:57 ` Thomas Petazzoni via buildroot
2025-12-27 20:56 ` [Buildroot] [PATCH 1/2] package/python-varlink: new package Thomas Petazzoni via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox