Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependency pydantic to v2.7.0 (#330)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pydantic](https://github.com/pydantic/pydantic) ([changelog](https://docs.pydantic.dev/latest/changelog/)) | `2.6.4` -> `2.7.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/pydantic/2.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pydantic/2.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pydantic/2.6.4/2.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pydantic/2.6.4/2.7.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pydantic/pydantic (pydantic)</summary> ### [`v2.7.0`](https://github.com/pydantic/pydantic/blob/HEAD/HISTORY.md#v270-2024-04-11) [Compare Source](https://github.com/pydantic/pydantic/compare/v2.6.4...v2.7.0) [GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.7.0) The code released in v2.7.0 is practically identical to that of v2.7.0b1. ##### What's Changed ##### Packaging - Reorganize `pyproject.toml` sections by [@​Viicos](https://github.com/Viicos) in [#​8899](https://github.com/pydantic/pydantic/pull/8899) - Bump `pydantic-core` to `v2.18.1` by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9211](https://github.com/pydantic/pydantic/pull/9211) - Adopt `jiter` `v0.2.0` by [@​samuelcolvin](https://github.com/samuelcolvin) in [pydantic/pydantic-core#1250](https://github.com/pydantic/pydantic-core/pull/1250) ##### New Features - Extract attribute docstrings from `FieldInfo.description` by [@​Viicos](https://github.com/Viicos) in [#​6563](https://github.com/pydantic/pydantic/pull/6563) - Add a `with_config` decorator to comply with typing spec by [@​Viicos](https://github.com/Viicos) in [#​8611](https://github.com/pydantic/pydantic/pull/8611) - Allow an optional separator splitting the value and unit of the result of `ByteSize.human_readable` by [@​jks15satoshi](https://github.com/jks15satoshi) in [#​8706](https://github.com/pydantic/pydantic/pull/8706) - Add generic `Secret` base type by [@​conradogarciaberrotaran](https://github.com/conradogarciaberrotaran) in [#​8519](https://github.com/pydantic/pydantic/pull/8519) - Make use of `Sphinx` inventories for cross references in docs by [@​Viicos](https://github.com/Viicos) in [#​8682](https://github.com/pydantic/pydantic/pull/8682) - Add environment variable to disable plugins by [@​geospackle](https://github.com/geospackle) in [#​8767](https://github.com/pydantic/pydantic/pull/8767) - Add support for `deprecated` fields by [@​Viicos](https://github.com/Viicos) in [#​8237](https://github.com/pydantic/pydantic/pull/8237) - Allow `field_serializer('*')` by [@​ornariece](https://github.com/ornariece) in [#​9001](https://github.com/pydantic/pydantic/pull/9001) - Handle a case when `model_config` is defined as a model property by [@​alexeyt101](https://github.com/alexeyt101) in [#​9004](https://github.com/pydantic/pydantic/pull/9004) - Update `create_model()` to support `typing.Annotated` as input by [@​wannieman98](https://github.com/wannieman98) in [#​8947](https://github.com/pydantic/pydantic/pull/8947) - Add `ClickhouseDsn` support by [@​solidguy7](https://github.com/solidguy7) in [#​9062](https://github.com/pydantic/pydantic/pull/9062) - Add support for `re.Pattern[str]` to `pattern` field by [@​jag-k](https://github.com/jag-k) in [#​9053](https://github.com/pydantic/pydantic/pull/9053) - Support for `serialize_as_any` runtime setting by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8830](https://github.com/pydantic/pydantic/pull/8830) - Add support for `typing.Self` by [@​Youssefares](https://github.com/Youssefares) in [#​9023](https://github.com/pydantic/pydantic/pull/9023) - Ability to pass `context` to serialization by [@​ornariece](https://github.com/ornariece) in [#​8965](https://github.com/pydantic/pydantic/pull/8965) - Add feedback widget to docs with flarelytics integration by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9129](https://github.com/pydantic/pydantic/pull/9129) - Support for parsing partial JSON strings in Python by [@​samuelcolvin](https://github.com/samuelcolvin) in [pydantic/jiter#66](https://github.com/pydantic/jiter/pull/66) **Finalized in v2.7.0, rather than v2.7.0b1:** - Add support for field level number to str coercion option by [@​NeevCohen](https://github.com/NeevCohen) in [#​9137](https://github.com/pydantic/pydantic/pull/9137) - Update `warnings` parameter for serialization utilities to allow raising a warning by [@​Lance-Drane](https://github.com/Lance-Drane) in [#​9166](https://github.com/pydantic/pydantic/pull/9166) ##### Changes - Correct docs, logic for `model_construct` behavior with `extra` by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8807](https://github.com/pydantic/pydantic/pull/8807) - Improve error message for improper `RootModel` subclasses by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8857](https://github.com/pydantic/pydantic/pull/8857) - Use `PEP570` syntax by [@​Viicos](https://github.com/Viicos) in [#​8940](https://github.com/pydantic/pydantic/pull/8940) - Add `enum` and `type` to the JSON schema for single item literals by [@​dmontagu](https://github.com/dmontagu) in [#​8944](https://github.com/pydantic/pydantic/pull/8944) - Deprecate `update_json_schema` internal function by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9125](https://github.com/pydantic/pydantic/pull/9125) - Serialize duration to hour minute second, instead of just seconds by [@​kakilangit](https://github.com/kakilangit) in [pydantic/speedate#50](https://github.com/pydantic/speedate/pull/50) - Trimming str before parsing to int and float by [@​hungtsetse](https://github.com/hungtsetse) in [pydantic/pydantic-core#1203](https://github.com/pydantic/pydantic-core/pull/1203) ##### Performance - `enum` validator improvements by [@​samuelcolvin](https://github.com/samuelcolvin) in [#​9045](https://github.com/pydantic/pydantic/pull/9045) - Move `enum` validation and serialization to Rust by [@​samuelcolvin](https://github.com/samuelcolvin) in [#​9064](https://github.com/pydantic/pydantic/pull/9064) - Improve schema generation for nested dataclasses by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9114](https://github.com/pydantic/pydantic/pull/9114) - Fast path for ASCII python string creation in JSON by [@​samuelcolvin](https://github.com/samuelcolvin) in in [pydantic/jiter#72](https://github.com/pydantic/jiter/pull/72) - SIMD integer and string JSON parsing on `aarch64`(**Note:** SIMD on x86 will be implemented in a future release) by [@​samuelcolvin](https://github.com/samuelcolvin) in in [pydantic/jiter#65](https://github.com/pydantic/jiter/pull/65) - Support JSON `Cow<str>` from `jiter` by [@​davidhewitt](https://github.com/davidhewitt) in [pydantic/pydantic-core#1231](https://github.com/pydantic/pydantic-core/pull/1231) - MAJOR performance improvement: update to PyO3 0.21 final by [@​davidhewitt](https://github.com/davidhewitt) in [pydantic/pydantic-core#1248](https://github.com/pydantic/pydantic-core/pull/1248) - cache Python strings by [@​samuelcolvin](https://github.com/samuelcolvin) in [pydantic/pydantic-core#1240](https://github.com/pydantic/pydantic-core/pull/1240) ##### Fixes - Fix strict parsing for some `Sequence`s by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8614](https://github.com/pydantic/pydantic/pull/8614) - Add a check on the existence of `__qualname__` by [@​anci3ntr0ck](https://github.com/anci3ntr0ck) in [#​8642](https://github.com/pydantic/pydantic/pull/8642) - Handle `__pydantic_extra__` annotation being a string or inherited by [@​alexmojaki](https://github.com/alexmojaki) in [#​8659](https://github.com/pydantic/pydantic/pull/8659) - Fix json validation for `NameEmail` by [@​Holi0317](https://github.com/Holi0317) in [#​8650](https://github.com/pydantic/pydantic/pull/8650) - Fix type-safety of attribute access in `BaseModel` by [@​bluenote10](https://github.com/bluenote10) in [#​8651](https://github.com/pydantic/pydantic/pull/8651) - Fix bug with `mypy` plugin and `no_strict_optional = True` by [@​dmontagu](https://github.com/dmontagu) in [#​8666](https://github.com/pydantic/pydantic/pull/8666) - Fix `ByteSize` error `type` change by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8681](https://github.com/pydantic/pydantic/pull/8681) - Fix inheriting annotations in dataclasses by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8679](https://github.com/pydantic/pydantic/pull/8679) - Fix regression in core schema generation for indirect definition references by [@​dmontagu](https://github.com/dmontagu) in [#​8702](https://github.com/pydantic/pydantic/pull/8702) - Fix unsupported types bug with plain validator by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8710](https://github.com/pydantic/pydantic/pull/8710) - Reverting problematic fix from 2.6 release, fixing schema building bug by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8718](https://github.com/pydantic/pydantic/pull/8718) - fixes `__pydantic_config__` ignored for TypeDict by [@​13sin](https://github.com/13sin) in [#​8734](https://github.com/pydantic/pydantic/pull/8734) - Fix test failures with `pytest v8.0.0` due to `pytest.warns()` starting to work inside `pytest.raises()` by [@​mgorny](https://github.com/mgorny) in [#​8678](https://github.com/pydantic/pydantic/pull/8678) - Use `is_valid_field` from 1.x for `mypy` plugin by [@​DanielNoord](https://github.com/DanielNoord) in [#​8738](https://github.com/pydantic/pydantic/pull/8738) - Better-support `mypy` strict equality flag by [@​dmontagu](https://github.com/dmontagu) in [#​8799](https://github.com/pydantic/pydantic/pull/8799) - model_json_schema export with Annotated types misses 'required' parameters by [@​LouisGobert](https://github.com/LouisGobert) in [#​8793](https://github.com/pydantic/pydantic/pull/8793) - Fix default inclusion in `FieldInfo.__repr_args__` by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8801](https://github.com/pydantic/pydantic/pull/8801) - Fix resolution of forward refs in dataclass base classes that are not present in the subclass module namespace by [@​matsjoyce-refeyn](https://github.com/matsjoyce-refeyn) in [#​8751](https://github.com/pydantic/pydantic/pull/8751) - Fix `BaseModel` type annotations to be resolvable by `typing.get_type_hints` by [@​devmonkey22](https://github.com/devmonkey22) in [#​7680](https://github.com/pydantic/pydantic/pull/7680) - Fix: allow empty string aliases with `AliasGenerator` by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8810](https://github.com/pydantic/pydantic/pull/8810) - Fix test along with `date` -> `datetime` timezone assumption fix by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8823](https://github.com/pydantic/pydantic/pull/8823) - Fix deprecation warning with usage of `ast.Str` by [@​Viicos](https://github.com/Viicos) in [#​8837](https://github.com/pydantic/pydantic/pull/8837) - Add missing `deprecated` decorators by [@​Viicos](https://github.com/Viicos) in [#​8877](https://github.com/pydantic/pydantic/pull/8877) - Fix serialization of `NameEmail` if name includes an email address by [@​NeevCohen](https://github.com/NeevCohen) in [#​8860](https://github.com/pydantic/pydantic/pull/8860) - Add information about class in error message of schema generation by [@​Czaki](https://github.com/Czaki) in [#​8917](https://github.com/pydantic/pydantic/pull/8917) - Make `TypeAdapter`'s typing compatible with special forms by [@​adriangb](https://github.com/adriangb) in [#​8923](https://github.com/pydantic/pydantic/pull/8923) - Fix issue with config behavior being baked into the ref schema for `enum`s by [@​dmontagu](https://github.com/dmontagu) in [#​8920](https://github.com/pydantic/pydantic/pull/8920) - More helpful error re wrong `model_json_schema` usage by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8928](https://github.com/pydantic/pydantic/pull/8928) - Fix nested discriminated union schema gen, pt 2 by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8932](https://github.com/pydantic/pydantic/pull/8932) - Fix schema build for nested dataclasses / TypedDicts with discriminators by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8950](https://github.com/pydantic/pydantic/pull/8950) - Remove unnecessary logic for definitions schema gen with discriminated unions by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​8951](https://github.com/pydantic/pydantic/pull/8951) - Fix handling of optionals in `mypy` plugin by [@​dmontagu](https://github.com/dmontagu) in [#​9008](https://github.com/pydantic/pydantic/pull/9008) - Fix `PlainSerializer` usage with std type constructor by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9031](https://github.com/pydantic/pydantic/pull/9031) - Remove unnecessary warning for config in plugin by [@​dmontagu](https://github.com/dmontagu) in [#​9039](https://github.com/pydantic/pydantic/pull/9039) - Fix default value serializing by [@​NeevCohen](https://github.com/NeevCohen) in [#​9066](https://github.com/pydantic/pydantic/pull/9066) - Fix extra fields check in `Model.__getattr__()` by [@​NeevCohen](https://github.com/NeevCohen) in [#​9082](https://github.com/pydantic/pydantic/pull/9082) - Fix `ClassVar` forward ref inherited from parent class by [@​alexmojaki](https://github.com/alexmojaki) in [#​9097](https://github.com/pydantic/pydantic/pull/9097) - fix sequence like validator with strict `True` by [@​andresliszt](https://github.com/andresliszt) in [#​8977](https://github.com/pydantic/pydantic/pull/8977) - Improve warning message when a field name shadows a field in a parent model by [@​chan-vince](https://github.com/chan-vince) in [#​9105](https://github.com/pydantic/pydantic/pull/9105) - Do not warn about shadowed fields if they are not redefined in a child class by [@​chan-vince](https://github.com/chan-vince) in [#​9111](https://github.com/pydantic/pydantic/pull/9111) - Fix discriminated union bug with unsubstituted type var by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9124](https://github.com/pydantic/pydantic/pull/9124) - Support serialization of `deque` when passed to `Sequence[blah blah blah]` by [@​sydney-runkle](https://github.com/sydney-runkle) in [#​9128](https://github.com/pydantic/pydantic/pull/9128) - Init private attributes from super-types in `model_post_init` by [@​Viicos](https://github.com/Viicos) in [#​9134](https://github.com/pydantic/pydantic/pull/9134) - fix `model_construct` with `validation_alias` by [@​ornariece](https://github.com/ornariece) in [#​9144](https://github.com/pydantic/pydantic/pull/9144) - Ensure json-schema generator handles `Literal` `null` types by [@​bruno-f-cruz](https://github.com/bruno-f-cruz) in [#​9135](https://github.com/pydantic/pydantic/pull/9135) - **Fixed in v2.7.0**: Fix allow extra generic by [@​dmontagu](https://github.com/dmontagu) in [#​9193](https://github.com/pydantic/pydantic/pull/9193) ##### New Contributors - [@​hungtsetse](https://github.com/hungtsetse) made their first contribution in [#​8546](https://github.com/pydantic/pydantic/pull/8546) - [@​StrawHatDrag0n](https://github.com/StrawHatDrag0n) made their first contribution in [#​8583](https://github.com/pydantic/pydantic/pull/8583) - [@​anci3ntr0ck](https://github.com/anci3ntr0ck) made their first contribution in [#​8642](https://github.com/pydantic/pydantic/pull/8642) - [@​Holi0317](https://github.com/Holi0317) made their first contribution in [#​8650](https://github.com/pydantic/pydantic/pull/8650) - [@​bluenote10](https://github.com/bluenote10) made their first contribution in [#​8651](https://github.com/pydantic/pydantic/pull/8651) - [@​ADSteele916](https://github.com/ADSteele916) made their first contribution in [#​8703](https://github.com/pydantic/pydantic/pull/8703) - [@​musicinmybrain](https://github.com/musicinmybrain) made their first contribution in [#​8731](https://github.com/pydantic/pydantic/pull/8731) - [@​jks15satoshi](https://github.com/jks15satoshi) made their first contribution in [#​8706](https://github.com/pydantic/pydantic/pull/8706) - [@​13sin](https://github.com/13sin) made their first contribution in [#​8734](https://github.com/pydantic/pydantic/pull/8734) - [@​DanielNoord](https://github.com/DanielNoord) made their first contribution in [#​8738](https://github.com/pydantic/pydantic/pull/8738) - [@​conradogarciaberrotaran](https://github.com/conradogarciaberrotaran) made their first contribution in [#​8519](https://github.com/pydantic/pydantic/pull/8519) - [@​chris-griffin](https://github.com/chris-griffin) made their first contribution in [#​8775](https://github.com/pydantic/pydantic/pull/8775) - [@​LouisGobert](https://github.com/LouisGobert) made their first contribution in [#​8793](https://github.com/pydantic/pydantic/pull/8793) - [@​matsjoyce-refeyn](https://github.com/matsjoyce-refeyn) made their first contribution in [#​8751](https://github.com/pydantic/pydantic/pull/8751) - [@​devmonkey22](https://github.com/devmonkey22) made their first contribution in [#​7680](https://github.com/pydantic/pydantic/pull/7680) - [@​adamency](https://github.com/adamency) made their first contribution in [#​8847](https://github.com/pydantic/pydantic/pull/8847) - [@​MamfTheKramf](https://github.com/MamfTheKramf) made their first contribution in [#​8851](https://github.com/pydantic/pydantic/pull/8851) - [@​ornariece](https://github.com/ornariece) made their first contribution in [#​9001](https://github.com/pydantic/pydantic/pull/9001) - [@​alexeyt101](https://github.com/alexeyt101) made their first contribution in [#​9004](https://github.com/pydantic/pydantic/pull/9004) - [@​wannieman98](https://github.com/wannieman98) made their first contribution in [#​8947](https://github.com/pydantic/pydantic/pull/8947) - [@​solidguy7](https://github.com/solidguy7) made their first contribution in [#​9062](https://github.com/pydantic/pydantic/pull/9062) - [@​kloczek](https://github.com/kloczek) made their first contribution in [#​9047](https://github.com/pydantic/pydantic/pull/9047) - [@​jag-k](https://github.com/jag-k) made their first contribution in [#​9053](https://github.com/pydantic/pydantic/pull/9053) - [@​priya-gitTest](https://github.com/priya-gitTest) made their first contribution in [#​9088](https://github.com/pydantic/pydantic/pull/9088) - [@​Youssefares](https://github.com/Youssefares) made their first contribution in [#​9023](https://github.com/pydantic/pydantic/pull/9023) - [@​chan-vince](https://github.com/chan-vince) made their first contribution in [#​9105](https://github.com/pydantic/pydantic/pull/9105) - [@​bruno-f-cruz](https://github.com/bruno-f-cruz) made their first contribution in [#​9135](https://github.com/pydantic/pydantic/pull/9135) - [@​Lance-Drane](https://github.com/Lance-Drane) made their first contribution in [#​9166](https://github.com/pydantic/pydantic/pull/9166) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/fulcrum-so/ziggy-pydust). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information