From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Vincent Cruz <mooz@blockos.org>
Cc: buildroot@buildroot.org, Vincent Jardin <vjardin@free.fr>,
James Hilliard <james.hilliard1@gmail.com>
Subject: Re: [Buildroot] [PATCH v2 1/1] package/python-libyang: new package
Date: Sat, 30 May 2026 16:19:53 +0200 [thread overview]
Message-ID: <ahrxiPDzbmY2LC9V@windsurf> (raw)
In-Reply-To: <20260416102643.1347452-1-mooz@blockos.org>
Hello Vincent,
Thanks for submitting this patch, which I have applied to next after
doing some changes. See below.
On Thu, Apr 16, 2026 at 12:24:21PM +0200, Vincent Cruz wrote:
> diff --git a/package/python-libyang/Config.in b/package/python-libyang/Config.in
> new file mode 100644
> index 0000000000..c314beb0ea
> --- /dev/null
> +++ b/package/python-libyang/Config.in
> @@ -0,0 +1,19 @@
> +config BR2_PACKAGE_PYTHON_LIBYANG
> + bool "python-libyang"
> + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libyang
> + depends on BR2_TOOLCHAIN_HAS_THREADS # libyang
> + depends on !BR2_STATIC_LIBS # libyang
> + select BR2_PACKAGE_LIBYANG
> + select BR2_PACKAGE_PYTHON_CFFI # runtime
> + help
> + Python CFFI bindings for the libyang YANG library.
> +
> + This package provides the 'libyang' Python module, used by
> + higher-level tooling such as python-sysrepo.
> +
> + https://github.com/CESNET/libyang-python
> +
> +comment "python-libyang needs libyang"
> + depends on !BR2_TOOLCHAIN_HAS_SYNC_4
> + depends on !BR2_TOOLCHAIN_HAS_THREADS
> + depends on BR2_STATIC_LIBS
This is not the correct way of providing dependency comments. We don't
care about the libyang dependency being commented on because you're
selecting libyang. We need comments about toolchain dependencies.
Changed to:
+comment "python-libyang needs a toolchain w/ threads, dynamic library"
+ depends on !BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
> diff --git a/support/testing/tests/package/test_python_libyang.py b/support/testing/tests/package/test_python_libyang.py
> new file mode 100644
> index 0000000000..c485de2a67
> --- /dev/null
> +++ b/support/testing/tests/package/test_python_libyang.py
> @@ -0,0 +1,26 @@
> +import os
> +from xml.etree import ElementTree
> +from tests.package.test_python import TestPythonPackageBase
> +
> +
> +class TestPythonLibyang(TestPythonPackageBase):
> + __test__ = True
> + config = TestPythonPackageBase.config + \
> + """
> + BR2_PACKAGE_PYTHON3=y
> + BR2_PACKAGE_PYTHON_LIBYANG=y
> + """
> + sample_scripts = ["tests/package/sample_python_libyang.py"]
> +
> + def test_run(self):
> + self.login()
> + self.check_sample_scripts_exist()
> +
> + cmd = self.interpreter + " " + os.path.basename(self.sample_scripts[0])
> + output, exit_code = self.emulator.run(cmd, timeout=15)
> + self.assertEqual(exit_code, 0)
> +
> + tree = ElementTree.fromstringlist(output)
> + self.assertEqual(tree.tag, '{urn:example}data')
> + self.assertEqual(tree.find('.//{*}hostname').text, 'foobar')
> + self.assertEqual(len(tree.find('.//{*}interface')), 2)
Rather than overriding test_run() to be able to run your custom logic
after running the same Python script, I've moved the XML validation
logic inside the sample Python script itself:
+xml = node.print_mem('xml', pretty=True)
+tree = ElementTree.fromstringlist(xml)
+assert tree.tag == '{urn:example}data'
+assert tree.find('.//{*}hostname').text == 'foobar'
+assert len(tree.find('.//{*}interface')) == 2
Committed to next with those changes. 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
prev parent reply other threads:[~2026-05-30 14:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 10:24 [Buildroot] [PATCH v2 1/1] package/python-libyang: new package Vincent Cruz
2026-05-30 14:19 ` Thomas Petazzoni via buildroot [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=ahrxiPDzbmY2LC9V@windsurf \
--to=buildroot@buildroot.org \
--cc=james.hilliard1@gmail.com \
--cc=mooz@blockos.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=vjardin@free.fr \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox