Path to this page:
Subject: CVS commit: pkgsrc/devel/py-pydantic
From: Adam Ciarcinski
Date: 2024-11-21 07:04:33
Message id: 20241121060433.F3B3BFC7D@cvs.NetBSD.org
Log Message:
py-pydantic: updted to 2.10.0
v2.10.0
Packaging
* Bump `pydantic-core` to `v2.27.0`
* Replaced pdm with uv
New Features
* Support `fractions.Fraction`
* Support `Hashable` for json validation
* Add a `SocketPath` type for `linux` systems
* Allow arbitrary refs in JSON schema `examples`
* Support `defer_build` for Pydantic dataclasses
* Adding v1 / v2 incompatibility warning for nested v1 model
* Add support for unpacked `TypedDict` to type hint variadic keyword arguments \
with `@validate_call`
* Support compiled patterns in `protected_namespaces`
* Add support for `propertyNames` in JSON schema
* Adding `__replace__` protocol for Python 3.13+ support
* Expose public `sort` method for JSON schema generation
* Add runtime validation of `@validate_call` callable argument
* Add `experimental_allow_partial` support
* Support default factories taking validated data as an argument
* Allow subclassing `ValidationError` and `PydanticCustomError`
* Add `trailing-strings` support to `experimental_allow_partial`
* Add `rebuild()` method for `TypeAdapter` and simplify `defer_build` patterns
* Improve `TypeAdapter` instance repr
Changes
* Don't allow customization of `SchemaGenerator` until interface is more stable
* Cleanly `defer_build` on `TypeAdapters`, removing experimental flag
* Fix `mro` of generic subclass
* Strip whitespaces on JSON Schema title generation
* Use `b64decode` and `b64encode` for `Base64Bytes` type
* Relax protected namespace config default
* Revalidate parametrized generics if instance's origin is subclass of OG class
* Warn if configuration is specified on the `@dataclass` decorator and with the \
`__pydantic_config__` attribute
* Recommend against using `Ellipsis` (...) with `Field`
* Migrate to subclassing instead of annotated approach for pydantic url types
* Change JSON schema generation of `Literal`s and `Enums`
* Simplify unions involving `Any` or `Never` when replacing type variables
* Do not require padding when decoding `base64` bytes
* Support dates all the way to 1BC
Performance
* Schema cleaning: skip unnecessary copies during schema walking
* Refactor namespace logic for annotations evaluation
* Improve email regexp on edge cases
* `CoreMetadata` refactor with an emphasis on documentation, schema build time \
performance, and reducing complexity
Fixes
* Remove guarding check on `computed_field` with `field_serializer`
* Fix `Predicate` issue in `v2.9.0`
* Fixing `annotated-types` bound
* Turn `tzdata` install requirement into optional `timezone` dependency
* Use correct types namespace when building `namedtuple` core schemas
* Fix evaluation of stringified annotations during namespace inspection
* Fix `IncEx` type alias definition
* Do not error when trying to evaluate annotations of private attributes
* Fix nested type statement
* Improve typing of `ModelMetaclass.mro`
* Fix class access of deprecated `computed_field`s
* Make sure `inspect.iscoroutinefunction` works on coroutines decorated with \
`@validate_call`
* Fix `NameError` when using `validate_call` with PEP 695 on a class
* Fix `ZoneInfo` with various invalid types
* Fix `PydanticUserError` on empty `model_config` with annotations
* Fix variance issue in `_IncEx` type alias, only allow `True`
* Fix serialization schema generation when using `PlainValidator`
* Fix schema generation error when serialization schema holds references
* Inline references if possible when generating schema for `json_schema_input_type`
* Fix recursive arguments in `Representation`
* Fix representation for builtin function types
* Add python validators for decimal constraints (`max_digits` and `decimal_places`)
* Only fetch `__pydantic_core_schema__` from the current class during schema \
generation
* Fix `stacklevel` on deprecation warnings for `BaseModel`
* Fix warning `stacklevel` in `BaseModel.__init__`
* Improve error handling for in-evaluable refs for discriminator application
* Change the signature of `ConfigWrapper.core_config` to take the title directly
* Do not use the previous config from the stack for dataclasses without config
* Fix serialization for IP types with `mode='python'`
* Support constraint application for `Base64Etc` types
* Fix `validate_call` ignoring `Field` in `Annotated`
* Raise an error when `Self` is invalid
* Using `core_schema.InvalidSchema` instead of metadata injection + checks
* Tweak type alias logic
* Support usage of `type` with `typing.Self` and type aliases
* Use overloads for `Field` and `PrivateAttr` functions
* Clean up the `mypy` plugin implementation
* Properly check for `typing_extensions` variant of `TypeAliasType`
* Allow any mapping in `BaseModel.model_copy()`
* Fix `isinstance` behavior for urls
* Ensure `cached_property` can be set on Pydantic models
* Fix equality checks for primitives in literals
* Properly enforce `host_required` for URLs
* Fix when `coerce_numbers_to_str` enabled and string has invalid Unicode character
* Fix serializing `complex` values in `Enum`s
* Refactor `_typing_extra` module
* Support intuitive equality for urls
* Add `bytearray` to `TypeAdapter.validate_json` signature
* Ensure class access of method descriptors is performed when used as a default \
with `Field`
* Fix circular import with `validate_call`
* Fix error when using type aliases referencing other type aliases
* Fix `IncEx` type alias to be compatible with mypy
* Make `__signature__` a lazy property, do not deepcopy defaults
* Make `__signature__` lazy for dataclasses, too
* Subclass all single host url classes from `AnyUrl` to preserve behavior from v2.9
Files: