./devel/py-pydantic, Data validation and settings management using python type hints

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 2.10.3, Package name: py312-pydantic-2.10.3, Maintainer: pkgsrc-users

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.6+; validate it with *pydantic*.


Master sites:

Filesize: 768.053 KB

Version history: (Expand)


CVS history: (Expand)


   2024-12-04 12:25:32 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.10.3

v2.10.3 (2024-12-03)

Fixes

* Set fields when `defer_build` is set on Pydantic dataclasses
* Do not resolve the JSON Schema reference for `dict` core schema keys
* Use the globals of the function when evaluating the return type for \ 
`PlainSerializer` and `WrapSerializer` functions
* Fix host required enforcement for urls to be compatible with v2.9 behavior
* Add a `default_factory_takes_validated_data` property to `FieldInfo`
* Fix url json schema in `serialization` mode

v2.10.2 (2024-11-25)

Fixes

* Only evaluate FieldInfo annotations if required during schema building
* Do not evaluate annotations for private fields
* Support serialization as any for `Secret` types and `Url` types
* Fix type hint of `Field.default` to be compatible with Python 3.8 and 3.9
* Add hashing support for URL types
* Hide `BaseModel.__replace__` definition from type checkers
   2024-11-22 08:51:05 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.10.1

v2.10.1

Packaging

* Bump `pydantic-core` version to `v2.27.1`

Fixes

* Use the correct frame when instantiating a parametrized `TypeAdapter`
* Relax check for validated data in `default_factory` utils
* Fix type checking issue with `model_fields` and `model_computed_fields`
* Use the parent configuration during schema generation for stdlib `dataclass`es
* Use the `globals` of the function when evaluating the return type of \ 
serializers and `computed_field`s
* Fix URL constraint application
* Fix URL equality with different validation methods
* Fix JSON schema title when specified as `''`
* Fix `python` mode serialization for `complex` inference
   2024-11-21 07:04:33 by Adam Ciarcinski | Files touched by this commit (3)
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
   2024-09-19 17:05:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.9.2

v2.9.2 (2024-09-17)

Fixes
* Do not error when trying to evaluate annotations of private attributes
* Adding notes on designing sound `Callable` discriminators
* Fix serialization schema generation when using `PlainValidator`
* Fix `Union` serialization warnings
* Fix variance issue in `_IncEx` type alias, only allow `True`
* Fix `ZoneInfo` validation with various invalid types
   2024-09-09 18:51:29 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.9.1

v2.9.1

Fix Predicate issue in v2.9.0
Fixing annotated-types bound to >=0.6.0
Turn tzdata install requirement into optional timezone dependency
Fix IncExc type alias definition
Use correct types namespace when building namedtuple core schemas
Fix evaluation of stringified annotations during namespace inspection
Fix tagged union serialization with alias generators
   2024-09-07 07:34:25 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-pydantic: updated to 2.9.0

v2.9.0 (2024-09-05)

Packaging

* Bump `ruff` to `v0.5.0` and `pyright` to `v1.1.369`
* Bump `pydantic-extra-types` to `v2.9.0`
* Support compatibility with `pdm v2.18.1`
* Bump `v1` version stub to `v1.10.18`
* Bump `pydantic-core` to `v2.23.2`

New Features

* Add support for `ZoneInfo`
* Add `Config.val_json_bytes`
* Add DSN for Snowflake
* Support `complex` number
* Add support for `annotated_types.Not`
* Allow `WithJsonSchema` to inject `$ref`s w/ `http` or `https` links
* Allow validators to customize validation JSON schema
* Support parametrized `PathLike` types
* Add tagged union serializer that attempts to use `str` or `callable` \ 
discriminators to select the correct serializer

Changes

* Breaking Change: Merge `dict` type `json_schema_extra`
 * For more info (how to replicate old behavior) on this change, see \ 
[here](https://docs.pydantic.dev/dev/concepts/json_schema/#merging-json_schema_extra)
* Refactor annotation injection for known (often generic) types
* Move annotation compatibility errors to validation phase
* Improve runtime errors for string constraints like `pattern` for incompatible types
* Remove `'allOf'` JSON schema workarounds
* Remove `typed_dict_cls` data from `CoreMetadata`
* Deprecate passing a dict to the `Examples` class
* Remove `initial_metadata` from internal metadata construct
* Use `re.Pattern.search` instead of `re.Pattern.match` for consistency with \ 
`rust` behavior
* Show value of wrongly typed data in `pydantic-core` serialization warning
* Breaking Change: in `pydantic-core`, change `metadata` type hint in core \ 
schemas from `Any` -> `Dict[str, Any] | None`
* Raise helpful warning when `self` isn't returned from model validator

Performance

* Initial start at improving import times for modules, using caching primarily
* Using cached internal import for `BaseModel`
* Simplify internal generics logic - remove generator overhead
* Remove default module globals from types namespace
* Performance boost: skip caching parent namespaces in most cases
* Update ns stack with already copied ns
   2024-07-04 13:24:20 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-pydantic: updated to 2.8.2

v2.8.2

Fixes

Fix issue with assertion caused by pluggable schema validator

v2.8.1

Packaging

Bump ruff to v0.5.0 and pyright to v1.1.369
Bump pydantic-core to v2.20.1, pydantic-extra-types to v2.9.0

Fixes

Fix breaking change in to_snake from v2.7 -> v2.8
Fix list constraint json schema application
Support time duration more than 23
Fix millisecond fraction being handled with the wrong scale
Handle negative fractional durations correctly

v2.8.0

Packaging

Update citation version automatically with new releases
Bump pyright to v1.1.367 and add type checking tests for pipeline API
Update pydantic.v1 stub to v1.10.17
General package updates to prep for v2.8.0b1
Bump pydantic-core to v2.20.0
Add support for Python 3.13
Update pdm version used for pdm.lock to v2.16.1
Update to ruff v0.4.8

New Features

Experimental: support defer_build for TypeAdapter
Implement deprecated field in json schema
Experimental: Add pipeline API
Add support for programmatic title generation
Implement fail_fast feature
Add ser_json_inf_nan='strings' mode to produce valid JSON

Changes

Add warning when "alias" is set in ignored Annotated field
Support serialization of some serializable defaults in JSON schema
Relax type specification for __validators__ values in create_model
Breaking Change: Improve smart union matching logic
You can read more about our smart union matching logic here. In some cases, if \ 
the old behavior
is desired, you can switch to left-to-right mode and change the order of your \ 
Union members.
   2024-06-12 17:13:50 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-pydantic: updated to 2.7.4

v2.7.4 (2024-06-12)

Packaging

* Bump `pydantic.v1` to `v1.10.16` reference

Fixes

* Specify `recursive_guard` as kwarg in `FutureRef._evaluate`