diff mbox series

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

Message ID 20260623094127.1592848-4-leon.anavi@konsulko.com
State Under Review
Headers show
Series [meta-python,1/4] python3-zeroconf: Upgrade 0.149.17 -> 0.150.0 | expand

Commit Message

Leon Anavi June 23, 2026, 9:41 a.m. UTC
Inherit ptest and include tests for jdatetime. The PyPI package
omits some files for testing like tests/__init__.py so use the
GitHub source instead.

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

Patch

diff --git a/meta-python/recipes-devtools/python/python3-jdatetime/run-ptest b/meta-python/recipes-devtools/python/python3-jdatetime/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-jdatetime/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-jdatetime_5.3.0.bb b/meta-python/recipes-devtools/python/python3-jdatetime_5.3.0.bb
index 9275736eb3..90dacb8d5e 100644
--- a/meta-python/recipes-devtools/python/python3-jdatetime_5.3.0.bb
+++ b/meta-python/recipes-devtools/python/python3-jdatetime_5.3.0.bb
@@ -3,9 +3,15 @@  HOMEPAGE = "https://github.com/slashmili/python-jalali"
 LICENSE = "Python-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=c80be45b33471b4a23cf53d06a8172be"
 
-SRC_URI[sha256sum] = "d20eb9fc2a00e86493a6156b2a0e4e579f23379e8fea186a0e603fd36a130227"
+# The PyPI package omits some files for testing like tests/__init__.py
+# so use the GitHub source instead.
+SRCREV = "ea119aab729d4c48f797f3663a692680c93fb9f5"
+SRC_URI = " \
+    git://github.com/slashmili/jdatetime;branch=main;protocol=https \
+    file://run-ptest \
+"
 
-inherit pypi python_setuptools_build_meta
+inherit python_setuptools_build_meta ptest
 
 CLEANBROKEN = "1"
 
@@ -14,3 +20,16 @@  RDEPENDS:${PN} += " \
     python3-jalali-core \
 "
 
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-core \
+    python3-pickle \
+    python3-unittest \
+    python3-zoneinfo \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}