diff mbox series

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

Message ID 20260706094627.1254799-5-leon.anavi@konsulko.com
State New
Headers show
Series [meta-python,1/5] python3-croniter: Upgrade 6.2.2 -> 6.2.3 | expand

Commit Message

Leon Anavi July 6, 2026, 9:46 a.m. UTC
Inherit ptest and include tests for genson. The PyPI package
omits files for testing so use the GitHub source instead.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-genson/run-ptest           |  3 +++
 .../python/python3-genson_1.4.0.bb            | 24 +++++++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-genson/run-ptest
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-genson/run-ptest b/meta-python/recipes-devtools/python/python3-genson/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-genson/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-genson_1.4.0.bb b/meta-python/recipes-devtools/python/python3-genson_1.4.0.bb
index fca391c9a7..51b9c90f31 100644
--- a/meta-python/recipes-devtools/python/python3-genson_1.4.0.bb
+++ b/meta-python/recipes-devtools/python/python3-genson_1.4.0.bb
@@ -2,8 +2,28 @@  DESCRIPTION = "GenSON is a powerful, user-friendly JSON Schema generator built i
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e6c30d55dbfb3a28d420d918534adf6b"
 
-SRC_URI[sha256sum] = "bc7f1c1bae87a21ca44d81149aec95a3f4468d676de9b8b08caa064f3c50b3da"
+# The PyPI package omits files for testing
+# so use the GitHub source instead.
+SRCREV = "f305b73f08998891d2f7804b84c8e3c29ca96209"
+SRC_URI = " \
+    git://github.com/wolverdude/GenSON;branch=master;protocol=https \
+    file://run-ptest \
+"
 
-inherit pypi python_setuptools_build_meta
+inherit python_setuptools_build_meta ptest
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-core \
+    python3-coverage \
+    python3-jsonschema \
+    python3-unittest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/test/* ${D}${PTEST_PATH}/tests/
+}
 
 BBCLASSEXTEND = "native nativesdk"