diff mbox series

[meta-python,4/5] python3-pydantic: Enable test_docs.py

Message ID 20260728114533.1775490-4-leon.anavi@konsulko.com
State Accepted
Headers show
Series [meta-python,1/5] python3-ruff: Add recipe | expand

Commit Message

Leon Anavi July 28, 2026, 11:45 a.m. UTC
We now have Rust 1.71+ version in oe-core so we can build ruff,
add it to the ptest runtime dependencies, install docs and fix
paths in test_docs.py.

There is a known jemallocator issue on aarch64 that affects ruff
and some of the pydantic tests from test_docs.py:

E           <jemalloc>: Unsupported system page size                                                                                                       E           memory allocation of 4 bytes failed

More details about JEMALLOC_SYS_WITH_LG_PAGE:
https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-pydantic_2.13.4.bb         | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pydantic_2.13.4.bb b/meta-python/recipes-devtools/python/python3-pydantic_2.13.4.bb
index fb80c066f9..52d2c855ec 100644
--- a/meta-python/recipes-devtools/python/python3-pydantic_2.13.4.bb
+++ b/meta-python/recipes-devtools/python/python3-pydantic_2.13.4.bb
@@ -58,13 +58,24 @@  RDEPENDS:${PN}-ptest += "\
     python3-rich \
     python3-sqlalchemy \
     python3-unixadmin \
+    python3-ruff \
+    python3-pytest-examples \
+    python3-devtools \
+    ${PN}-doc \
 "
 
+do_install:append() {
+   install -d ${D}${docdir}/${PN}/
+   cp -rf ${S}/docs/* ${D}${docdir}/${PN}/
+}
+
 do_install_ptest:append() {
     cp -rf ${S}/tests/ ${D}${PTEST_PATH}/
-    # Requires 'ruff' (python3-ruff) which we cannot build
-    # until we have Rust 1.71+ in oe-core
-    rm -f ${D}${PTEST_PATH}/tests/test_docs.py
+    # Fix paths in test_docs.py
+    sed -i \
+        -e "s|^DOCS_ROOT = Path(__file__).parent.parent / 'docs'|DOCS_ROOT = Path('${docdir}/${PN}')|" \
+        -e "s|^SOURCES_ROOT = Path(__file__).parent.parent / 'pydantic'|SOURCES_ROOT = Path('${PYTHON_SITEPACKAGES_DIR}/pydantic')|" \
+        ${D}${PTEST_PATH}/tests/test_docs.py
     # We are not trying to support mypy
     rm -f ${D}${PTEST_PATH}/tests/test_mypy.py
     # We are not trying to run benchmarks
@@ -72,4 +83,6 @@  do_install_ptest:append() {
     sed -i -e "/--automake/ s/$/ -k 'not test_config_validation_error_cause and not test_dataclass_config_validate_default and not test_annotated_validator_nested and not test_use_bare and not test_use_no_fields and not test_validator_bad_fields_throws_configerror and not test_assert_raises_validation_error and not test_model_config_validate_default and not test_readonly_qualifier_warning'/" ${D}${PTEST_PATH}/run-ptest
 }
 
+FILES:${PN}-doc += "${docdir}/${PN}"
+
 BBCLASSEXTEND = "native nativesdk"