diff mbox series

[meta-python,4/5] python3-pybcj: Enable tests

Message ID 20260709130921.4185087-4-leon.anavi@konsulko.com
State Under Review
Headers show
Series [meta-python,1/5] python3-jsbeautifier: Enable tests | expand

Commit Message

Leon Anavi July 9, 2026, 1:09 p.m. UTC
Inherit ptest and include tests for pybcj.

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-pybcj/run-ptest            |  3 ++
 .../python/python3-pybcj_1.0.7.bb             | 28 ++++++++++++++++---
 2 files changed, 27 insertions(+), 4 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-pybcj/run-ptest
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pybcj/run-ptest b/meta-python/recipes-devtools/python/python3-pybcj/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pybcj/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-pybcj_1.0.7.bb b/meta-python/recipes-devtools/python/python3-pybcj_1.0.7.bb
index 299677b072..e291375456 100644
--- a/meta-python/recipes-devtools/python/python3-pybcj_1.0.7.bb
+++ b/meta-python/recipes-devtools/python/python3-pybcj_1.0.7.bb
@@ -4,11 +4,15 @@  LICENSE = "LGPL-2.1-or-later"
 SECTION = "devel/python"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI[sha256sum] = "72d64574069ffb0a800020668376b7ebd7adea159adbf4d35f8effc62f0daa67"
-
-inherit pypi python_setuptools_build_meta pypi
+# The PyPI package omits files for testing
+# so use the GitHub source instead.
+SRCREV = "0735ad15fa001748dc3a13f36be2fe7a4971cf79"
+SRC_URI = " \
+    git://github.com/miurahr/pybcj;branch=main;protocol=https \
+    file://run-ptest \
+"
 
-#PROVIDES = "python3-pybcj"
+inherit python_setuptools_build_meta ptest
 
 DEPENDS += " \
     python3-setuptools-scm-native \
@@ -22,3 +26,19 @@  RDEPENDS:${PN} += "\
     python3-core \
     python3-compression \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-core \
+    python3-datetime \
+    python3-crypt \
+    python3-compression \
+    python3-hypothesis \
+    python3-unittest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}