Bump pydantic from 2.4.2 to 2.5.0
Bumps pydantic from 2.4.2 to 2.5.0.
Release notes
Sourced from pydantic's releases.
v2.5.0 2023-11-13
v2.5.0 (2023-11-13)
The code released in v2.5.0 is functionally identical to that of v2.5.0b1.
What's Changed
Packaging
- Update pydantic-core from 2.10.1 to 2.14.1, significant changes from these updates are described below, full changelog here
- Update to
pyright==1.1.335
by@Viicos
in #8075New Features
- Allow plugins to catch non
ValidationError
errors by@adriangb
in #7806- Support
__doc__
argument increate_model()
by@chris-spann
in #7863- Expose
regex_engine
flag - meaning you can use with the Rust or Python regex libraries in constraints by@utkini
in #7768- Save return type generated from type annotation in
ComputedFieldInfo
by@alexmojaki
in #7889- Adopting
ruff
formatter by@Luca-Blight
in #7930- Added
validation_error_cause
to config by@zakstucke
in #7626- Make path of the item to validate available in plugin by
@hramezani
in #7861- Add
CallableDiscriminator
andTag
by@dmontagu
in #7983
CallableDiscriminator
renamed toDiscriminator
by@dmontagu
in #8047- Make union case tags affect union error messages by
@dmontagu
in #8001- Add
examples
andjson_schema_extra
to@computed_field
by@alexmojaki
in #8013- Add
JsonValue
type by@dmontagu
in #7998- Allow
str
as argument toDiscriminator
by@dmontagu
in #8047- Add
SchemaSerializer.__reduce__
method to enable pickle serialization by@edoakes
in pydantic/pydantic-core#1006Changes
- Significant Change: replace
ultra_strict
with new smart union implementation, the way unions are validated has changed significantly to improve performance and correctness, we have worked hard to absolutely minimise the number of cases where behaviour has changed, see the PR for details - by@davidhewitt
in pydantic/pydantic-core#867- Add support for instance method reassignment when
extra='allow'
by@sydney-runkle
in #7683- Support JSON schema generation for
Enum
types with no cases by@sydney-runkle
in #7927- Warn if a class inherits from
Generic
beforeBaseModel
by@alexmojaki
in #7891Performance
- New custom JSON parser,
jiter
by@samuelcolvin
in pydantic/pydantic-core#974- PGO build for MacOS M1 by
@samuelcolvin
in pydantic/pydantic-core#1063- Use
__getattr__
for all package imports, improve import time by@samuelcolvin
in #7947Fixes
- Fix
mypy
issue with subclasses ofRootModel
by@sydney-runkle
in #7677- Properly rebuild the
FieldInfo
when a forward ref gets evaluated by@dmontagu
in #7698- Fix failure to load
SecretStr
from JSON (regression in v2.4) by@sydney-runkle
in #7729- Fix
defer_build
behavior withTypeAdapter
by@sydney-runkle
in #7736
... (truncated)
Changelog
Sourced from pydantic's changelog.
v2.5.0 (2023-11-13)
The code released in v2.5.0 is functionally identical to that of v2.5.0b1.
What's Changed
Packaging
- Update pydantic-core from 2.10.1 to 2.14.1, significant changes from these updates are described below, full changelog here
- Update to
pyright==1.1.335
by@Viicos
in #8075New Features
- Allow plugins to catch non
ValidationError
errors by@adriangb
in #7806- Support
__doc__
argument increate_model()
by@chris-spann
in #7863- Expose
regex_engine
flag - meaning you can use with the Rust or Python regex libraries in constraints by@utkini
in #7768- Save return type generated from type annotation in
ComputedFieldInfo
by@alexmojaki
in #7889- Adopting
ruff
formatter by@Luca-Blight
in #7930- Added
validation_error_cause
to config by@zakstucke
in #7626- Make path of the item to validate available in plugin by
@hramezani
in #7861- Add
CallableDiscriminator
andTag
by@dmontagu
in #7983
CallableDiscriminator
renamed toDiscriminator
by@dmontagu
in #8047- Make union case tags affect union error messages by
@dmontagu
in #8001- Add
examples
andjson_schema_extra
to@computed_field
by@alexmojaki
in #8013- Add
JsonValue
type by@dmontagu
in #7998- Allow
str
as argument toDiscriminator
by@dmontagu
in #8047- Add
SchemaSerializer.__reduce__
method to enable pickle serialization by@edoakes
in pydantic/pydantic-core#1006Changes
- Significant Change: replace
ultra_strict
with new smart union implementation, the way unions are validated has changed significantly to improve performance and correctness, we have worked hard to absolutely minimise the number of cases where behaviour has changed, see the PR for details - by@davidhewitt
in pydantic/pydantic-core#867- Add support for instance method reassignment when
extra='allow'
by@sydney-runkle
in #7683- Support JSON schema generation for
Enum
types with no cases by@sydney-runkle
in #7927- Warn if a class inherits from
Generic
beforeBaseModel
by@alexmojaki
in #7891Performance
- New custom JSON parser,
jiter
by@samuelcolvin
in pydantic/pydantic-core#974- PGO build for MacOS M1 by
@samuelcolvin
in pydantic/pydantic-core#1063- Use
__getattr__
for all package imports, improve import time by@samuelcolvin
in #7947Fixes
- Fix
mypy
issue with subclasses ofRootModel
by@sydney-runkle
in #7677- Properly rebuild the
FieldInfo
when a forward ref gets evaluated by@dmontagu
in #7698- Fix failure to load
SecretStr
from JSON (regression in v2.4) by@sydney-runkle
in #7729- Fix
defer_build
behavior withTypeAdapter
by@sydney-runkle
in #7736- Improve compatibility with legacy
mypy
versions by@dmontagu
in #7742
... (truncated)
Commits
-
d465ec5
v2.5.0
release (#8091) -
b514c43
Add note to docs explaining the use of"validation"
vs"parse"
(#8080) -
e637156
Cross link API docs and concepts docs more throughly (#8082) -
951bc15
SimplifyConfigWrapperStack.push
context manager (#8018) -
2358e63
Update topyright==1.1.335
(#8075) -
ab843af
Add deprecation warning + makemkdocs build
strict (#8077) -
9eec4d6
Add concepts page on JSON (#8060) -
41f1dc3
Update union documentation for reimplemented "smart" mode (#8070) -
82b0a11
WIP: prep for2.5.0b1
release (#8063) -
b520f2e
bump pydantic-core to 2.14.1 (#8069) - Additional commits viewable in compare view