From 64c46bbb7264957cf0145047fa7825ee3ca73ad1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 22 Jul 2025 08:39:02 -0700 Subject: python3-pydantic: Upgrade to 2.11.7 Fix build with pydantic-core 2.35.2 Signed-off-by: Khem Raj --- ...1-pyprojects-Bump-pydantic-core-to-2.35.2.patch | 36 +++++++++++ .../python/python3-pydantic_2.11.3.bb | 75 ---------------------- .../python/python3-pydantic_2.11.7.bb | 74 +++++++++++++++++++++ 3 files changed, 110 insertions(+), 75 deletions(-) create mode 100644 meta-python/recipes-devtools/python/python3-pydantic/0001-pyprojects-Bump-pydantic-core-to-2.35.2.patch delete mode 100644 meta-python/recipes-devtools/python/python3-pydantic_2.11.3.bb create mode 100644 meta-python/recipes-devtools/python/python3-pydantic_2.11.7.bb (limited to 'meta-python/recipes-devtools') diff --git a/meta-python/recipes-devtools/python/python3-pydantic/0001-pyprojects-Bump-pydantic-core-to-2.35.2.patch b/meta-python/recipes-devtools/python/python3-pydantic/0001-pyprojects-Bump-pydantic-core-to-2.35.2.patch new file mode 100644 index 0000000000..794ebdbbc7 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pydantic/0001-pyprojects-Bump-pydantic-core-to-2.35.2.patch @@ -0,0 +1,36 @@ +From 6558daf87f8ae156f913c0e76403cbffee40e3cc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 22 Jul 2025 11:46:35 -0700 +Subject: [PATCH] pyprojects: Bump pydantic-core to 2.35.2 + +This matches with recipe in meta-python + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -48,7 +48,7 @@ dependencies = [ + 'typing-extensions>=4.13.0', + 'annotated-types>=0.6.0', + # Keep this in sync with the version in the `check_pydantic_core_version()` function: +- 'pydantic-core==2.35.1', ++ 'pydantic-core==2.35.2', + 'typing-inspection>=0.4.0', + ] + dynamic = ['version', 'readme'] +--- a/pydantic/version.py ++++ b/pydantic/version.py +@@ -66,7 +66,7 @@ def version_info() -> str: + def check_pydantic_core_version() -> bool: + """Check that the installed `pydantic-core` dependency is compatible.""" + # Keep this in sync with the version constraint in the `pyproject.toml` dependencies: +- return __pydantic_core_version__ == '2.35.1' ++ return __pydantic_core_version__ == '2.35.2' + + + def parse_mypy_version(version: str) -> tuple[int, int, int]: diff --git a/meta-python/recipes-devtools/python/python3-pydantic_2.11.3.bb b/meta-python/recipes-devtools/python/python3-pydantic_2.11.3.bb deleted file mode 100644 index 47c077853a..0000000000 --- a/meta-python/recipes-devtools/python/python3-pydantic_2.11.3.bb +++ /dev/null @@ -1,75 +0,0 @@ -SUMMARY = "Data validation using Python type hinting" -DESCRIPTION = "Data validation and settings management using Python \ -type hints.\ -\ -Fast and extensible, Pydantic plays nicely with your linters/IDE/brain. \ -Define how data should be in pure, canonical Python 3.7+; validate it with \ -Pydantic." -HOMEPAGE = "https://github.com/samuelcolvin/pydantic" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=09280955509d1c4ca14bae02f21d49a6" - -inherit python_hatchling ptest-python-pytest - -SRCREV = "bce81efdeac1cbefd0196b478a32aa2586bd595a" -PV .= "+git" -SRC_URI = "git://github.com/pydantic/pydantic;protocol=https;branch=main" - - -DEPENDS += "python3-hatch-fancy-pypi-readme-native" - -RECIPE_NO_UPDATE_REASON = "Must be updated in sync with python3-pydantic-core." - -RDEPENDS:${PN} += "\ - python3-annotated-types \ - python3-core \ - python3-datetime \ - python3-image \ - python3-io \ - python3-json \ - python3-jsonschema \ - python3-logging \ - python3-netclient \ - python3-numbers \ - python3-profile \ - python3-pydantic-core \ - python3-typing-extensions \ - python3-typing-inspection \ - python3-tzdata \ - python3-zoneinfo \ -" - -RDEPENDS:${PN}-ptest += "\ - python3-ansi2html \ - python3-coverage \ - python3-cloudpickle \ - python3-dirty-equals \ - python3-email-validator \ - python3-fastjsonschema \ - python3-greenlet \ - python3-html \ - python3-hypothesis \ - python3-mypy \ - python3-packaging \ - python3-pydoc \ - python3-pytest-codspeed \ - python3-pytest-mock \ - python3-pytz \ - python3-rich \ - python3-sqlalchemy \ - python3-unixadmin \ -" - -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 - # We are not trying to support mypy - rm -f ${D}${PTEST_PATH}/tests/test_mypy.py - # We are not trying to run benchmarks - rm -rf ${D}${PTEST_PATH}/tests/benchmarks - 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 -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-python/recipes-devtools/python/python3-pydantic_2.11.7.bb b/meta-python/recipes-devtools/python/python3-pydantic_2.11.7.bb new file mode 100644 index 0000000000..250a433726 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pydantic_2.11.7.bb @@ -0,0 +1,74 @@ +SUMMARY = "Data validation using Python type hinting" +DESCRIPTION = "Data validation and settings management using Python \ +type hints.\ +\ +Fast and extensible, Pydantic plays nicely with your linters/IDE/brain. \ +Define how data should be in pure, canonical Python 3.7+; validate it with \ +Pydantic." +HOMEPAGE = "https://github.com/samuelcolvin/pydantic" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=09280955509d1c4ca14bae02f21d49a6" + +inherit python_hatchling ptest-python-pytest + +SRCREV = "702aaa6354cc30ae815676c57a8bbb4557ccb295" +PV .= "+git" +SRC_URI = "git://github.com/pydantic/pydantic;protocol=https;branch=main" +SRC_URI += "file://0001-pyprojects-Bump-pydantic-core-to-2.35.2.patch" +DEPENDS += "python3-hatch-fancy-pypi-readme-native" + +RECIPE_NO_UPDATE_REASON = "Must be updated in sync with python3-pydantic-core." + +RDEPENDS:${PN} += "\ + python3-annotated-types \ + python3-core \ + python3-datetime \ + python3-image \ + python3-io \ + python3-json \ + python3-jsonschema \ + python3-logging \ + python3-netclient \ + python3-numbers \ + python3-profile \ + python3-pydantic-core \ + python3-typing-extensions \ + python3-typing-inspection \ + python3-tzdata \ + python3-zoneinfo \ +" + +RDEPENDS:${PN}-ptest += "\ + python3-ansi2html \ + python3-coverage \ + python3-cloudpickle \ + python3-dirty-equals \ + python3-email-validator \ + python3-fastjsonschema \ + python3-greenlet \ + python3-html \ + python3-hypothesis \ + python3-mypy \ + python3-packaging \ + python3-pydoc \ + python3-pytest-codspeed \ + python3-pytest-mock \ + python3-pytz \ + python3-rich \ + python3-sqlalchemy \ + python3-unixadmin \ +" + +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 + # We are not trying to support mypy + rm -f ${D}${PTEST_PATH}/tests/test_mypy.py + # We are not trying to run benchmarks + rm -rf ${D}${PTEST_PATH}/tests/benchmarks + 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 +} + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf