diff mbox series

[meta-python,5/5] python3-libevdev: Upgrade 0.12 -> 0.13.1

Message ID 20260113103421.3568307-5-leon.anavi@konsulko.com
State New
Headers show
Series [meta-python,1/5] python3-pylint: Upgrade 4.0.3 -> 4.0.4 | expand

Commit Message

Leon Anavi Jan. 13, 2026, 10:34 a.m. UTC
Add ptest and upgrade to release 0.13.1:

- pyproject.toml: add pytest as dev dependency
- Import Self from type_checking if needed to be compat with 3.9
- CI: run pytest via uv
- CI: test against multiple python versions

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-libevdev/run-ptest          |  3 +++
 ...vdev_0.12.bb => python3-libevdev_0.13.1.bb} | 18 ++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-libevdev/run-ptest
 rename meta-python/recipes-devtools/python/{python3-libevdev_0.12.bb => python3-libevdev_0.13.1.bb} (52%)

Comments

Gyorgy Sarvari Jan. 13, 2026, 12:36 p.m. UTC | #1
Small simplification: if you inherit the ptest-python-ptest[1] class
instead of ptest, it takes care of all other test boilerplate (test
installation, run-ptest creation, RDEPENDS...)

Though I wouldn't submit a v2 because of this - but for next time it
might be useful.

[1]:
https://git.openembedded.org/openembedded-core/tree/meta/classes-recipe/ptest-python-pytest.bbclass

On 1/13/26 11:34, Leon Anavi via lists.openembedded.org wrote:
> Add ptest and upgrade to release 0.13.1:
>
> - pyproject.toml: add pytest as dev dependency
> - Import Self from type_checking if needed to be compat with 3.9
> - CI: run pytest via uv
> - CI: test against multiple python versions
>
> Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
> ---
>  .../python/python3-libevdev/run-ptest          |  3 +++
>  ...vdev_0.12.bb => python3-libevdev_0.13.1.bb} | 18 ++++++++++++++++--
>  2 files changed, 19 insertions(+), 2 deletions(-)
>  create mode 100644 meta-python/recipes-devtools/python/python3-libevdev/run-ptest
>  rename meta-python/recipes-devtools/python/{python3-libevdev_0.12.bb => python3-libevdev_0.13.1.bb} (52%)
>
> diff --git a/meta-python/recipes-devtools/python/python3-libevdev/run-ptest b/meta-python/recipes-devtools/python/python3-libevdev/run-ptest
> new file mode 100644
> index 0000000000..8d2017d39c
> --- /dev/null
> +++ b/meta-python/recipes-devtools/python/python3-libevdev/run-ptest
> @@ -0,0 +1,3 @@
> +#!/bin/sh
> +
> +pytest --automake
> diff --git a/meta-python/recipes-devtools/python/python3-libevdev_0.12.bb b/meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
> similarity index 52%
> rename from meta-python/recipes-devtools/python/python3-libevdev_0.12.bb
> rename to meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
> index cabcfd8df6..1c8a99eb33 100644
> --- a/meta-python/recipes-devtools/python/python3-libevdev_0.12.bb
> +++ b/meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
> @@ -5,13 +5,27 @@ SECTION = "devel/python"
>  LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=d94c10c546b419eddc6296157ec40747"
>  
> -SRC_URI[sha256sum] = "02e952632ec6c249cbb9c66f6fa00012ea448b06606c77cd139133bc2fe46b08"
> +SRC_URI[sha256sum] = "dc3369cd1401767b9ecb1117cd6b73faba9038e3bd9e1695a710a9e9d9415e8d"
>  
> -inherit pypi setuptools3
> +inherit pypi python_hatchling ptest
>  
>  PYPI_PACKAGE = "libevdev"
>  
> +SRC_URI += " \
> +    file://run-ptest \
> +"
> +
>  RDEPENDS:${PN} += " \
>      libevdev \
>      python3-ctypes \
>  "
> +
> +RDEPENDS:${PN}-ptest += " \
> +    python3-pytest \
> +"
> +
> +do_install_ptest() {
> +    install -d ${D}${PTEST_PATH}/test
> +    cp -rf ${S}/test/* ${D}${PTEST_PATH}/test/
> +}
> +
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#123434): https://lists.openembedded.org/g/openembedded-devel/message/123434
> Mute This Topic: https://lists.openembedded.org/mt/117241112/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-libevdev/run-ptest b/meta-python/recipes-devtools/python/python3-libevdev/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-libevdev/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-libevdev_0.12.bb b/meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
similarity index 52%
rename from meta-python/recipes-devtools/python/python3-libevdev_0.12.bb
rename to meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
index cabcfd8df6..1c8a99eb33 100644
--- a/meta-python/recipes-devtools/python/python3-libevdev_0.12.bb
+++ b/meta-python/recipes-devtools/python/python3-libevdev_0.13.1.bb
@@ -5,13 +5,27 @@  SECTION = "devel/python"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d94c10c546b419eddc6296157ec40747"
 
-SRC_URI[sha256sum] = "02e952632ec6c249cbb9c66f6fa00012ea448b06606c77cd139133bc2fe46b08"
+SRC_URI[sha256sum] = "dc3369cd1401767b9ecb1117cd6b73faba9038e3bd9e1695a710a9e9d9415e8d"
 
-inherit pypi setuptools3
+inherit pypi python_hatchling ptest
 
 PYPI_PACKAGE = "libevdev"
 
+SRC_URI += " \
+    file://run-ptest \
+"
+
 RDEPENDS:${PN} += " \
     libevdev \
     python3-ctypes \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/test
+    cp -rf ${S}/test/* ${D}${PTEST_PATH}/test/
+}
+