commit f4439bfec9afe987eea657662fd1d54f03a7ad43d726c65214e41cce8b918321 Author: Daniel Garcia Date: Mon Jun 23 06:39:12 2025 +0000 - Update to 2.35.1: * Fix generic issues with ValidationInfo and SerializationInfo by @Viicos in #1736 2.35.0: * Do not reuse validator and serializer when unpickling by @Viicos in #1693 * Remove unnecessary required fields count when exclude_none is set by @Viicos in #1708 * Update test dependencies after 3.8 dropped support by @Viicos in #1710 * Mark constructor parameters of exceptions as positional-only by @Viicos in #1699 * fix: submodel fields with wrap validator affect smart union selection by @weiliddat in #1700 * use pypa/gh-action-pypi-publish by @samuelcolvin in #1599 * add critical sections around bytearray reads by @davidhewitt in #1717 * simplify ser-as-any mechanism by @davidhewitt in #1478 * Coerce 'time' schema constraints by @Viicos in #1720 * drop serde-json preserve_order feature by @davidhewitt in #1724 * Remove core schema validation by @Viicos in #1715 * Improve uncaught PydanticUseDefault exception message by @Viicos in #1730 * Add support for Python 3.14 by @Viicos in #1714 * drop pypy3.9 support, add pypy3.11 support by @davidhewitt in #1726 * Add ensure_ascii option by @Viicos in #1689 * Update repr of TzInfo by @Viicos in #1701 * Make ValidationInfo and SerializationInfo generic for context by @Viicos in #1686 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-core?expand=0&rev=19 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/_service b/_service new file mode 100644 index 0000000..2561fc0 --- /dev/null +++ b/_service @@ -0,0 +1,10 @@ + + + + pydantic_core-2.35.1.tar.gz + xz + true + + + + diff --git a/pydantic_core-2.20.0.tar.gz b/pydantic_core-2.20.0.tar.gz new file mode 100644 index 0000000..97be92c --- /dev/null +++ b/pydantic_core-2.20.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:366be8e64e0cb63d87cf79b4e1765c0703dd6313c729b22e7b9e378db6b96877 +size 388463 diff --git a/pydantic_core-2.23.4.tar.gz b/pydantic_core-2.23.4.tar.gz new file mode 100644 index 0000000..ae9f080 --- /dev/null +++ b/pydantic_core-2.23.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863 +size 402156 diff --git a/pydantic_core-2.27.2.tar.gz b/pydantic_core-2.27.2.tar.gz new file mode 100644 index 0000000..6c8365e --- /dev/null +++ b/pydantic_core-2.27.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39 +size 413443 diff --git a/pydantic_core-2.34.1.tar.gz b/pydantic_core-2.34.1.tar.gz new file mode 100644 index 0000000..3775f04 --- /dev/null +++ b/pydantic_core-2.34.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6bf31628ab6d0e7c7c0372419898c52ef0a447b33ab47c7f62053bd013cc5b09 +size 435281 diff --git a/pydantic_core-2.35.1.tar.gz b/pydantic_core-2.35.1.tar.gz new file mode 100644 index 0000000..aded524 --- /dev/null +++ b/pydantic_core-2.35.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54d93282d8307dcd504a645326b92414364ff75c0f3909bdf00016c82f66c96c +size 437737 diff --git a/python-pydantic-core.changes b/python-pydantic-core.changes new file mode 100644 index 0000000..0e622fd --- /dev/null +++ b/python-pydantic-core.changes @@ -0,0 +1,300 @@ +------------------------------------------------------------------- +Mon Jun 23 05:40:13 UTC 2025 - Daniel Garcia + +- Update to 2.35.1: + * Fix generic issues with ValidationInfo and SerializationInfo by @Viicos in #1736 +2.35.0: + * Do not reuse validator and serializer when unpickling by @Viicos in #1693 + * Remove unnecessary required fields count when exclude_none is set by @Viicos in #1708 + * Update test dependencies after 3.8 dropped support by @Viicos in #1710 + * Mark constructor parameters of exceptions as positional-only by @Viicos in #1699 + * fix: submodel fields with wrap validator affect smart union selection by @weiliddat in #1700 + * use pypa/gh-action-pypi-publish by @samuelcolvin in #1599 + * add critical sections around bytearray reads by @davidhewitt in #1717 + * simplify ser-as-any mechanism by @davidhewitt in #1478 + * Coerce 'time' schema constraints by @Viicos in #1720 + * drop serde-json preserve_order feature by @davidhewitt in #1724 + * Remove core schema validation by @Viicos in #1715 + * Improve uncaught PydanticUseDefault exception message by @Viicos in #1730 + * Add support for Python 3.14 by @Viicos in #1714 + * drop pypy3.9 support, add pypy3.11 support by @davidhewitt in #1726 + * Add ensure_ascii option by @Viicos in #1689 + * Update repr of TzInfo by @Viicos in #1701 + * Make ValidationInfo and SerializationInfo generic for context by @Viicos in #1686 + +------------------------------------------------------------------- +Thu Apr 24 04:03:49 UTC 2025 - Steve Kowalik + +- Update to 2.34.1: + * Fixes + + fix clippy lints for Rust 1.86 + + Allow JSON BigInt to validate against float schema + + Ensure ValidationInfo.field_name is correct on validator reuse + + Coerce 'timedelta' schema constraints + + Add support for extra keys validation for model fields + + Revert by_alias default value change for to_json() and + to_jsonable_python() + + Skip reusing after validators in prebuilt schemas + + Skip reusing wrap validators / serializers for prebuilt variants + + Add cls_name to typed-dict schema + + Coerce validator constraints to their valid type + + Use core schema fns to initalize SchemaValidators in the test suite + + Fix enum strict JSON validation when validators are present + + Add support for validating v7 UUIDs + + Refactor LookupKey logic to reduce redundancy + + Add support for UUIDv6 and UUIDv8 validation + + Remove unneeded Option map in PyMultiHostUrl.build + + bump to PyO3 0.23.5, support PyPy 3.11 + + Fix strict behavior for unions + + Improving the alias configuration API for validation and serialization + + Fix float multiple_of validation for negative numbers + + Fix wasm preview + + Raise validation error when unhashable items added to a set + + Fix condition before using prebuilt validator/serializer + + minimal upgrade to PyO3 0.23 (ignoring deprecations) + + Use UserWarning from pyo3 + + Forward default_value calls to the underlying schema for + DefinitionRefValidator + + fix type hint for SerializationInfo.round_trip + + Include JSON Schema input core schema in function schemas + + fix wasteful to_python() calls checking for undefined + + Fix ValueError on year zero + + optimize refcounting op in datetime creation + + Drop 3.8 support + + Fix: dataclass InitVars shouldn't be required on serialization + * Performance + + Clean up PydanticUnexpectedValueError + + Memory usage optimization via reuse of SchemaValidator and + SchemaSerializer + * New Features + + Add new arguments-v3 schema + + Add TzInfo.__new__ stub method + + Support free-threaded Python 3.13t + +------------------------------------------------------------------- +Sat Jan 25 10:32:49 UTC 2025 - ecsos + +- Update ot 2.27.2 + - fix linux PGO wheel build in #1557 + - Forward default_value calls to the underlying schema for DefinitionRefValidator in #1573 + - Include JSON Schema input core schema in function schemas in #1572 + - fix ValueError on year zero in #1583 +- Changes from 2.27.1 + - Simplify shared union serializer logic in #1538 + - Tidy up some uses of Bound<'_, PyString>::to_str in #1544 + - Fix serialization inference for complex types in python in #1549 + - Bump to PyO3 v0.22.6 in #1550 + - Fix performance regression for JSON tagged union in #1552 +- Changes from 2.27.0 + - Remove Url and MultiHostUrl docstrings, we moved them to pydantic in #1531 + - Fix panic in validate_assignment when field has gone missing in #1532 + - Fix for Union serializer: do not raise warnings in nested unions in #1513 + - Fix _IncEx type alias to be compatible with mypy in #1537 + - More union serialization tidying in #1536 + - Fix wrap serializer breaking union serialization in presence of extra fields in #1530 + - Support trailing-strings with allow_partial in #1539 +- Changes from 2.26.0 + * Fixes + - Revert changes to url schemas that support cls, the 2x validation isn't worth it (and is breaking) in #1514 + - Fix when coerce_numbers_to_str enabled and string has invalid unicode character in #1515 + - Fix serializing complex values in enums in #1524 + * Packaging + - Bump serde from 1.0.213 to 1.0.214 in #1519 + - Bump regex from 1.11.0 to 1.11.1 in #1520 + - Bump jiter from 0.6.1 to 0.7.0 in #1521 + - bump speedate to 0.15 in #1526 + * New Features + - Add allow_partial in #1512 +- Changes from 2.25.1 + - Bump jiter from 0.5.0 to 0.6.1 in #1498 + - Update Pyodide to v0.26.3 in #1507 + - Allow subclassing ValidationError and PydanticCustomError in #1413 + - Revert "feat: add 'millisecond' option to ser_json_timedelta" in #1503 + - Support subclass inits for Url and MultiHostUrl in #1508 +- Changes from 2.25.0 + - Properly enforce host_required for URLs in #1488 + - Support revalidation of parametrized generics in #1489 + - Support default factories taking validated data as an argument in #1491 +- Changes from 2.24.2 + - Add serialization key to InvalidSchema in #1482 +- Changes from 2.24.1 + * Packaging + - Restore Windows aarch64 builds in #1464 + - Limit windows builds to Rust 1.77 (to keep Windows 7 support) in #1463 + - Bump pyo3 from 0.22.2 to 0.22.3 in #1472 + - Bump serde from 1.0.209 to 1.0.210 in #1471 + - Bump regex from 1.10.6 to 1.11.0 in #1470 + * Fixes + - Fix equality checks for primitives in literals in #1459 + * Changes + - Add invalid schema placeholder in #1469 + - Relax intensity of error for issubclass and isinstance schemas from json in #1479 +- Changes from 2.24.0 + * Features + - Add milliseconds option to ser_json_timedelta config parameterin #1427 + - Add support for unpacked TypedDict to type hint variadic keyword arguments in ArgumentsValidator in #1451 + * Fixes + - Do not require padding when decoding base64 bytes in #1448 + - Support wider variety of enum validation cases in #1456 + +------------------------------------------------------------------- +Wed Oct 2 21:42:30 UTC 2024 - Meera Belur + +- update 2.23.4 +Clean up serialization warnings for invalid data in unions +Fix variance issue in `_IncEx` type alias, only allow `True` +Bump version to v2.23.3 +Fix `_IncEx` type annotation +Fix tagged union serialization warning when using aliases +Bump serde_json from 1.0.127 to 1.0.128 +Improve test_valid_complex_string_with_space +Negative integers with leading zeros raise ValueError +Bump serde_json from 1.0.121 to 1.0.127 +Bump regex from 1.10.5 to 1.10.6 +Bump uuid from 1.9.1 to 1.10.0 +Bump idna from 1.0.1 to 1.0.2 +Bump serde from 1.0.204 to 1.0.209 +Bump the python-packages group with 8 updates +Try removing flaky xfail test +Version bump for docs update +Adding missing API docs to `pydantic_core` +Prep for `v2.23.1` patch release +Refactor `BigInt` boilerplate +Support `BigInt` serialization for `int` subclasses +Use more explicit warning regarding serialization warning for missing fields +Prep for v2.23.0 +Breaking change: Change `metadata` type hint from `Any` -> `Dict[str, Any] | None` +Adding `cls` reference to `TypedDictSchema` +Disable automatic assignees with `hooky` +Version bump to prep for new release +Introduce `exactness` into `Decimal` validation logic +Adding tagged union serializer 🚀 +Support complex numbers +Use `typing_extensions.TypedDict` on Python < 3.12 +For missing fields, we don't warn on `exclude_`, so don't warn on `exclude` +Fix float serialization behavior in strict mode +stop clone-ing serializers +Try each option in union serializer before inference +Show value of wrongly typed in serialization warning +Validate base64 standard encoding +dont embed `RUSTFLAGS` in final binary +Expose AnySerializer via core schema +Revert "use little endian int +Uprev to v2.21.0 +Support `allow_partial='trailing-strings'` +Bump base64 from 0.21.7 to 0.22.1 +clean up some string handling cases +Bump serde from 1.0.203 to 1.0.204 +Bump serde_json from 1.0.118 to 1.0.121 +Bump pyo3 from 0.22.0 to 0.22.2 +Bump version_check from 0.9.4 to 0.9.5 +Bump the python-packages group with 7 updates +Bump CodSpeedHQ/action from 2 to 3 +Validate bytes based on ser_json_bytes +Fix lints firing since rust 1.80 +Bump idna from 0.5.0 to 1.0.1 +use little endian int +Fix model field serializer with computed field +use Uuid:::from_u128 for uuid_to_string +string: Use 're.Pattern.search' instead of 're.Pattern.match' +Fixes discriminated union bug regression when using enums +Bump `speedate` to v0.14.1 and prep for v0.20.1 +Bump the python-packages group across 1 directory with 7 updates +Bump num-bigint from 0.4.5 to 0.4.6 +Bump uuid from 1.9.0 to 1.9.1 +Bump `pytest-examples` to get tests passing with ruff `v0.5.0` +try restore 3.13 PGO builds + +------------------------------------------------------------------- +Mon Jul 1 17:05:35 UTC 2024 - Dirk Müller + +- update to 2.20.0: + * Tidy up `tagged_union_schema` + * Improvements in `Union` matching logic during validation + * Fix `Union` validation logic when `extra='allow'` + * Add list `fail_fast` config option + * Update to PyO3 0.22, add Python 3.13 support +- update to 2.19.0: + * Lower MSRV to 1.75 + * Bump `libc` from 0.2.147 to 0.2.155 + * Make `ValidatorFunctionWrapHandler` positional only + * Reuse `re.Pattern` object in regex patterns + * Add ser_json_inf_nan='strings' mode to produce valid JSON + +------------------------------------------------------------------- +Thu Jun 6 14:46:29 UTC 2024 - Dirk Müller + +- update to 2.18.4: + * Bump uuid from 1.7.0 to 1.8.0 + * Bump serde from 1.0.197 to 1.0.203 + * Bump the python-packages group with 6 updates + * Uprev `jiter` to v0.4.1 +- update to 2.18.3: + * Bump `serde_json` from 1.0.114 to 1.0.116 + * Bump the python-packages group with 7 updates + * Bump `regex` from 1.10.3 to 1.10.4 + * Bump `pyo3` from 0.21.1 to 0.21.2 + * Bump `uraimo/run-on-arch-action` from 2.7.1 to 2.7.2 + +------------------------------------------------------------------- +Sat Apr 27 07:55:51 UTC 2024 - Dirk Müller + +- update to 2.18.2: + * Support multiple zeros as an `int` + * Fix validation of `int`s with leading unary plus + * Fix interaction between `extra != 'ignore'` and + `from_attributes=True` + * Handle error from `Enum`'s `missing` function as + `ValidationError` + * Fix memory leak with `Iterable` validation +- update to 2.18.1: + * allow serialization functions to upgrade warnings to + exceptions + * Fix: add `coerce_numbers_to_str option` in `StringSchema` + * Trim leading zeros before parsing `str` -> `int` + * Prevent trailing dots in integers +- update to 2.18.0: + * update to PyO3 0.21 final + * Add coerce_numbers_to_str option in str_schema + * caching strings from JSON + * fix build warnings on python <3.11 + * Fixes for `ser_json_inf_nan` inference + * Adopt jiter `0.2.0` +- update to 2.17.0: + * Add benchmarks for serializing model with complete schema + * Prevent panicking when `__dict__` changes during iteration + * Fix `TzInfo` equality check based on offset + * Fix stack overflow due to recursion in some recursive + serializer schemas. + * Use PEP570 syntax + * Fix parsing `BigInt` from `str` + * Use new typing syntax for `_pydantic_core.pyi` + * separate `Input` trait `'a` and `'py` lifetimes + * Fix json serialization when `computed_field` is excluded + * Implement `Input` for `str` + * Move list validation to produce an associated type + * Remove `with_new_extra` + * Associated types for arguments in Input + * Associated types for dict in input + * Remaining associated types + * Refactor `Input` trait to have single `as_python` cast for + python inputs + * Allow case where `__pydantic_extra__` is `None`, even if + `extra='allow'` + * Add ability to pass `context` to serialization + * Add `serialize_as_any` runtime flag support + +------------------------------------------------------------------- +Tue Mar 12 00:24:28 UTC 2024 - Steve Kowalik + +- Sprinkle in multibuild to avoid build cycles. + +------------------------------------------------------------------- +Sat Mar 9 13:15:13 UTC 2024 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Wed Mar 6 06:34:37 UTC 2024 - Steve Kowalik + +- Initial release of 2.16.3 diff --git a/python-pydantic-core.spec b/python-pydantic-core.spec new file mode 100644 index 0000000..7d11c2a --- /dev/null +++ b/python-pydantic-core.spec @@ -0,0 +1,92 @@ +# +# spec file for package python-pydantic-core +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "test" +%define psuffix -test +%bcond_without test +%else +%define psuffix %{nil} +%bcond_with test +%endif +%{?sle15_python_module_pythons} +Name: python-pydantic-core%{psuffix} +Version: 2.35.1 +Release: 0 +Summary: Core functionality for pydantic validation and serialization +License: MIT +URL: https://github.com/pydantic/pydantic-core +Source0: https://files.pythonhosted.org/packages/source/p/pydantic-core/pydantic_core-%{version}.tar.gz +Source1: vendor.tar.xz +BuildRequires: %{python_module base >= 3.9} +BuildRequires: %{python_module inline-snapshot} +BuildRequires: %{python_module maturin >= 1} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module typing-extensions >= 4.6.0} +BuildRequires: cargo-packaging +BuildRequires: python-rpm-macros +# SECTION test requirements +%if %{with test} +BuildRequires: %{python_module dirty-equals} +BuildRequires: %{python_module hypothesis} +BuildRequires: %{python_module pydantic-core == %{version}} +BuildRequires: %{python_module pytest-benchmark} +BuildRequires: %{python_module pytest-mock} +BuildRequires: %{python_module pytest-run-parallel} +BuildRequires: %{python_module pytest-timeout} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module typing-inspection} +%endif +# /SECTION +BuildRequires: fdupes +Requires: python-typing-extensions >= 4.6.0 +%python_subpackages + +%description +This package provides the core functionality for +[pydantic](https://docs.pydantic.dev) validation and serialization. + +Pydantic-core is currently around 17x faster than pydantic V1. + +%prep +%autosetup -p1 -n pydantic_core-%{version} -a1 + +%build +# The build takes quite a long time, so we don't want to build this while under test. +%if %{without test} +%pyproject_wheel +%endif + +%install +%if %{without test} +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} +%endif + +%check +%if %{with test} +%pytest_arch +%endif + +%if %{without test} +%files %{python_files} +%{python_sitearch}/pydantic_core +%{python_sitearch}/pydantic_core-%{version}.dist-info +%endif + +%changelog diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 100644 index 0000000..d9223d5 --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d75dea6f001abc249b646697bc6c09b5305264e8b6496cfc273becb586e5808 +size 5552140