Recent Releases of pydantic
pydantic - v2.12.0a1 2025-07-26
v2.12.0a1 (2025-07-26)
This is the first alpha release of the upcoming 2.12 release, which adds initial support for Python 3.14.
What's Changed
New Features
- Add
__pydantic_on_complete__()hook that is called once model is fully ready to be used by @DouweM in #11762 - Add initial support for Python 3.14 by @Viicos in #11991
- Add regex patterns to JSON schema for
Decimaltype by @Dima-Bulavenko in #11987 - Add support for
docattribute on dataclass fields by @Viicos in #12077 - Add experimental
MISSINGsentinel by @Viicos in #11883
Changes
- Allow config and bases to be specified together in
create_model()by @Viicos in #11714 - Move some field logic out of the
GenerateSchemaclass by @Viicos in #11733 - Always make use of
inspect.getsourcelines()for docstring extraction on Python 3.13 and greater by @Viicos in #11829 - Only support the latest Mypy version by @Viicos in #11832
- Do not implicitly convert after model validators to class methods by @Viicos in #11957
- Refactor
FieldInfocreation implementation by @Viicos in #11898 - Make
Secretcovariant by @bluenote10 in #12008 - Emit warning when field-specific metadata is used in invalid contexts by @Viicos in #12028
Fixes
- Properly fetch plain serializer function when serializing default value in JSON Schema by @Viicos in #11721
- Remove generics cache workaround by @Viicos in #11755
- Remove coercion of decimal constraints by @Viicos in #11772
- Fix crash when expanding root type in the mypy plugin by @Viicos in #11735
- Only mark model as complete once all fields are complete by @DouweM in #11759
- Do not provide
field_namein validator core schemas by @DouweM in #11761 - Fix issue with recursive generic models by @Viicos in #11775
- Fix qualified name comparison of private attributes during namespace inspection by @karta9821 in #11803
- Make sure Pydantic dataclasses with slots and
validate_assignmentcan be unpickled by @Viicos in #11769 - Traverse
function-beforeschemas during schema gathering by @Viicos in #11801 - Fix check for stdlib dataclasses by @Viicos in #11822
- Check if
FieldInfois complete after applying type variable map by @Viicos in #11855 - Do not delete mock validator/serializer in
model_rebuild()by @Viicos in #11890 - Rebuild dataclass fields before schema generation by @Viicos in #11949
- Always store the original field assignment on
FieldInfoby @Viicos in #11946 - Do not use deprecated methods as default field values by @Viicos in #11914
- Allow callable discriminator to be applied on PEP 695 type aliases by @Viicos in #11941
- Suppress core schema generation warning when using
SkipValidationby @ygsh0816 in #12002 - Do not emit typechecking error for invalid
Field()default withvalidate_defaultset toTrueby @Viicos in #11988 - Refactor logic to support Pydantic's
Field()function in dataclasses by @Viicos in #12051
Packaging
- Update project metadata to use PEP 639 by @Viicos in #11694
- Bump
mkdocs-llmstxtto v0.2.0 by @Viicos in #11725 - Bump
pydantic-coreto v2.35.1 by @Viicos in #11963 - Bump dawidd6/action-download-artifact from 10 to 11 by @dependabot[bot] in #12033
- Bump astral-sh/setup-uv from 5 to 6 by @dependabot[bot] in #11826
- Update mypy to 1.17.0 by @Viicos in #12076
New Contributors
- @parth-paradkar made their first contribution in #11695
- @dqkqd made their first contribution in #11739
- @fhightower made their first contribution in #11722
- @gbaian10 made their first contribution in #11766
- @DouweM made their first contribution in #11759
- @bowenliang123 made their first contribution in #11719
- @rawwar made their first contribution in #11799
- @karta9821 made their first contribution in #11803
- @jinnovation made their first contribution in #11834
- @zmievsa made their first contribution in #11861
- @Otto-AA made their first contribution in #11860
- @ygsh0816 made their first contribution in #12002
- @lukland made their first contribution in #12015
- @Dima-Bulavenko made their first contribution in #11987
- @GSemikozov made their first contribution in #12050
- @hannah-heywa made their first contribution in #12082
- Python
Published by Viicos 10 months ago
pydantic - v2.11.7 2025-06-14
What's Changed
Fixes
- Copy
FieldInfoinstance if necessary duringFieldInfobuild by @Viicos in https://github.com/pydantic/pydantic/pull/11980
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.6...v2.11.7
- Python
Published by Viicos 12 months ago
pydantic - v2.11.6 2025-06-13
v2.11.6 (2025-06-13)
What's Changed
Fixes
- Rebuild dataclass fields before schema generation by @Viicos in #11949
- Always store the original field assignment on
FieldInfoby @Viicos in #11946
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.5...v2.11.6
- Python
Published by Viicos 12 months ago
pydantic - v2.11.5 2025-05-22
What's Changed
Fixes
- Check if
FieldInfois complete after applying type variable map by @Viicos in #11855 - Do not delete mock validator/serializer in
model_rebuild()by @Viicos in #11890 - Do not duplicate metadata on model rebuild by @Viicos in #11902
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.4...v2.11.5
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.4 2025-04-29
What's Changed
Packaging
- Bump
mkdocs-llmstxtto v0.2.0 by @Viicos in #11725
Changes
- Allow config and bases to be specified together in
create_model()by @Viicos in #11714. This change was backported as it was previously possible (although not meant to be supported) to providemodel_configas a field, which would make it possible to provide both configuration and bases.
Fixes
- Remove generics cache workaround by @Viicos in #11755
- Remove coercion of decimal constraints by @Viicos in #11772
- Fix crash when expanding root type in the mypy plugin by @Viicos in #11735
- Fix issue with recursive generic models by @Viicos in #11775
- Traverse
function-beforeschemas during schema gathering by @Viicos in #11801
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.3 2025-04-08
What's Changed
Packaging
- Update V1 copy to v1.10.21 by @Viicos in https://github.com/pydantic/pydantic/pull/11706 ### Fixes
- Preserve field description when rebuilding model fields by @Viicos in https://github.com/pydantic/pydantic/pull/11698
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.2...v2.11.3
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.2 2025-04-03
What's Changed
Fixes
- Bump
pydantic-coreto v2.33.1 by @Viicos in https://github.com/pydantic/pydantic/pull/11678 - Make sure
__pydantic_private__exists before setting private attributes by @Viicos in https://github.com/pydantic/pydantic/pull/11666 - Do not override
FieldInfo._completewhen using field from parent class by @Viicos in https://github.com/pydantic/pydantic/pull/11668 - Provide the available definitions when applying discriminated unions by @Viicos in https://github.com/pydantic/pydantic/pull/11670
- Do not expand root type in the mypy plugin for variables by @Viicos in https://github.com/pydantic/pydantic/pull/11676
- Mention the attribute name in model fields deprecation message by @Viicos in https://github.com/pydantic/pydantic/pull/11674
- Properly validate parameterized mappings by @Viicos in https://github.com/pydantic/pydantic/pull/11658
- Prepare release v2.11.2 by @Viicos in https://github.com/pydantic/pydantic/pull/11684
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.1...v2.11.2
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.1 2025-03-28
What's Changed
Fixes
- Do not override
'definitions-ref'schemas containing serialization schemas or metadata by @Viicos in https://github.com/pydantic/pydantic/pull/11644
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0...v2.11.1
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.0 2025-03-27
What's Changed
Packaging
- Re-enable memray related tests on Python 3.12+ by @Viicos in https://github.com/pydantic/pydantic/pull/11191
- Bump astral-sh/setup-uv from 4 to 5 by @dependabot in https://github.com/pydantic/pydantic/pull/11205
- Add a
check_pydantic_core_version()function by @Viicos in https://github.com/pydantic/pydantic/pull/11324 - Remove
greenletdevelopment dependency by @Viicos in https://github.com/pydantic/pydantic/pull/11351 - Bump ruff from 0.9.2 to 0.9.5 by @Viicos in https://github.com/pydantic/pydantic/pull/11407
- Improve release automation process by @austinyu in https://github.com/pydantic/pydantic/pull/11427
- Bump dawidd6/action-download-artifact from 8 to 9 by @dependabot in https://github.com/pydantic/pydantic/pull/11513
- Bump
pydantic-coreto v2.32.0 by @Viicos in https://github.com/pydantic/pydantic/pull/11567
New Features
- Support unsubstituted type variables with both a default and a bound or constraints by @FyZzyss in https://github.com/pydantic/pydantic/pull/10789
- Add a
default_factory_takes_validated_dataproperty toFieldInfoby @Viicos in https://github.com/pydantic/pydantic/pull/11034 - Raise a better error when a generic alias is used inside
type[]by @Viicos in https://github.com/pydantic/pydantic/pull/11088 - Properly support PEP 695 generics syntax by @Viicos in https://github.com/pydantic/pydantic/pull/11189
- Properly support type variable defaults by @Viicos in https://github.com/pydantic/pydantic/pull/11332
- Add support for validating v6, v7, v8 UUIDs by @astei in https://github.com/pydantic/pydantic/pull/11436
- Improve alias configuration APIs by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11468
- Add experimental support for free threading by @Viicos in https://github.com/pydantic/pydantic/pull/11516
- Add
encoded_string()method to the URL types by @YassinNouh21 in https://github.com/pydantic/pydantic/pull/11580 - Add support for
defer_buildwith@validate_calldecorator by @Viicos in https://github.com/pydantic/pydantic/pull/11584 - Allow
@with_configdecorator to be used with keyword arguments by @Viicos in https://github.com/pydantic/pydantic/pull/11608 - Simplify customization of default value inclusion in JSON Schema generation by @Viicos in https://github.com/pydantic/pydantic/pull/11634
- Add
generate_arguments_schema()function by @Viicos in https://github.com/pydantic/pydantic/pull/11572
Changes
- Rework
create_modelfield definitions format by @Viicos in https://github.com/pydantic/pydantic/pull/11032 - Raise a deprecation warning when a field is annotated as final with a default value by @Viicos in https://github.com/pydantic/pydantic/pull/11168
- Deprecate accessing
model_fieldsandmodel_computed_fieldson instances by @Viicos in https://github.com/pydantic/pydantic/pull/11169 - Move core schema generation logic for path types inside the
GenerateSchemaclass by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10846 - Move
Mappingschema gen toGenerateSchemato complete removal ofprepare_annotations_for_known_typeworkaround by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11247 - Remove Python 3.8 Support by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11258
- Optimize calls to
get_type_refby @Viicos in https://github.com/pydantic/pydantic/pull/10863 - Disable
pydantic-corecore schema validation by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11271 ### Performance - Only evaluate
FieldInfoannotations if required during schema building by @Viicos in https://github.com/pydantic/pydantic/pull/10769 - Improve
__setattr__performance of Pydantic models by caching setter functions by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/10868 - Improve annotation application performance by @Viicos in https://github.com/pydantic/pydantic/pull/11186
- Improve performance of
_typing_extramodule by @Viicos in https://github.com/pydantic/pydantic/pull/11255 - Refactor and optimize schema cleaning logic by @Viicos in https://github.com/pydantic/pydantic/pull/11244
- Create a single dictionary when creating a
CoreConfiginstance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384 - Reuse cached core schemas for parametrized generic Pydantic models by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/11434 ### Fixes
- Add validation tests for
_internal/_validators.pyby @tkasuz in https://github.com/pydantic/pydantic/pull/10763 - Subclass all single host url classes from
AnyUrlto preserve behavior from v2.9 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10856 - Improve
TypeAdapterinstance repr by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10872 - Use the correct frame when instantiating a parametrized
TypeAdapterby @Viicos in https://github.com/pydantic/pydantic/pull/10893 - Relax check for validated data in default factory utils by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10909
- Fix type checking issue with
model_fieldsandmodel_computed_fieldsby @sydney-runkle in https://github.com/pydantic/pydantic/pull/10911 - Use the parent configuration during schema generation for stdlib dataclasses by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10928
- Use the globals of the function when evaluating the return type of serializers and computed_fields by @Viicos in https://github.com/pydantic/pydantic/pull/10929
- Fix url constraint application by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10922
- Fix URL equality with different validation methods by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10934
- Fix JSON schema title when specified as
''by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10936 - Do not evaluate annotations for private fields by @Viicos in https://github.com/pydantic/pydantic/pull/10962
- Support serialization as any for
Secrettypes andUrltypes by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10947 - Fix type hint of
Field.defaultto be compatible with Python 3.8 and 3.9 by @Viicos in https://github.com/pydantic/pydantic/pull/10972 - hashing support for urls by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10975
- Hide
BaseModel.__replace__definition from type checkers by @Viicos in https://github.com/pydantic/pydantic/pull/10979 - Set fields when
defer_buildis set on Pydantic dataclasses by @Viicos in https://github.com/pydantic/pydantic/pull/10984 - Do not resolve the JSON Schema reference for
dictcore schema keys by @Viicos in https://github.com/pydantic/pydantic/pull/10989 - Use the globals of the function when evaluating the return type for
PlainSerializerandWrapSerializerfunctions by @Viicos in https://github.com/pydantic/pydantic/pull/11008 - Fix host required enforcement for urls to be compatible with v2.9 behavior by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11027
- Fix url json schema in
serializationmode by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11035 - Fix for comparison of AnyUrl objects by @alexprabhat99 in https://github.com/pydantic/pydantic/pull/11082
- Properly fetch PEP 695 type params for functions, do not fetch annotations from signature by @Viicos in https://github.com/pydantic/pydantic/pull/11093
- Infer final fields with a default value as class variables in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11121
- Recursively unpack
Literalvalues if using PEP 695 type aliases by @Viicos in https://github.com/pydantic/pydantic/pull/11114 - Override
__subclasscheck__onModelMetaclassto avoid memory leak and performance issues by @Viicos in https://github.com/pydantic/pydantic/pull/11116 - Include JSON Schema input core schema in function schemas by @Viicos in https://github.com/pydantic/pydantic/pull/11085
- Add
lento_BaseUrlto avoid TypeError by @Kharianne in https://github.com/pydantic/pydantic/pull/11111 - Make sure the type reference is removed from the seen references by @Viicos in https://github.com/pydantic/pydantic/pull/11143
- Add FastAPI and SQLModel to third-party tests by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11044
- Improve discriminated union error message for invalid union variants by @Viicos in https://github.com/pydantic/pydantic/pull/11161
- Unpack PEP 695 type aliases if using the
Annotatedform by @Viicos in https://github.com/pydantic/pydantic/pull/11109 - Remove custom MRO implementation of Pydantic models by @Viicos in https://github.com/pydantic/pydantic/pull/11184
- Add pandera third-party tests by @Viicos in https://github.com/pydantic/pydantic/pull/11193
- Add ODMantic third-party tests by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11197
- Copy
WithJsonSchemaschema to avoid sharing mutated data by @thejcannon in https://github.com/pydantic/pydantic/pull/11014 - Do not cache parametrized models when in the process of parametrizing another model by @Viicos in https://github.com/pydantic/pydantic/pull/10704
- Add discriminated union related metadata entries to the
CoreMetadatadefinition by @Viicos in https://github.com/pydantic/pydantic/pull/11216 - Consolidate schema definitions logic in the
_Definitionsclass by @Viicos in https://github.com/pydantic/pydantic/pull/11208 - Fix url serialization for unions by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11227
- Support initializing root model fields with values of the
roottype in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11212 - Move
dequeschema gen toGenerateSchemaclass by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11239 - Fix various issues with dataclasses and
use_attribute_docstringsby @Viicos in https://github.com/pydantic/pydantic/pull/11246 - Only compute normalized decimal places if necessary in
decimal_places_validatorby @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11281 - Add support for
validation_aliasin the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11295 - Fix JSON Schema reference collection with
"examples"keys by @Viicos in https://github.com/pydantic/pydantic/pull/11305 - Do not transform model serializer functions as class methods in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11298
- Fix url python serialization by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11330
- Add additional allowed schemes for
ClickHouseDsnby @Maze21127 in https://github.com/pydantic/pydantic/pull/11319 - Coerce decimal constraints to
Decimalinstances by @Viicos in https://github.com/pydantic/pydantic/pull/11350 - Use the correct JSON Schema mode when handling function schemas by @Viicos in https://github.com/pydantic/pydantic/pull/11367
- Fix JSON Schema reference logic with
exampleskeys by @Viicos in https://github.com/pydantic/pydantic/pull/11366 - Improve exception message when encountering recursion errors during type evaluation by @Viicos in https://github.com/pydantic/pydantic/pull/11356
- Always include
additionalProperties: Truefor arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392 - Expose
fallbackparameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398 - Fix path serialization behavior by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11416
- Do not reuse validators and serializers during model rebuild by @Viicos in https://github.com/pydantic/pydantic/pull/11429
- Collect model fields when rebuilding a model by @Viicos in https://github.com/pydantic/pydantic/pull/11388
- Allow cached properties to be altered on frozen models by @Viicos in https://github.com/pydantic/pydantic/pull/11432
- Fix tuple serialization for
Sequencetypes by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11435 - Fix: do not check for
__get_validators__on classes where__get_pydantic_core_schema__is also defined by @tlambert03 in https://github.com/pydantic/pydantic/pull/11444 - Allow callable instances to be used as serializers by @Viicos in https://github.com/pydantic/pydantic/pull/11451
- Improve error thrown when overriding field with a property by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11459
- Add BentoML and Semantic Kernel third-party tests by @Viicos in https://github.com/pydantic/pydantic/pull/11469
- Adding
langchainthird party tests by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11474 - Fix JSON Schema generation with referenceable core schemas holding JSON metadata by @Viicos in https://github.com/pydantic/pydantic/pull/11475
- Support strict specification on union member types by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11481
- Run Beanie third-party tests on a single Python version by @Viicos in https://github.com/pydantic/pydantic/pull/11502
- Implicitly set
validate_by_nametoTruewhenvalidate_by_aliasisFalseby @sydney-runkle in https://github.com/pydantic/pydantic/pull/11503 - Change type of
Anywhen synthesizingBaseSettings.__init__signature in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11497 - Use the
typing-inspectionlibrary by @Viicos in https://github.com/pydantic/pydantic/pull/11479 - Support type variable defaults referencing other type variables by @Viicos in https://github.com/pydantic/pydantic/pull/11520
- Fix
NotRequiredqualifier not taken into account in stringified annotation by @Viicos in https://github.com/pydantic/pydantic/pull/11559 - Allow generic typed dictionaries to be used for unpacked variadic keyword parameters by @Viicos in https://github.com/pydantic/pydantic/pull/11571
- Fix runtime error when computing model string representation involving cached properties and self-referenced models by @Viicos in https://github.com/pydantic/pydantic/pull/11579
- Preserve other steps when using the ellipsis in the pipeline API by @Viicos in https://github.com/pydantic/pydantic/pull/11626
- Fix deferred discriminator application logic by @Viicos in https://github.com/pydantic/pydantic/pull/11591
New Contributors
- @FyZzyss made their first contribution in https://github.com/pydantic/pydantic/pull/10789
- @tamird made their first contribution in https://github.com/pydantic/pydantic/pull/10948
- @felixxm made their first contribution in https://github.com/pydantic/pydantic/pull/11077
- @alexprabhat99 made their first contribution in https://github.com/pydantic/pydantic/pull/11082
- @Kharianne made their first contribution in https://github.com/pydantic/pydantic/pull/11111
- @mdaffad made their first contribution in https://github.com/pydantic/pydantic/pull/11177
- @thejcannon made their first contribution in https://github.com/pydantic/pydantic/pull/11014
- @thomasfrimannkoren made their first contribution in https://github.com/pydantic/pydantic/pull/11251
- @usernameMAI made their first contribution in https://github.com/pydantic/pydantic/pull/11275
- @ananiavito made their first contribution in https://github.com/pydantic/pydantic/pull/11302
- @pawamoy made their first contribution in https://github.com/pydantic/pydantic/pull/11311
- @Maze21127 made their first contribution in https://github.com/pydantic/pydantic/pull/11319
- @kauabh made their first contribution in https://github.com/pydantic/pydantic/pull/11369
- @jaceklaskowski made their first contribution in https://github.com/pydantic/pydantic/pull/11353
- @tmpbeing made their first contribution in https://github.com/pydantic/pydantic/pull/11375
- @petyosi made their first contribution in https://github.com/pydantic/pydantic/pull/11405
- @austinyu made their first contribution in https://github.com/pydantic/pydantic/pull/11392
- @mikeedjones made their first contribution in https://github.com/pydantic/pydantic/pull/11402
- @astei made their first contribution in https://github.com/pydantic/pydantic/pull/11436
- @dsayling made their first contribution in https://github.com/pydantic/pydantic/pull/11522
- @joren485 made their first contribution in https://github.com/pydantic/pydantic/pull/11547
- @cmenon12 made their first contribution in https://github.com/pydantic/pydantic/pull/11562
- @Jeukoh made their first contribution in https://github.com/pydantic/pydantic/pull/11611
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.6...v2.11.0
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.0b2 2025-03-17
What's Changed
Packaging
- Bump
pydantic-coreto v2.32.0 by @Viicos in https://github.com/pydantic/pydantic/pull/11567 ### New Features - Add experimental support for free threading by @Viicos in https://github.com/pydantic/pydantic/pull/11516 ### Fixes
- Fix
NotRequiredqualifier not taken into account in stringified annotation by @Viicos in https://github.com/pydantic/pydantic/pull/11559
New Contributors
- @joren485 made their first contribution in https://github.com/pydantic/pydantic/pull/11547
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0b1...v2.11.0b2
- Python
Published by Viicos about 1 year ago
pydantic - v2.11.0b1 2025-03-06
What's Changed
Packaging
- Add a
check_pydantic_core_version()function by @Viicos in https://github.com/pydantic/pydantic/pull/11324 - Remove
greenletdevelopment dependency by @Viicos in https://github.com/pydantic/pydantic/pull/11351 - Use the
typing-inspectionlibrary by @Viicos in https://github.com/pydantic/pydantic/pull/11479 - Bump
pydantic-coretov2.31.1by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11526
New Features
- Support unsubstituted type variables with both a default and a bound or constraints by @FyZzyss in https://github.com/pydantic/pydantic/pull/10789
- Add a
default_factory_takes_validated_dataproperty toFieldInfoby @Viicos in https://github.com/pydantic/pydantic/pull/11034 - Raise a better error when a generic alias is used inside
type[]by @Viicos in https://github.com/pydantic/pydantic/pull/11088 - Properly support PEP 695 generics syntax by @Viicos in https://github.com/pydantic/pydantic/pull/11189
- Properly support type variable defaults by @Viicos in https://github.com/pydantic/pydantic/pull/11332
- Add support for validating v6, v7, v8 UUIDs by @astei in https://github.com/pydantic/pydantic/pull/11436
- Improve alias configuration APIs by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11468
Changes
- Rework
create_modelfield definitions format by @Viicos in https://github.com/pydantic/pydantic/pull/11032 - Raise a deprecation warning when a field is annotated as final with a default value by @Viicos in https://github.com/pydantic/pydantic/pull/11168
- Deprecate accessing
model_fieldsandmodel_computed_fieldson instances by @Viicos in https://github.com/pydantic/pydantic/pull/11169 - Breaking Change: Move core schema generation logic for path types inside the
GenerateSchemaclass by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10846 - Remove Python 3.8 Support by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11258
- Optimize calls to
get_type_refby @Viicos in https://github.com/pydantic/pydantic/pull/10863 - Disable
pydantic-corecore schema validation by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11271
Performance
- Only evaluate
FieldInfoannotations if required during schema building by @Viicos in https://github.com/pydantic/pydantic/pull/10769 - Improve
__setattr__performance of Pydantic models by caching setter functions by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/10868 - Improve annotation application performance by @Viicos in https://github.com/pydantic/pydantic/pull/11186
- Improve performance of
_typing_extramodule by @Viicos in https://github.com/pydantic/pydantic/pull/11255 - Refactor and optimize schema cleaning logic by @Viicos in https://github.com/pydantic/pydantic/pull/11244
- Create a single dictionary when creating a
CoreConfiginstance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384 - Bump
pydantic-coreand thus useSchemaValidatorandSchemaSerializercaching by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11402 - Reuse cached core schemas for parametrized generic Pydantic models by @MarkusSintonen in https://github.com/pydantic/pydantic/pull/11434
Fixes
- Improve
TypeAdapterinstance repr by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10872 - Use the correct frame when instantiating a parametrized
TypeAdapterby @Viicos in https://github.com/pydantic/pydantic/pull/10893 - Infer final fields with a default value as class variables in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11121
- Recursively unpack
Literalvalues if using PEP 695 type aliases by @Viicos in https://github.com/pydantic/pydantic/pull/11114 - Override
__subclasscheck__onModelMetaclassto avoid memory leak and performance issues by @Viicos in https://github.com/pydantic/pydantic/pull/11116 - Remove unused
_extract_get_pydantic_json_schema()parameter by @Viicos in https://github.com/pydantic/pydantic/pull/11155 - Improve discriminated union error message for invalid union variants by @Viicos in https://github.com/pydantic/pydantic/pull/11161
- Unpack PEP 695 type aliases if using the
Annotatedform by @Viicos in https://github.com/pydantic/pydantic/pull/11109 - Add missing stacklevel in
deprecated_instance_propertywarning by @Viicos in https://github.com/pydantic/pydantic/pull/11200 - Copy
WithJsonSchemaschema to avoid sharing mutated data by @thejcannon in https://github.com/pydantic/pydantic/pull/11014 - Do not cache parametrized models when in the process of parametrizing another model by @Viicos in https://github.com/pydantic/pydantic/pull/10704
- Add discriminated union related metadata entries to the
CoreMetadatadefinition by @Viicos in https://github.com/pydantic/pydantic/pull/11216 - Consolidate schema definitions logic in the
_Definitionsclass by @Viicos in https://github.com/pydantic/pydantic/pull/11208 - Support initializing root model fields with values of the
roottype in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11212 - Fix various issues with dataclasses and
use_attribute_docstringsby @Viicos in https://github.com/pydantic/pydantic/pull/11246 - Only compute normalized decimal places if necessary in
decimal_places_validatorby @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11281 - Add support for
validation_aliasin the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11295 - Fix JSON Schema reference collection with
"examples"keys by @Viicos in https://github.com/pydantic/pydantic/pull/11305 - Do not transform model serializer functions as class methods in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11298
- Simplify
GenerateJsonSchema.literal_schema()implementation by @misrasaurabh1 in https://github.com/pydantic/pydantic/pull/11321 - Add additional allowed schemes for
ClickHouseDsnby @Maze21127 in https://github.com/pydantic/pydantic/pull/11319 - Coerce decimal constraints to
Decimalinstances by @Viicos in https://github.com/pydantic/pydantic/pull/11350 - Use the correct JSON Schema mode when handling function schemas by @Viicos in https://github.com/pydantic/pydantic/pull/11367
- Improve exception message when encountering recursion errors during type evaluation by @Viicos in https://github.com/pydantic/pydantic/pull/11356
- Always include
additionalProperties: Truefor arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392 - Expose
fallbackparameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398 - Fix path serialization behavior by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11416
- Do not reuse validators and serializers during model rebuild by @Viicos in https://github.com/pydantic/pydantic/pull/11429
- Collect model fields when rebuilding a model by @Viicos in https://github.com/pydantic/pydantic/pull/11388
- Allow cached properties to be altered on frozen models by @Viicos in https://github.com/pydantic/pydantic/pull/11432
- Fix tuple serialization for
Sequencetypes by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11435 - Fix: do not check for
__get_validators__on classes where__get_pydantic_core_schema__is also defined by @tlambert03 in https://github.com/pydantic/pydantic/pull/11444 - Allow callable instances to be used as serializers by @Viicos in https://github.com/pydantic/pydantic/pull/11451
- Improve error thrown when overriding field with a property by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11459
- Fix JSON Schema generation with referenceable core schemas holding JSON metadata by @Viicos in https://github.com/pydantic/pydantic/pull/11475
- Support strict specification on union member types by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11481
- Implicitly set
validate_by_nametoTruewhenvalidate_by_aliasisFalseby @sydney-runkle in https://github.com/pydantic/pydantic/pull/11503 - Change type of
Anywhen synthesizingBaseSettings.__init__signature in the mypy plugin by @Viicos in https://github.com/pydantic/pydantic/pull/11497 - Support type variable defaults referencing other type variables by @Viicos in https://github.com/pydantic/pydantic/pull/11520
- Fix
ValueErroron year zero by @davidhewitt in https://github.com/pydantic/pydantic-core/pull/1583 dataclassInitVarshouldn't be required on serialization by @sydney-runkle in https://github.com/pydantic/pydantic-core/pull/1602
New Contributors
- @FyZzyss made their first contribution in https://github.com/pydantic/pydantic/pull/10789
- @tamird made their first contribution in https://github.com/pydantic/pydantic/pull/10948
- @felixxm made their first contribution in https://github.com/pydantic/pydantic/pull/11077
- @alexprabhat99 made their first contribution in https://github.com/pydantic/pydantic/pull/11082
- @Kharianne made their first contribution in https://github.com/pydantic/pydantic/pull/11111
- @mdaffad made their first contribution in https://github.com/pydantic/pydantic/pull/11177
- @thejcannon made their first contribution in https://github.com/pydantic/pydantic/pull/11014
- @thomasfrimannkoren made their first contribution in https://github.com/pydantic/pydantic/pull/11251
- @usernameMAI made their first contribution in https://github.com/pydantic/pydantic/pull/11275
- @ananiavito made their first contribution in https://github.com/pydantic/pydantic/pull/11302
- @pawamoy made their first contribution in https://github.com/pydantic/pydantic/pull/11311
- @Maze21127 made their first contribution in https://github.com/pydantic/pydantic/pull/11319
- @kauabh made their first contribution in https://github.com/pydantic/pydantic/pull/11369
- @jaceklaskowski made their first contribution in https://github.com/pydantic/pydantic/pull/11353
- @tmpbeing made their first contribution in https://github.com/pydantic/pydantic/pull/11375
- @petyosi made their first contribution in https://github.com/pydantic/pydantic/pull/11405
- @austinyu made their first contribution in https://github.com/pydantic/pydantic/pull/11392
- @mikeedjones made their first contribution in https://github.com/pydantic/pydantic/pull/11402
- @astei made their first contribution in https://github.com/pydantic/pydantic/pull/11436
- @dsayling made their first contribution in https://github.com/pydantic/pydantic/pull/11522
- @sobolevn made their first contribution in https://github.com/pydantic/pydantic-core/pull/1645
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.6...v2.11.0b1
- Python
Published by sydney-runkle about 1 year ago
pydantic - v2.11.0a2 2025-02-10
What's Changed
[!NOTE] Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). This is another early alpha release, meant to collect early feedback from users having issues with core schema builds.
Packaging
- Bump ruff from 0.9.2 to 0.9.5 by @Viicos in https://github.com/pydantic/pydantic/pull/11407
- Bump
pydantic-coreto v2.29.0 by @mikeedjones in https://github.com/pydantic/pydantic/pull/11402 - Use locally-built rust with symbols & pgo by @davidhewitt in https://github.com/pydantic/pydantic/pull/11403
Performance
- Create a single dictionary when creating a
CoreConfiginstance by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11384
Fixes
- Use the correct JSON Schema mode when handling function schemas by @Viicos in https://github.com/pydantic/pydantic/pull/11367
- Fix JSON Schema reference logic with
exampleskeys by @Viicos in https://github.com/pydantic/pydantic/pull/11366 - Improve exception message when encountering recursion errors during type evaluation by @Viicos in https://github.com/pydantic/pydantic/pull/11356
- Always include
additionalProperties: Truefor arbitrary dictionary schemas by @austinyu in https://github.com/pydantic/pydantic/pull/11392 - Expose
fallbackparameter in serialization methods by @Viicos in https://github.com/pydantic/pydantic/pull/11398 - Fix path serialization behavior by @sydney-runkle in https://github.com/pydantic/pydantic/pull/11416
New Contributors
- @kauabh made their first contribution in https://github.com/pydantic/pydantic/pull/11369
- @jaceklaskowski made their first contribution in https://github.com/pydantic/pydantic/pull/11353
- @tmpbeing made their first contribution in https://github.com/pydantic/pydantic/pull/11375
- @petyosi made their first contribution in https://github.com/pydantic/pydantic/pull/11405
- @austinyu made their first contribution in https://github.com/pydantic/pydantic/pull/11392
- @mikeedjones made their first contribution in https://github.com/pydantic/pydantic/pull/11402
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.11.0a1...v2.11.0a2
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.11.0a1 2025-01-30
v2.11.0a1 (2025-01-30)
What's Changed
[!NOTE]
Pydantic v2.11 is a version strongly focused on build time performance of Pydantic models (and core schema generation in general). This is an early alpha release, meant to collect early feedback from users having issues with core schema builds.
Packaging
- Bump dawidd6/action-download-artifact from 6 to 7 by @dependabot in #11018
- Re-enable memray related tests on Python 3.12+ by @Viicos in #11191
- Bump astral-sh/setup-uv to 5 by @dependabot in #11205
- Bump
ruffto v0.9.0 by @sydney-runkle in #11254 - Regular
uv.lockdeps update by @sydney-runkle in #11333 - Add a
check_pydantic_core_version()function by @Viicos in #11324 - Remove
greenletdevelopment dependency by @Viicos in #11351 - Bump
pydantic-coreto v2.28.0 by @Viicos in #11364
New Features
- Support unsubstituted type variables with both a default and a bound or constraints by @FyZzyss in #10789
- Add a
default_factory_takes_validated_dataproperty toFieldInfoby @Viicos in #11034 - Raise a better error when a generic alias is used inside
type[]by @Viicos in #11088 - Properly support PEP 695 generics syntax by @Viicos in #11189
- Properly support type variable defaults by @Viicos in #11332
Changes
- Rework
create_modelfield definitions format by @Viicos in #11032 - Raise a deprecation warning when a field is annotated as final with a default value by @Viicos in #11168
- Deprecate accessing
model_fieldsandmodel_computed_fieldson instances by @Viicos in #11169 - Move core schema generation logic for path types inside the
GenerateSchemaclass by @sydney-runkle in #10846 - Move
dequeschema gen toGenerateSchemaclass by @sydney-runkle in #11239 - Move
Mappingschema gen toGenerateSchemato complete removal ofprepare_annotations_for_known_typeworkaround by @sydney-runkle in #11247 - Remove Python 3.8 Support by @sydney-runkle in #11258
- Disable
pydantic-corecore schema validation by @sydney-runkle in #11271
Performance
- Only evaluate
FieldInfoannotations if required during schema building by @Viicos in #10769 - Optimize calls to
get_type_refby @Viicos in #10863 - Improve
__setattr__performance of Pydantic models by caching setter functions by @MarkusSintonen in #10868 - Improve annotation application performance by @Viicos in #11186
- Improve performance of
_typing_extramodule by @Viicos in #11255 - Refactor and optimize schema cleaning logic by @Viicos and @MarkusSintonen in #11244
Fixes
- Add validation tests for
_internal/_validators.pyby @tkasuz in #10763 - Improve
TypeAdapterinstance repr by @sydney-runkle in #10872 - Revert "ci: use locally built pydantic-core with debug symbols by @sydney-runkle in #10942
- Re-enable all FastAPI tests by @tamird in #10948
- Fix typo in HISTORY.md. by @felixxm in #11077
- Infer final fields with a default value as class variables in the mypy plugin by @Viicos in #11121
- Recursively unpack
Literalvalues if using PEP 695 type aliases by @Viicos in #11114 - Override
__subclasscheck__onModelMetaclassto avoid memory leak and performance issues by @Viicos in #11116 - Remove unused
_extract_get_pydantic_json_schema()parameter by @Viicos in #11155 - Add FastAPI and SQLModel to third-party tests by @sydney-runkle in #11044
- Fix conditional expressions syntax for third-party tests by @Viicos in #11162
- Move FastAPI tests to third-party workflow by @Viicos in #11164
- Improve discriminated union error message for invalid union variants by @Viicos in #11161
- Unpack PEP 695 type aliases if using the
Annotatedform by @Viicos in #11109 - Include
openapi-python-clientcheck in issue creation for third-party failures, usemainbranch by @sydney-runkle in #11182 - Add pandera third-party tests by @Viicos in #11193
- Add ODMantic third-party tests by @sydney-runkle in #11197
- Add missing stacklevel in
deprecated_instance_propertywarning by @Viicos in #11200 - Copy
WithJsonSchemaschema to avoid sharing mutated data by @thejcannon in #11014 - Do not cache parametrized models when in the process of parametrizing another model by @Viicos in #10704
- Re-enable Beanie third-party tests by @Viicos in #11214
- Add discriminated union related metadata entries to the
CoreMetadatadefinition by @Viicos in #11216 - Consolidate schema definitions logic in the
_Definitionsclass by @Viicos in #11208 - Support initializing root model fields with values of the
roottype in the mypy plugin by @Viicos in #11212 - Fix various issues with dataclasses and
use_attribute_docstringsby @Viicos in #11246 - Only compute normalized decimal places if necessary in
decimal_places_validatorby @misrasaurabh1 in #11281 - Fix two misplaced sentences in validation errors documentation by @ananiavito in #11302
- Fix mkdocstrings inventory example in documentation by @pawamoy in #11311
- Add support for
validation_aliasin the mypy plugin by @Viicos in #11295 - Do not transform model serializer functions as class methods in the mypy plugin by @Viicos in #11298
- Simplify
GenerateJsonSchema.literal_schema()implementation by @misrasaurabh1 in #11321 - Add additional allowed schemes for
ClickHouseDsnby @Maze21127 in #11319 - Coerce decimal constraints to
Decimalinstances by @Viicos in #11350 - Fix
ValueErroron year zero by @davidhewitt in pydantic-core#1583
New Contributors
- @FyZzyss made their first contribution in #10789
- @tamird made their first contribution in #10948
- @felixxm made their first contribution in #11077
- @alexprabhat99 made their first contribution in #11082
- @Kharianne made their first contribution in #11111
- @mdaffad made their first contribution in #11177
- @thejcannon made their first contribution in #11014
- @thomasfrimannkoren made their first contribution in #11251
- @usernameMAI made their first contribution in #11275
- @ananiavito made their first contribution in #11302
- @pawamoy made their first contribution in #11311
- @Maze21127 made their first contribution in #11319
- Python
Published by Viicos over 1 year ago
pydantic - v2.10.6 2025-01-23
What's Changed
Fixes
- Fix JSON Schema reference collection with
'examples'keys by @Viicos in #11325 - Fix url python serialization by @sydney-runkle in #11331
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.5...v2.10.6
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.5 2024-12-18
What's Changed
Fixes
- Remove custom MRO implementation of Pydantic models by @Viicos in #11184
- Fix URL serialization for unions by @sydney-runkle in #11233
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.4...v2.10.5
- Python
Published by Viicos over 1 year ago
pydantic - v1.10.20 2025-01-07
What's Changed
This release provides proper support for Python 3.13, with (Cythonized) wheels published for this version.
As a consequence, Cython was updated from 0.29.x to 3.0.x.
- General maintenance of CI and build ecosystem by @Viicos in https://github.com/pydantic/pydantic/pull/10847
- Update Cython to
3.0.x. - Properly address Python 3.13 deprecation warnings.
- Migrate packaging to
pyproject.toml, make use of PEP 517 build options. - Use
buildinstead of directsetup.pyinvocations. - Update various Github Actions versions.
- Update Cython to
- Replace outdated stpmex link in documentation by @jaredenorris in https://github.com/pydantic/pydantic/pull/10997
New Contributors
- @jaredenorris made their first contribution in https://github.com/pydantic/pydantic/pull/10997
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.19...v1.10.20
- Python
Published by Viicos over 1 year ago
pydantic - v2.10.4 2024-12-18
What's Changed
Packaging
- Bump
pydantic-coreto v2.27.2 by @davidhewitt in #11138
Fixes
- Fix for comparison of
AnyUrlobjects by @alexprabhat99 in #11082 - Properly fetch PEP 695 type params for functions, do not fetch annotations from signature by @Viicos in #11093
- Include JSON Schema input core schema in function schemas by @Viicos in #11085
- Add
lento_BaseUrlto avoid TypeError by @Kharianne in #11111 - Make sure the type reference is removed from the seen references by @Viicos in #11143
New Contributors
- @alexprabhat99 made their first contribution in #11082
- @Kharianne made their first contribution in #11111
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.3...v2.10.4
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.3 2024-12-03
What's Changed
Fixes
- Set fields when
defer_buildis set on Pydantic dataclasses by @Viicos in #10984 - Do not resolve the JSON Schema reference for
dictcore schema keys by @Viicos in #10989 - Use the globals of the function when evaluating the return type for
PlainSerializerandWrapSerializerfunctions by @Viicos in #11008 - Fix host required enforcement for urls to be compatible with v2.9 behavior by @sydney-runkle in #11027
- Add a
default_factory_takes_validated_dataproperty toFieldInfoby @Viicos in #11034 - Fix url json schema in
serializationmode by @sydney-runkle in #11035
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.2...v2.10.3
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.2 2024-11-26
What's Changed
Fixes
- Only evaluate
FieldInfoannotations if required during schema building by @Viicos in #10769 - Do not evaluate annotations for private fields by @Viicos in #10962
- Support serialization as any for
Secrettypes andUrltypes by @sydney-runkle in #10947 - Fix type hint of
Field.defaultto be compatible with Python 3.8 and 3.9 by @Viicos in #10972 - Add hashing support for URL types by @sydney-runkle in #10975
- Hide
BaseModel.__replace__definition from type checkers by @Viicos in 10979
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.1...v2.10.2
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.1 2024-11-21
What's Changed
Packaging
- Bump
pydantic-coreversion tov2.27.1by @sydney-runkle in #10938
Fixes
- Use the correct frame when instantiating a parametrized
TypeAdapterby @Viicos in #10893 - Relax check for validated data in
default_factoryutils by @sydney-runkle in #10909 - Fix type checking issue with
model_fieldsandmodel_computed_fieldsby @sydney-runkle in #10911 - Use the parent configuration during schema generation for stdlib
dataclasses by @sydney-runkle in #10928 - Use the
globalsof the function when evaluating the return type of serializers andcomputed_fields by @Viicos in #10929 - Fix URL constraint application by @sydney-runkle in #10922
- Fix URL equality with different validation methods by @sydney-runkle in #10934
- Fix JSON schema title when specified as
''by @sydney-runkle in #10936 - Fix
pythonmode serialization forcomplexinference by @sydney-runkle in pydantic-core#1549
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.0...v2.10.1
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.0 2024-11-20
The code released in v2.10.0 is practically identical to that of v2.10.0b2. See the v2.10 release blog post for the highlights!
What's Changed
Packaging
- Bump
pydantic-coretov2.27.0by @sydney-runkle in #10825 - Replaced pdm with uv by @frfahim in #10727
New Features
- Support
fractions.Fractionby @sydney-runkle in #10318 - Support
Hashablefor json validation by @sydney-runkle in #10324 - Add a
SocketPathtype forlinuxsystems by @theunkn0wn1 in #10378 - Allow arbitrary refs in JSON schema
examplesby @sydney-runkle in #10417 - Support
defer_buildfor Pydantic dataclasses by @Viicos in #10313 - Adding v1 / v2 incompatibility warning for nested v1 model by @sydney-runkle in #10431
- Add support for unpacked
TypedDictto type hint variadic keyword arguments with@validate_callby @Viicos in #10416 - Support compiled patterns in
protected_namespacesby @sydney-runkle in #10522 - Add support for
propertyNamesin JSON schema by @FlorianSW in #10478 - Adding
__replace__protocol for Python 3.13+ support by @sydney-runkle in #10596 - Expose public
sortmethod for JSON schema generation by @sydney-runkle in #10595 - Add runtime validation of
@validate_callcallable argument by @kc0506 in #10627 - Add
experimental_allow_partialsupport by @samuelcolvin in #10748 - Support default factories taking validated data as an argument by @Viicos in #10678
- Allow subclassing
ValidationErrorandPydanticCustomErrorby @Youssefares in pydantic/pydantic-core#1413 - Add
trailing-stringssupport toexperimental_allow_partialby @sydney-runkle in #10825 - Add
rebuild()method forTypeAdapterand simplifydefer_buildpatterns by @sydney-runkle in #10537 - Improve
TypeAdapterinstance repr by @sydney-runkle in #10872
Changes
- Don't allow customization of
SchemaGeneratoruntil interface is more stable by @sydney-runkle in #10303 - Cleanly
defer_buildonTypeAdapters, removing experimental flag by @sydney-runkle in #10329 - Fix
mroof generic subclass by @kc0506 in #10100 - Strip whitespaces on JSON Schema title generation by @sydney-runkle in #10404
- Use
b64decodeandb64encodeforBase64Bytestype by @sydney-runkle in #10486 - Relax protected namespace config default by @sydney-runkle in #10441
- Revalidate parametrized generics if instance's origin is subclass of OG class by @sydney-runkle in #10666
- Warn if configuration is specified on the
@dataclassdecorator and with the__pydantic_config__attribute by @sydney-runkle in #10406 - Recommend against using
Ellipsis(...) withFieldby @Viicos in #10661 - Migrate to subclassing instead of annotated approach for pydantic url types by @sydney-runkle in #10662
- Change JSON schema generation of
Literals andEnumsby @Viicos in #10692 - Simplify unions involving
AnyorNeverwhen replacing type variables by @Viicos in #10338 - Do not require padding when decoding
base64bytes by @bschoenmaeckers in pydantic/pydantic-core#1448 - Support dates all the way to 1BC by @changhc in pydantic/speedate#77
Performance
- Schema cleaning: skip unnecessary copies during schema walking by @Viicos in #10286
- Refactor namespace logic for annotations evaluation by @Viicos in #10530
- Improve email regexp on edge cases by @AlekseyLobanov in #10601
CoreMetadatarefactor with an emphasis on documentation, schema build time performance, and reducing complexity by @sydney-runkle in #10675
Fixes
- Remove guarding check on
computed_fieldwithfield_serializerby @nix010 in #10390 - Fix
Predicateissue inv2.9.0by @sydney-runkle in #10321 - Fixing
annotated-typesbound by @sydney-runkle in #10327 - Turn
tzdatainstall requirement into optionaltimezonedependency by @jakob-keller in #10331 - Use correct types namespace when building
namedtuplecore schemas by @Viicos in #10337 - Fix evaluation of stringified annotations during namespace inspection by @Viicos in #10347
- Fix
IncExtype alias definition by @Viicos in #10339 - Do not error when trying to evaluate annotations of private attributes by @Viicos in #10358
- Fix nested type statement by @kc0506 in #10369
- Improve typing of
ModelMetaclass.mroby @Viicos in #10372 - Fix class access of deprecated
computed_fields by @Viicos in #10391 - Make sure
inspect.iscoroutinefunctionworks on coroutines decorated with@validate_callby @MovisLi in #10374 - Fix
NameErrorwhen usingvalidate_callwith PEP 695 on a class by @kc0506 in #10380 - Fix
ZoneInfowith various invalid types by @sydney-runkle in #10408 - Fix
PydanticUserErroron emptymodel_configwith annotations by @cdwilson in #10412 - Fix variance issue in
_IncExtype alias, only allowTrueby @Viicos in #10414 - Fix serialization schema generation when using
PlainValidatorby @Viicos in #10427 - Fix schema generation error when serialization schema holds references by @Viicos in #10444
- Inline references if possible when generating schema for
json_schema_input_typeby @Viicos in #10439 - Fix recursive arguments in
Representationby @Viicos in #10480 - Fix representation for builtin function types by @kschwab in #10479
- Add python validators for decimal constraints (
max_digitsanddecimal_places) by @sydney-runkle in #10506 - Only fetch
__pydantic_core_schema__from the current class during schema generation by @Viicos in #10518 - Fix
stacklevelon deprecation warnings forBaseModelby @sydney-runkle in #10520 - Fix warning
stacklevelinBaseModel.__init__by @Viicos in #10526 - Improve error handling for in-evaluable refs for discriminator application by @sydney-runkle in #10440
- Change the signature of
ConfigWrapper.core_configto take the title directly by @Viicos in #10562 - Do not use the previous config from the stack for dataclasses without config by @Viicos in #10576
- Fix serialization for IP types with
mode='python'by @sydney-runkle in #10594 - Support constraint application for
Base64Etctypes by @sydney-runkle in #10584 - Fix
validate_callignoringFieldinAnnotatedby @kc0506 in #10610 - Raise an error when
Selfis invalid by @kc0506 in #10609 - Using
core_schema.InvalidSchemainstead of metadata injection + checks by @sydney-runkle in #10523 - Tweak type alias logic by @kc0506 in #10643
- Support usage of
typewithtyping.Selfand type aliases by @kc0506 in #10621 - Use overloads for
FieldandPrivateAttrfunctions by @Viicos in #10651 - Clean up the
mypyplugin implementation by @Viicos in #10669 - Properly check for
typing_extensionsvariant ofTypeAliasTypeby @Daraan in #10713 - Allow any mapping in
BaseModel.model_copy()by @Viicos in #10751 - Fix
isinstancebehavior for urls by @sydney-runkle in #10766 - Ensure
cached_propertycan be set on Pydantic models by @Viicos in #10774 - Fix equality checks for primitives in literals by @sydney-runkle in pydantic/pydantic-core#1459
- Properly enforce
host_requiredfor URLs by @Viicos in pydantic/pydantic-core#1488 - Fix when
coerce_numbers_to_strenabled and string has invalid Unicode character by @andrey-berenda in pydantic/pydantic-core#1515 - Fix serializing
complexvalues inEnums by @changhc in pydantic/pydantic-core#1524 - Refactor
_typing_extramodule by @Viicos in #10725 - Support intuitive equality for urls by @sydney-runkle in #10798
- Add
bytearraytoTypeAdapter.validate_jsonsignature by @samuelcolvin in #10802 - Ensure class access of method descriptors is performed when used as a default with
Fieldby @Viicos in #10816 - Fix circular import with
validate_callby @sydney-runkle in #10807 - Fix error when using type aliases referencing other type aliases by @Viicos in #10809
- Fix
IncExtype alias to be compatible with mypy by @Viicos in #10813 - Make
__signature__a lazy property, do not deepcopy defaults by @Viicos in #10818 - Make
__signature__lazy for dataclasses, too by @sydney-runkle in #10832 - Subclass all single host url classes from
AnyUrlto preserve behavior from v2.9 by @sydney-runkle in #10856
New Contributors
- @jakob-keller made their first contribution in #10331
- @MovisLi made their first contribution in #10374
- @joaopalmeiro made their first contribution in #10405
- @theunkn0wn1 made their first contribution in #10378
- @cdwilson made their first contribution in #10412
- @dlax made their first contribution in #10421
- @kschwab made their first contribution in #10479
- @santibreo made their first contribution in #10453
- @FlorianSW made their first contribution in #10478
- @tkasuz made their first contribution in #10555
- @AlekseyLobanov made their first contribution in #10601
- @NiclasvanEyk made their first contribution in #10667
- @mschoettle made their first contribution in #10677
- @Daraan made their first contribution in #10713
- @k4nar made their first contribution in #10736
- @UriyaHarpeness made their first contribution in #10740
- @frfahim made their first contribution in #10727
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.0
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.0b2 2024-11-13
What's Changed
Packaging
- Replaced pdm with uv by @frfahim in #10727
New Features
- Add
trailing-stringssupport toexperimental_allow_partialby @sydney-runkle in #10825 - Add
rebuild()method forTypeAdapterand simplifydefer_buildpatterns by @sydney-runkle in #10537
Fixes
- Refactor
_typing_extramodule by @Viicos in #10725 - Support intuitive equality for urls by @sydney-runkle in #10798
- Add
bytearraytoTypeAdapter.validate_jsonsignature by @samuelcolvin in #10802 - Ensure class access of method descriptors is performed when used as a default with
Fieldby @Viicos in #10816 - Fix circular import with
validate_callby @sydney-runkle in #10807 - Fix error when using type aliases referencing other type aliases by @Viicos in #10809
- Fix
IncExtype alias to be compatible with mypy by @Viicos in #10813 - Make
__signature__a lazy property, do not deepcopy defaults by @Viicos in #10818 - Make
__signature__lazy for dataclasses, too by @sydney-runkle in #10832
New Contributors
- @frfahim made their first contribution in #10727
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.10.0b1...v2.10.0b2
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.10.0b1 (2024-11-06)
What's Changed
Packaging
- Bump
pydantic-coretov2.26.0by @samuelcolvin in #10748
New Features
- Support
fractions.Fractionby @sydney-runkle in #10318 - Support
Hashablefor json validation by @sydney-runkle in #10324 - Add a
SocketPathtype forlinuxsystems by @theunkn0wn1 in #10378 - Allow arbitrary refs in JSON schema
examplesby @sydney-runkle in #10417 - Support
defer_buildfor Pydantic dataclasses by @Viicos in #10313 - Adding v1 / v2 incompatibility warning for nested v1 model by @sydney-runkle in #10431
- Add support for unpacked
TypedDictto type hint variadic keyword arguments with@validate_callby @Viicos in #10416 - Support compiled patterns in
protected_namespacesby @sydney-runkle in #10522 - Add support for
propertyNamesin JSON schema by @FlorianSW in #10478 - Adding
__replace__protocol for Python 3.13+ support by @sydney-runkle in #10596 - Expose public
sortmethod for JSON schema generation by @sydney-runkle in #10595 - Add runtime validation of
@validate_callcallable argument by @kc0506 in #10627 - Add
experimental_allow_partialsupport by @samuelcolvin in #10748 - Support default factories taking validated data as an argument by @Viicos in #10678
- Allow subclassing
ValidationErrorandPydanticCustomErrorby @Youssefares in pydantic/pydantic-core#1413 - see release blog post for usage details.
Changes
- Don't allow customization of
SchemaGeneratoruntil interface is more stable by @sydney-runkle in #10303 - Cleanly
defer_buildonTypeAdapters, removing experimental flag by @sydney-runkle in #10329 - Fix
mroof generic subclass by @kc0506 in #10100 - Strip whitespaces on JSON Schema title generation by @sydney-runkle in #10404
- Use
b64decodeandb64encodeforBase64Bytestype by @sydney-runkle in #10486 - Relax protected namespace config default by @sydney-runkle in #10441 - see release blog post for more details.
- Revalidate parametrized generics if instance's origin is subclass of OG class by @sydney-runkle in #10666
- Warn if configuration is specified on the
@dataclassdecorator and with the__pydantic_config__attribute by @sydney-runkle in #10406 - Recommend against using
Ellipsis(...) withFieldby @Viicos in #10661 - Migrate to subclassing instead of annotated approach for pydantic url types by @sydney-runkle in #10662
- Change JSON schema generation of
Literals andEnumsby @Viicos in #10692 - Simplify unions involving
AnyorNeverwhen replacing type variables by @Viicos in #10338 - Do not require padding when decoding
base64bytes by @bschoenmaeckers in pydantic/pydantic-core#1448 - Support dates all the way to 1BC by @changhc in pydantic/speedate#77
Performance
- Schema cleaning: skip unnecessary copies during schema walking by @Viicos in #10286
- Refactor namespace logic for annotations evaluation by @Viicos in #10530
- Improve email regexp on edge cases by @AlekseyLobanov in #10601
CoreMetadatarefactor with an emphasis on documentation, schema build time performance, and reducing complexity by @sydney-runkle in #10675
Fixes
- Remove guarding check on
computed_fieldwithfield_serializerby @nix010 in #10390 - Fix
Predicateissue inv2.9.0by @sydney-runkle in #10321 - Fixing
annotated-typesbound by @sydney-runkle in #10327 - Turn
tzdatainstall requirement into optionaltimezonedependency by @jakob-keller in #10331 - Use correct types namespace when building
namedtuplecore schemas by @Viicos in #10337 - Fix evaluation of stringified annotations during namespace inspection by @Viicos in #10347
- Fix
IncExtype alias definition by @Viicos in #10339 - Do not error when trying to evaluate annotations of private attributes by @Viicos in #10358
- Fix nested type statement by @kc0506 in #10369
- Improve typing of
ModelMetaclass.mroby @Viicos in #10372 - Fix class access of deprecated
computed_fields by @Viicos in #10391 - Make sure
inspect.iscoroutinefunctionworks on coroutines decorated with@validate_callby @MovisLi in #10374 - Fix
NameErrorwhen usingvalidate_callwith PEP 695 on a class by @kc0506 in #10380 - Fix
ZoneInfowith various invalid types by @sydney-runkle in #10408 - Fix
PydanticUserErroron emptymodel_configwith annotations by @cdwilson in #10412 - Fix variance issue in
_IncExtype alias, only allowTrueby @Viicos in #10414 - Fix serialization schema generation when using
PlainValidatorby @Viicos in #10427 - Fix schema generation error when serialization schema holds references by @Viicos in #10444
- Inline references if possible when generating schema for
json_schema_input_typeby @Viicos in #10439 - Fix recursive arguments in
Representationby @Viicos in #10480 - Fix representation for builtin function types by @kschwab in #10479
- Add python validators for decimal constraints (
max_digitsanddecimal_places) by @sydney-runkle in #10506 - Only fetch
__pydantic_core_schema__from the current class during schema generation by @Viicos in #10518 - Fix
stacklevelon deprecation warnings forBaseModelby @sydney-runkle in #10520 - Fix warning
stacklevelinBaseModel.__init__by @Viicos in #10526 - Improve error handling for in-evaluable refs for discriminator application by @sydney-runkle in #10440
- Change the signature of
ConfigWrapper.core_configto take the title directly by @Viicos in #10562 - Do not use the previous config from the stack for dataclasses without config by @Viicos in #10576
- Fix serialization for IP types with
mode='python'by @sydney-runkle in #10594 - Support constraint application for
Base64Etctypes by @sydney-runkle in #10584 - Fix
validate_callignoringFieldinAnnotatedby @kc0506 in #10610 - Raise an error when
Selfis invalid by @kc0506 in #10609 - Using
core_schema.InvalidSchemainstead of metadata injection + checks by @sydney-runkle in #10523 - Tweak type alias logic by @kc0506 in #10643
- Support usage of
typewithtyping.Selfand type aliases by @kc0506 in #10621 - Use overloads for
FieldandPrivateAttrfunctions by @Viicos in #10651 - Clean up the
mypyplugin implementation by @Viicos in #10669 - Properly check for
typing_extensionsvariant ofTypeAliasTypeby @Daraan in #10713 - Allow any mapping in
BaseModel.model_copy()by @Viicos in #10751 - Fix
isinstancebehavior for urls by @sydney-runkle in #10766 - Ensure
cached_propertycan be set on Pydantic models by @Viicos in #10774 - Fix equality checks for primitives in literals by @sydney-runkle in pydantic/pydantic-core#1459
- Properly enforce
host_requiredfor URLs by @Viicos in pydantic/pydantic-core#1488 - Fix when
coerce_numbers_to_strenabled and string has invalid Unicode character by @andrey-berenda in pydantic/pydantic-core#1515 - Fix serializing
complexvalues inEnums by @changhc in pydantic/pydantic-core#1524
New Contributors
- @jakob-keller made their first contribution in #10331
- @MovisLi made their first contribution in #10374
- @joaopalmeiro made their first contribution in #10405
- @theunkn0wn1 made their first contribution in #10378
- @cdwilson made their first contribution in #10412
- @dlax made their first contribution in #10421
- @kschwab made their first contribution in #10479
- @santibreo made their first contribution in #10453
- @FlorianSW made their first contribution in #10478
- @tkasuz made their first contribution in #10555
- @AlekseyLobanov made their first contribution in #10601
- @NiclasvanEyk made their first contribution in #10667
- @mschoettle made their first contribution in #10677
- @Daraan made their first contribution in #10713
- @k4nar made their first contribution in #10736
- @UriyaHarpeness made their first contribution in #10740
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.2...v2.10.0b1
- Python
Published by sydney-runkle over 1 year ago
pydantic - v1.10.19 (2024-11-06)
What's Changed
- Add warning when v2 model is nested in v1 model by @sydney-runkle in https://github.com/pydantic/pydantic/pull/10432
- Fix deprecation warning in V1
isinstancecheck by @alicederyn in https://github.com/pydantic/pydantic/pull/10645
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.9.2 (2024-09-17)
What's Changed
Fixes
- Do not error when trying to evaluate annotations of private attributes by @Viicos in #10358
- Adding notes on designing sound
Callablediscriminators by @sydney-runkle in #10400 - Fix serialization schema generation when using
PlainValidatorby @Viicos in #10427 - Fix
Unionserialization warnings by @sydney-runkle in pydantic/pydantic-core#1449 - Fix variance issue in
_IncExtype alias, only allowTrueby @Viicos in #10414 - Fix
ZoneInfovalidation with various invalid types by @sydney-runkle in #10408
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.1...v2.9.2
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.9.1 (2024-09-09)
What's Changed
Fixes
- Fix Predicate issue in v2.9.0 by @sydney-runkle in #10321
- Fixing
annotated-typesbound to>=0.6.0by @sydney-runkle in #10327 - Turn
tzdatainstall requirement into optionaltimezonedependency by @jakob-keller in #10331 - Fix
IncExctype alias definition by @Viicos in #10339 - Use correct types namespace when building namedtuple core schemas by @Viicos in #10337
- Fix evaluation of stringified annotations during namespace inspection by @Viicos in #10347
- Fix tagged union serialization with alias generators by @sydney-runkle in pydantic/pydantic-core#1442
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.9.0...v2.9.1
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.9.0 (2024-09-05)
The code released in v2.9.0 is practically identical to that of v2.9.0b2.
Check out our blog post to learn more about the release highlights!
What's Changed
Packaging
- Bump
rufftov0.5.0andpyrighttov1.1.369by @sydney-runkle in #9801 - Bump
pydantic-extra-typestov2.9.0by @sydney-runkle in #9832 - Support compatibility with
pdm v2.18.1by @Viicos in #10138 - Bump
v1version stub tov1.10.18by @sydney-runkle in #10214 - Bump
pydantic-coretov2.23.2by @sydney-runkle in #10311
New Features
- Add support for
ZoneInfoby @Youssefares in #9896 - Add
Config.val_json_bytesby @josh-newman in #9770 - Add DSN for Snowflake by @aditkumar72 in #10128
- Support
complexnumber by @changhc in #9654 - Add support for
annotated_types.Notby @aditkumar72 in #10210 - Allow
WithJsonSchemato inject$refs w/httporhttpslinks by @dAIsySHEng1 in #9863 - Allow validators to customize validation JSON schema by @Viicos in #10094
- Support parametrized
PathLiketypes by @nix010 in #9764 - Add tagged union serializer that attempts to use
strorcallablediscriminators to select the correct serializer by @sydney-runkle in in pydantic/pydantic-core#1397
Changes
- Breaking Change: Merge
dicttypejson_schema_extraby @sydney-runkle in #9792- For more info (how to replicate old behavior) on this change, see here
- Refactor annotation injection for known (often generic) types by @sydney-runkle in #9979
- Move annotation compatibility errors to validation phase by @sydney-runkle in #9999
- Improve runtime errors for string constraints like
patternfor incompatible types by @sydney-runkle in #10158 - Remove
'allOf'JSON schema workarounds by @dpeachey in #10029 - Remove
typed_dict_clsdata fromCoreMetadataby @sydney-runkle in #10180 - Deprecate passing a dict to the
Examplesclass by @Viicos in #10181 - Remove
initial_metadatafrom internal metadata construct by @sydney-runkle in #10194 - Use
re.Pattern.searchinstead ofre.Pattern.matchfor consistency withrustbehavior by @tinez in pydantic/pydantic-core#1368 - Show value of wrongly typed data in
pydantic-coreserialization warning by @BoxyUwU in pydantic/pydantic-core#1377 - Breaking Change: in
pydantic-core, changemetadatatype hint in core schemas fromAny->Dict[str, Any] | Noneby @sydney-runkle in pydantic/pydantic-core#1411 - Raise helpful warning when
selfisn't returned from model validator by @sydney-runkle in #10255
Performance
- Initial start at improving import times for modules, using caching primarily by @sydney-runkle in #10009
- Using cached internal import for
BaseModelby @sydney-runkle in #10013 - Simplify internal generics logic - remove generator overhead by @sydney-runkle in #10059
- Remove default module globals from types namespace by @sydney-runkle in #10123
- Performance boost: skip caching parent namespaces in most cases by @sydney-runkle in #10113
- Update ns stack with already copied ns by @sydney-runkle in #10267
Minor Internal Improvements
- ⚡️ Speed up
multiple_of_validator()by 31% inpydantic/_internal/_validators.pyby @misrasaurabh1 in #9839 - ⚡️ Speed up
ModelPrivateAttr.__set_name__()by 18% inpydantic/fields.pyby @misrasaurabh1 in #9841 - ⚡️ Speed up
dataclass()by 7% inpydantic/dataclasses.pyby @misrasaurabh1 in #9843 - ⚡️ Speed up function
_field_name_for_signatureby 37% inpydantic/_internal/_signature.pyby @misrasaurabh1 in #9951 - ⚡️ Speed up method
GenerateSchema._unpack_refs_defsby 26% inpydantic/_internal/_generate_schema.pyby @misrasaurabh1 in #9949 - ⚡️ Speed up function
apply_each_item_validatorsby 100% inpydantic/_internal/_generate_schema.pyby @misrasaurabh1 in #9950 - ⚡️ Speed up method
ConfigWrapper.core_configby 28% inpydantic/_internal/_config.pyby @misrasaurabh1 in #9953
Fixes
- Respect
use_enum_valuesonLiteraltypes by @kwint in #9787 - Prevent type error for exotic
BaseModel/RootModelinheritance by @dmontagu in #9913 - Fix typing issue with field_validator-decorated methods by @dmontagu in #9914
- Replace
strtype annotation withAnyin validator factories in documentation on validators by @maximilianfellhuber in #9885 - Fix
ComputedFieldInfo.wrapped_propertypointer when a property setter is assigned by @tlambert03 in #9892 - Fix recursive typing of
main.IncEnxby @tlambert03 in #9924 - Allow usage of
type[Annotated[...]]by @Viicos in #9932 mypyplugin: handle frozen fields on a per-field basis by @dmontagu in #9935- Fix typo in
invalid-annotated-typeerror code by @sydney-runkle in #9948 - Simplify schema generation for
uuid,url, andiptypes by @sydney-runkle in #9975 - Move
dateschemas to_generate_schema.pyby @sydney-runkle in #9976 - Move
decimal.Decimalvalidation to_generate_schema.pyby @sydney-runkle in #9977 - Simplify IP address schema in
_std_types_schema.pyby @sydney-runkle in #9959 - Fix type annotations for some potentially generic
GenerateSchema.match_typeoptions by @sydney-runkle in #9961 - Add class name to "has conflict" warnings by @msabramo in #9964
- Fix
dataclassignoringdefault_factorypassed in Annotated by @kc0506 in #9971 - Fix
Sequenceignoringdiscriminatorby @kc0506 in #9980 - Fix typing for
IPvAnyAddressandIPvAnyInterfaceby @haoyun in #9990 - Fix false positives on v1 models in
mypyplugin forfrom_ormcheck requiring from_attributes=True config by @radekwlsk in #9938 - Apply
strict=Trueto__init__inmypyplugin by @kc0506 in #9998 - Refactor application of
dequeannotations by @sydney-runkle in #10018 - Raise a better user error when failing to evaluate a forward reference by @Viicos in #10030
- Fix evaluation of
__pydantic_extra__annotation in specific circumstances by @Viicos in #10070 - Fix
frozenenforcement fordataclassesby @sydney-runkle in #10066 - Remove logic to handle unused
__get_pydantic_core_schema__signature by @Viicos in #10075 - Use
is_annotatedconsistently by @Viicos in #10095 - Fix
PydanticDeprecatedSince26typo by @kc0506 in #10101 - Improve
pyrighttests, refactor model decorators signatures by @Viicos in #10092 - Fix
ipserialization logic by @sydney-runkle in #10112 - Warn when frozen defined twice for
dataclassesby @mochi22 in #10082 - Do not compute JSON Schema default when plain serializers are used with
when_usedset to'json-unless-none'and the default value isNoneby @Viicos in #10121 - Fix
ImportStringspecial cases by @sydney-runkle in #10137 - Blacklist default globals to support exotic user code with
__prefixed annotations by @sydney-runkle in #10136 - Handle
nullableschemas withserializationschema available during JSON Schema generation by @Viicos in #10132 - Reorganize
BaseModelannotations by @kc0506 in #10110 - Fix core schema simplification when serialization schemas are involved in specific scenarios by @Viicos in #10155
- Add support for stringified annotations when using
PrivateAttrwithAnnotatedby @Viicos in #10157 - Fix JSON Schema
numbertype for literal and enum schemas by @Viicos in #10172 - Fix JSON Schema generation of fields with plain validators in serialization mode by @Viicos in #10167
- Fix invalid JSON Schemas being generated for functions in certain scenarios by @Viicos in #10188
- Make sure generated JSON Schemas are valid in tests by @Viicos in #10182
- Fix key error with custom serializer by @sydney-runkle in #10200
- Add 'wss' for allowed schemes in NatsDsn by @swelborn in #10224
- Fix
MappingandMutableMappingannotations to use mapping schema instead of dict schema by @sydney-runkle in #10020 - Fix JSON Schema generation for constrained dates by @Viicos in #10185
- Fix discriminated union bug regression when using enums by @kfreezen in pydantic/pydantic-core#1286
- Fix
field_serializerwith computed field when using*by @nix010 in pydantic/pydantic-core#1349 - Try each option in
Unionserializer before inference by @sydney-runkle in pydantic/pydantic-core#1398 - Fix
floatserialization behavior instrictmode by @sydney-runkle in pydantic/pydantic-core#1400 - Introduce
exactnessinto Decimal validation logic to improve union validation behavior by @sydney-runkle in in pydantic/pydantic-core#1405 - Fix new warnings assertions to use
pytest.warns()by @mgorny in #10241 - Fix a crash when cleaning the namespace in
ModelMetaclassby @Viicos in #10242 - Fix parent namespace issue with model rebuilds by @sydney-runkle in #10257
- Remove defaults filter for namespace by @sydney-runkle in #10261
- Use identity instead of equality after validating model in
__init__by @Viicos in #10264 - Support
BigIntserialization forintsubclasses by @kxx317 in pydantic/pydantic-core#1417 - Support signature for wrap validators without
infoby @sydney-runkle in #10277 - Ensure
__pydantic_complete__is set when rebuildingdataclassesby @Viicos in #10291 - Respect
schema_generatorconfig value inTypeAdapterby @sydney-runkle in #10300
New Contributors
pydantic
- @kwint made their first contribution in #9787
- @seekinginfiniteloop made their first contribution in #9822
- @a-alexander made their first contribution in #9848
- @maximilianfellhuber made their first contribution in #9885
- @karmaBonfire made their first contribution in #9945
- @s-rigaud made their first contribution in #9958
- @msabramo made their first contribution in #9964
- @DimaCybr made their first contribution in #9972
- @kc0506 made their first contribution in #9971
- @haoyun made their first contribution in #9990
- @radekwlsk made their first contribution in #9938
- @dpeachey made their first contribution in #10029
- @BoxyUwU made their first contribution in #10085
- @mochi22 made their first contribution in #10082
- @aditkumar72 made their first contribution in #10128
- @changhc made their first contribution in #9654
- @insumanth made their first contribution in #10229
- @AdolfoVillalobos made their first contribution in #10240
- @bllchmbrs made their first contribution in #10270
pydantic-core
- @kfreezen made their first contribution in pydantic/pydantic-core#1286
- @tinez made their first contribution in pydantic/pydantic-core#1368
- @fft001 made their first contribution in pydantic/pydantic-core#1362
- @nix010 made their first contribution in pydantic/pydantic-core#1349
- @BoxyUwU made their first contribution in pydantic/pydantic-core#1379
- @candleindark made their first contribution in pydantic/pydantic-core#1404
- @changhc made their first contribution in pydantic/pydantic-core#1331
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.9.0b2 (2024-08-30)
What's Changed
Packaging
- Bump
pydantic-coretov2.23.1and other minor version bumps by @sydney-runkle in #10269
Changes
- Raise helpful warning when
selfisn't returned from model validator by @sydney-runkle in #10255
Performance
- Update namespace stack with already copied namespace by @sydney-runkle in #10267
Fixes
- Fix new warnings assertions to use
pytest.warns()by @mgorny in #10241 - Fix a crash when cleaning the namespace in
ModelMetaclassby @Viicos in #10242 - Fix parent namespace issue with model rebuilds by @sydney-runkle in #10257
- Remove defaults filter for namespace by @sydney-runkle in #10261
- Use identity instead of equality after validating model in
__init__by @Viicos in #10264 - Support
BigIntserialization forintsubclasses by @kxx317 in pydantic/pydantic-core#1417
New Contributors
- @AdolfoVillalobos made their first contribution in #10240
- @bllchmbrs made their first contribution in #10270
- Python
Published by sydney-runkle over 1 year ago
pydantic - v2.9.0b1 (2024-08-26)
What's Changed
Packaging
- Bump
rufftov0.5.0andpyrighttov1.1.369by @sydney-runkle in #9801 - Bump
pydantic-extra-typestov2.9.0by @sydney-runkle in #9832 - Support compatibility with
pdm v2.18.1by @Viicos in #10138 - Bump
pydantic-coreto v2.23.0 by @sydney-runkle in #10180 - Bump
v1version stub tov1.10.18by @sydney-runkle in #10214
New Features
- Add support for
ZoneInfoby @Youssefares in #9896 - Add
Config.val_json_bytesby @josh-newman in #9770 - Add DSN for Snowflake by @aditkumar72 in #10128
- Support
complexnumber by @changhc in #9654 - Add support for
annotated_types.Notby @aditkumar72 in #10210 - Allow
WithJsonSchemato inject$refs w/httporhttpslinks by @dAIsySHEng1 in #9863 - Allow validators to customize validation JSON schema by @Viicos in #10094
- Support parametrized
PathLiketypes by @nix010 in #9764 - Add tagged union serializer that attempts to use
strorcallablediscriminators to select the correct serializer by @sydney-runkle in in pydantic/pydantic-core#1397
Changes
- Breaking Change: Merge
dicttypejson_schema_extraby @sydney-runkle in #9792- For more info (how to replicate old behavior) on this change, see here
- Refactor annotation injection for known (often generic) types by @sydney-runkle in #9979
- Move annotation compatibility errors to validation phase by @sydney-runkle in #9999
- Improve runtime errors for string constraints like
patternfor incompatible types by @sydney-runkle in #10158 - Remove
'allOf'JSON schema workarounds by @dpeachey in #10029 - Remove
typed_dict_clsdata fromCoreMetadataby @sydney-runkle in #10180 - Deprecate passing a dict to the
Examplesclass by @Viicos in #10181 - Remove
initial_metadatafrom internal metadata construct by @sydney-runkle in #10194 - Use
re.Pattern.searchinstead ofre.Pattern.matchfor consistency withrustbehavior by @tinez in pydantic/pydantic-core#1368 - Show value of wrongly typed data in
pydantic-coreserialization warning by @BoxyUwU in pydantic/pydantic-core#1377 - Breaking Change: in
pydantic-core, changemetadatatype hint in core schemas fromAny->Dict[str, Any] | Noneby @sydney-runkle in pydantic/pydantic-core#1411
Performance
- Initial start at improving import times for modules, using caching primarily by @sydney-runkle in #10009
- Using cached internal import for
BaseModelby @sydney-runkle in #10013 - Simplify internal generics logic - remove generator overhead by @sydney-runkle in #10059
- Remove default module globals from types namespace by @sydney-runkle in #10123
- Performance boost: skip caching parent namespaces in most cases by @sydney-runkle in #10113
Minor Internal Improvements
- ⚡️ Speed up
multiple_of_validator()by 31% inpydantic/_internal/_validators.pyby @misrasaurabh1 in #9839 - ⚡️ Speed up
ModelPrivateAttr.__set_name__()by 18% inpydantic/fields.pyby @misrasaurabh1 in #9841 - ⚡️ Speed up
dataclass()by 7% inpydantic/dataclasses.pyby @misrasaurabh1 in #9843 - ⚡️ Speed up function
_field_name_for_signatureby 37% inpydantic/_internal/_signature.pyby @misrasaurabh1 in #9951 - ⚡️ Speed up method
GenerateSchema._unpack_refs_defsby 26% inpydantic/_internal/_generate_schema.pyby @misrasaurabh1 in #9949 - ⚡️ Speed up function
apply_each_item_validatorsby 100% inpydantic/_internal/_generate_schema.pyby @misrasaurabh1 in #9950 - ⚡️ Speed up method
ConfigWrapper.core_configby 28% inpydantic/_internal/_config.pyby @misrasaurabh1 in #9953
Fixes
- Respect
use_enum_valuesonLiteraltypes by @kwint in #9787 - Prevent type error for exotic
BaseModel/RootModelinheritance by @dmontagu in #9913 - Fix typing issue with field_validator-decorated methods by @dmontagu in #9914
- Replace
strtype annotation withAnyin validator factories in documentation on validators by @maximilianfellhuber in #9885 - Fix
ComputedFieldInfo.wrapped_propertypointer when a property setter is assigned by @tlambert03 in #9892 - Fix recursive typing of
main.IncEnxby @tlambert03 in #9924 - Allow usage of
type[Annotated[...]]by @Viicos in #9932 mypyplugin: handle frozen fields on a per-field basis by @dmontagu in #9935- Fix typo in
invalid-annotated-typeerror code by @sydney-runkle in #9948 - Simplify schema generation for
uuid,url, andiptypes by @sydney-runkle in #9975 - Move
dateschemas to_generate_schema.pyby @sydney-runkle in #9976 - Move
decimal.Decimalvalidation to_generate_schema.pyby @sydney-runkle in #9977 - Simplify IP address schema in
_std_types_schema.pyby @sydney-runkle in #9959 - Fix type annotations for some potentially generic
GenerateSchema.match_typeoptions by @sydney-runkle in #9961 - Add class name to "has conflict" warnings by @msabramo in #9964
- Fix
dataclassignoringdefault_factorypassed in Annotated by @kc0506 in #9971 - Fix
Sequenceignoringdiscriminatorby @kc0506 in #9980 - Fix typing for
IPvAnyAddressandIPvAnyInterfaceby @haoyun in #9990 - Fix false positives on v1 models in
mypyplugin forfrom_ormcheck requiring from_attributes=True config by @radekwlsk in #9938 - Apply
strict=Trueto__init__inmypyplugin by @kc0506 in #9998 - Refactor application of
dequeannotations by @sydney-runkle in #10018 - Raise a better user error when failing to evaluate a forward reference by @Viicos in #10030
- Fix evaluation of
__pydantic_extra__annotation in specific circumstances by @Viicos in #10070 - Fix
frozenenforcement fordataclassesby @sydney-runkle in #10066 - Remove logic to handle unused
__get_pydantic_core_schema__signature by @Viicos in #10075 - Use
is_annotatedconsistently by @Viicos in #10095 - Fix
PydanticDeprecatedSince26typo by @kc0506 in #10101 - Improve
pyrighttests, refactor model decorators signatures by @Viicos in #10092 - Fix
ipserialization logic by @sydney-runkle in #10112 - Warn when frozen defined twice for
dataclassesby @mochi22 in #10082 - Do not compute JSON Schema default when plain serializers are used with
when_usedset to'json-unless-none'and the default value isNoneby @Viicos in #10121 - Fix
ImportStringspecial cases by @sydney-runkle in #10137 - Blacklist default globals to support exotic user code with
__prefixed annotations by @sydney-runkle in #10136 - Handle
nullableschemas withserializationschema available during JSON Schema generation by @Viicos in #10132 - Reorganize
BaseModelannotations by @kc0506 in #10110 - Fix core schema simplification when serialization schemas are involved in specific scenarios by @Viicos in #10155
- Add support for stringified annotations when using
PrivateAttrwithAnnotatedby @Viicos in #10157 - Fix JSON Schema
numbertype for literal and enum schemas by @Viicos in #10172 - Fix JSON Schema generation of fields with plain validators in serialization mode by @Viicos in #10167
- Fix invalid JSON Schemas being generated for functions in certain scenarios by @Viicos in #10188
- Make sure generated JSON Schemas are valid in tests by @Viicos in #10182
- Fix key error with custom serializer by @sydney-runkle in #10200
- Add 'wss' for allowed schemes in NatsDsn by @swelborn in #10224
- Fix
MappingandMutableMappingannotations to use mapping schema instead of dict schema by @sydney-runkle in #10020 - Fix JSON Schema generation for constrained dates by @Viicos in #10185
- Fix discriminated union bug regression when using enums by @kfreezen in pydantic/pydantic-core#1286
- Fix
field_serializerwith computed field when using*by @nix010 in pydantic/pydantic-core#1349 - Try each option in
Unionserializer before inference by @sydney-runkle in pydantic/pydantic-core#1398 - Fix
floatserialization behavior instrictmode by @sydney-runkle in pydantic/pydantic-core#1400 - Introduce
exactnessinto Decimal validation logic to improve union validation behavior by @sydney-runkle in in pydantic/pydantic-core#1405
New Contributors
pydantic
- @kwint made their first contribution in #9787
- @seekinginfiniteloop made their first contribution in #9822
- @a-alexander made their first contribution in #9848
- @maximilianfellhuber made their first contribution in #9885
- @karmaBonfire made their first contribution in #9945
- @s-rigaud made their first contribution in #9958
- @msabramo made their first contribution in #9964
- @DimaCybr made their first contribution in #9972
- @kc0506 made their first contribution in #9971
- @haoyun made their first contribution in #9990
- @radekwlsk made their first contribution in #9938
- @dpeachey made their first contribution in #10029
- @BoxyUwU made their first contribution in #10085
- @mochi22 made their first contribution in #10082
- @aditkumar72 made their first contribution in #10128
- @changhc made their first contribution in #9654
- @insumanth made their first contribution in #10229
pydantic-core
- @kfreezen made their first contribution in pydantic/pydantic-core#1286
- @tinez made their first contribution in pydantic/pydantic-core#1368
- @fft001 made their first contribution in pydantic/pydantic-core#1362
- @nix010 made their first contribution in pydantic/pydantic-core#1349
- @BoxyUwU made their first contribution in pydantic/pydantic-core#1379
- @candleindark made their first contribution in pydantic/pydantic-core#1404
- @changhc made their first contribution in pydantic/pydantic-core#1331
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.8.1...v2.8.2
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v1.10.18 (2024-08-22)
What's Changed
Fixes
- Eval type fix in V1 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/9751
- Add
to_lower_camelto__all__inutils.pyby @sydney-runkle (direct commit) - Fix
mypyv1 plugin for mypy 1.11 release by @flaeppe in https://github.com/pydantic/pydantic/pull/10139 - Fix discriminator key used when discriminator has alias and
.schema(by_alias=False)by @exs-dwoodward in https://github.com/pydantic/pydantic/pull/10146
New Contributors
- @flaeppe made their first contribution in https://github.com/pydantic/pydantic/pull/10139
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.17...v1.10.18
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.8.2 (2024-07-03)
What's Changed
Fixes
- Fix issue with assertion caused by pluggable schema validator by @dmontagu in #9838
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.8.1...v2.8.2
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.8.1 (2024-07-03)
What's Changed
Packaging
- Bump
rufftov0.5.0andpyrighttov1.1.369by @sydney-runkle in #9801 - Bump
pydantic-coretov2.20.1,pydantic-extra-typestov2.9.0by @sydney-runkle in #9832
Fixes
- Fix breaking change in
to_snakefrom v2.7 -> v2.8 by @sydney-runkle in #9812 - Fix list constraint json schema application by @sydney-runkle in #9818
- Support time duration more than 23 by @nix010 in pydantic/speedate#64
- Fix millisecond fraction being handled with the wrong scale by @davidhewitt in pydantic/speedate#65
- Handle negative fractional durations correctly by @sydney-runkle in pydantic/speedate#71
New Contributors
- @kwint made their first contribution in https://github.com/pydantic/pydantic/pull/9787
- @seekinginfiniteloop made their first contribution in https://github.com/pydantic/pydantic/pull/9822
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.8.0...v2.8.1
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.8.0 (2024-07-01)
The code released in v2.8.0 is functionally identical to that of v2.8.0b1.
Check out our blog post to learn more about the release highlights!
What's Changed
Packaging
- Update citation version automatically with new releases by @sydney-runkle in #9673
- Bump pyright to
v1.1.367and add type checking tests for pipeline API by @adriangb in #9674 - Update
pydantic.v1stub tov1.10.17by @sydney-runkle in #9707 - General package updates to prep for
v2.8.0b1by @sydney-runkle in #9741 - Bump
pydantic-coretov2.20.0by @sydney-runkle in #9745 - Add support for Python 3.13 by @sydney-runkle in #9743
- Update
pdmversion used forpdm.locktov2.16.1by @sydney-runkle in #9761 - Update to
ruffv0.4.8by @Viicos in #9585
New Features
- Experimental: support
defer_buildforTypeAdapterby @MarkusSintonen in #8939 - Implement
deprecatedfield in json schema by @NeevCohen in #9298 - Experimental: Add pipeline API by @adriangb in #9459
- Add support for programmatic title generation by @NeevCohen in #9183
- Implement
fail_fastfeature by @uriyyo in #9708 - Add
ser_json_inf_nan='strings'mode to produce valid JSON by @josh-newman in pydantic/pydantic-core#1307
Changes
- Add warning when "alias" is set in ignored
Annotatedfield by @nix010 in #9170 - Support serialization of some serializable defaults in JSON schema by @sydney-runkle in #9624
- Relax type specification for
__validators__values increate_modelby @sydney-runkle in #9697 - Breaking Change: Improve
smartunion matching logic by @sydney-runkle in pydantic/pydantic-core#1322 You can read more about oursmartunion matching logic here. In some cases, if the old behavior is desired, you can switch toleft-to-rightmode and change the order of yourUnionmembers.
Performance
Internal Improvements
- ⚡️ Speed up
_display_error_loc()by 25% inpydantic/v1/error_wrappers.pyby @misrasaurabh1 in #9653 - ⚡️ Speed up
_get_all_json_refs()by 34% inpydantic/json_schema.pyby @misrasaurabh1 in #9650 - ⚡️ Speed up
is_pydantic_dataclass()by 41% inpydantic/dataclasses.pyby @misrasaurabh1 in #9652 - ⚡️ Speed up
to_snake()by 27% inpydantic/alias_generators.pyby @misrasaurabh1 in #9747 - ⚡️ Speed up
unwrap_wrapped_function()by 93% inpydantic/_internal/_decorators.pyby @misrasaurabh1 in #9727
Fixes
- Replace
__spec__.parentwith__package__by @hramezani in #9331 - Fix Outputted Model JSON Schema for
Sequencetype by @anesmemisevic in #9303 - Fix typing of
_frame_depthby @Viicos in #9353 - Make
ImportStringjson schema compatible by @amitschang in #9344 - Hide private attributes (
PrivateAttr) from__init__signature in type checkers by @idan22moral in #9293 - Make detection of
TypeVardefaults robust to the CPythonPEP-696implementation by @AlexWaygood in #9426 - Fix usage of
PlainSerializerwith builtin types by @Viicos in #9450 - Add more robust custom validation examples by @ChrisPappalardo in #9468
- Fix ignored
strictspecification forStringConstraint(strict=False)by @vbmendes in #9476 - Use
Selfwhere possible by @Viicos in #9479 - Do not alter
RootModel.model_constructsignature in themypyplugin by @Viicos in #9480 - Fixed type hint of
validation_contextby @OhioDschungel6 in #9508 - Support context being passed to TypeAdapter's
dump_json/dump_pythonby @alexcouper in #9495 - Updates type signature for
Field()constructor by @bjmc in #9484 - Improve builtin alias generators by @sydney-runkle in #9561
- Fix typing of
TypeAdapterby @Viicos in #9570 - Add fallback default value for private fields in
__setstate__of BaseModel by @anhpham1509 in #9584 - Support
PEP 746by @adriangb in #9587 - Allow validator and serializer functions to have default values by @Viicos in #9478
- Fix bug with mypy plugin's handling of covariant
TypeVarfields by @dmontagu in #9606 - Fix multiple annotation / constraint application logic by @sydney-runkle in #9623
- Respect
regexflags in validation and json schema by @sydney-runkle in #9591 - Fix type hint on
IpvAnyAddressby @sydney-runkle in #9640 - Allow a field specifier on
__pydantic_extra__by @dmontagu in #9659 - Use normalized case for file path comparison by @sydney-runkle in #9737
- Modify constraint application logic to allow field constraints on
Optional[Decimal]by @lazyhope in #9754 validate_calltype params fix by @sydney-runkle in #9760- Check all warnings returned by
pytest.warns()by @s-t-e-v-e-n-k in #9702 - Reuse
re.Patternobject in regex patterns to allow for regex flags by @sydney-runkle in pydantic/pydantic-core#1318
New Contributors
- @idan22moral made their first contribution in #9294
- @anesmemisevic made their first contribution in #9303
- @max-muoto made their first contribution in #9338
- @amitschang made their first contribution in #9344
- @paulmartin91 made their first contribution in #9410
- @OhioDschungel6 made their first contribution in #9405
- @AlexWaygood made their first contribution in #9426
- @kinuax made their first contribution in #9433
- @antoni-jamiolkowski made their first contribution in #9431
- @candleindark made their first contribution in #9448
- @nix010 made their first contribution in #9170
- @tomy0000000 made their first contribution in #9457
- @vbmendes made their first contribution in #9470
- @micheleAlberto made their first contribution in #9471
- @ChrisPappalardo made their first contribution in #9468
- @blueTurtz made their first contribution in #9475
- @WinterBlue16 made their first contribution in #9477
- @bittner made their first contribution in #9500
- @alexcouper made their first contribution in #9495
- @bjmc made their first contribution in #9484
- @pjvv made their first contribution in #9529
- @nedbat made their first contribution in #9530
- @gunnellEvan made their first contribution in #9469
- @jaymbans made their first contribution in #9531
- @MarcBresson made their first contribution in #9534
- @anhpham1509 made their first contribution in #9584
- @K-dash made their first contribution in #9595
- @s-t-e-v-e-n-k made their first contribution in #9527
- @airwoodix made their first contribution in #9506
- @misrasaurabh1 made their first contribution in #9653
- @AlessandroMiola made their first contribution in #9740
- @mylapallilavanyaa made their first contribution in #9746
- @lazyhope made their first contribution in #9754
- @YassinNouh21 made their first contribution in #9759
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.4...v2.8.0/
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.8.0b1 (2024-06-27)
What's Changed
Packaging
- Update citation version automatically with new releases by @sydney-runkle in #9673
- Bump pyright to
v1.1.367and add type checking tests for pipeline API by @adriangb in #9674 - Update
pydantic.v1stub tov1.10.17by @sydney-runkle in #9707 - General package updates to prep for
v2.8.0b1by @sydney-runkle in #9741 - Bump
pydantic-coretov2.20.0by @sydney-runkle in #9745 - Add support for Python 3.13 by @sydney-runkle in #9743
- Update
pdmversion used forpdm.locktov2.16.1by @sydney-runkle in #9761 - Update to
ruffv0.4.8by @Viicos in #9585
New Features
- Experimental: support
defer_buildforTypeAdapterby @MarkusSintonen in #8939 - Implement
deprecatedfield in json schema by @NeevCohen in #9298 - Experimental: Add pipeline API by @adriangb in #9459
- Add support for programmatic title generation by @NeevCohen in #9183
- Implement
fail_fastfeature by @uriyyo in #9708 - Add
ser_json_inf_nan='strings'mode to produce valid JSON by @josh-newman in pydantic/pydantic-core#1307
Changes
- Add warning when "alias" is set in ignored
Annotatedfield by @nix010 in #9170 - Support serialization of some serializable defaults in JSON schema by @sydney-runkle in #9624
- Relax type specification for
__validators__values increate_modelby @sydney-runkle in #9697 - Breaking Change: Improve
smartunion matching logic by @sydney-runkle in pydantic/pydantic-core#1322 You can read more about oursmartunion matching logic here. In some cases, if the old behavior is desired, you can switch toleft-to-rightmode and change the order of yourUnionmembers.
Performance
Internal Improvements
- ⚡️ Speed up
_display_error_loc()by 25% inpydantic/v1/error_wrappers.pyby @misrasaurabh1 in #9653 - ⚡️ Speed up
_get_all_json_refs()by 34% inpydantic/json_schema.pyby @misrasaurabh1 in #9650 - ⚡️ Speed up
is_pydantic_dataclass()by 41% inpydantic/dataclasses.pyby @misrasaurabh1 in #9652 - ⚡️ Speed up
to_snake()by 27% inpydantic/alias_generators.pyby @misrasaurabh1 in #9747 - ⚡️ Speed up
unwrap_wrapped_function()by 93% inpydantic/_internal/_decorators.pyby @misrasaurabh1 in #9727
Fixes
- Replace
__spec__.parentwith__package__by @hramezani in #9331 - Fix Outputted Model JSON Schema for
Sequencetype by @anesmemisevic in #9303 - Fix typing of
_frame_depthby @Viicos in #9353 - Make
ImportStringjson schema compatible by @amitschang in #9344 - Hide private attributes (
PrivateAttr) from__init__signature in type checkers by @idan22moral in #9293 - Make detection of
TypeVardefaults robust to the CPythonPEP-696implementation by @AlexWaygood in #9426 - Fix usage of
PlainSerializerwith builtin types by @Viicos in #9450 - Add more robust custom validation examples by @ChrisPappalardo in #9468
- Fix ignored
strictspecification forStringConstraint(strict=False)by @vbmendes in #9476 - Use
Selfwhere possible by @Viicos in #9479 - Do not alter
RootModel.model_constructsignature in themypyplugin by @Viicos in #9480 - Fixed type hint of
validation_contextby @OhioDschungel6 in #9508 - Support context being passed to TypeAdapter's
dump_json/dump_pythonby @alexcouper in #9495 - Updates type signature for
Field()constructor by @bjmc in #9484 - Improve builtin alias generators by @sydney-runkle in #9561
- Fix typing of
TypeAdapterby @Viicos in #9570 - Add fallback default value for private fields in
__setstate__of BaseModel by @anhpham1509 in #9584 - Support
PEP 746by @adriangb in #9587 - Allow validator and serializer functions to have default values by @Viicos in #9478
- Fix bug with mypy plugin's handling of covariant
TypeVarfields by @dmontagu in #9606 - Fix multiple annotation / constraint application logic by @sydney-runkle in #9623
- Respect
regexflags in validation and json schema by @sydney-runkle in #9591 - Fix type hint on
IpvAnyAddressby @sydney-runkle in #9640 - Allow a field specifier on
__pydantic_extra__by @dmontagu in #9659 - Use normalized case for file path comparison by @sydney-runkle in #9737
- Modify constraint application logic to allow field constraints on
Optional[Decimal]by @lazyhope in #9754 validate_calltype params fix by @sydney-runkle in #9760- Check all warnings returned by
pytest.warns()by @s-t-e-v-e-n-k in #9702 - Reuse
re.Patternobject in regex patterns to allow for regex flags by @sydney-runkle in pydantic/pydantic-core#1318
New Contributors
- @idan22moral made their first contribution in #9294
- @anesmemisevic made their first contribution in #9303
- @max-muoto made their first contribution in #9338
- @amitschang made their first contribution in #9344
- @paulmartin91 made their first contribution in #9410
- @OhioDschungel6 made their first contribution in #9405
- @AlexWaygood made their first contribution in #9426
- @kinuax made their first contribution in #9433
- @antoni-jamiolkowski made their first contribution in #9431
- @candleindark made their first contribution in #9448
- @nix010 made their first contribution in #9170
- @tomy0000000 made their first contribution in #9457
- @vbmendes made their first contribution in #9470
- @micheleAlberto made their first contribution in #9471
- @ChrisPappalardo made their first contribution in #9468
- @blueTurtz made their first contribution in #9475
- @WinterBlue16 made their first contribution in #9477
- @bittner made their first contribution in #9500
- @alexcouper made their first contribution in #9495
- @bjmc made their first contribution in #9484
- @pjvv made their first contribution in #9529
- @nedbat made their first contribution in #9530
- @gunnellEvan made their first contribution in #9469
- @jaymbans made their first contribution in #9531
- @MarcBresson made their first contribution in #9534
- @anhpham1509 made their first contribution in #9584
- @K-dash made their first contribution in #9595
- @s-t-e-v-e-n-k made their first contribution in #9527
- @airwoodix made their first contribution in #9506
- @misrasaurabh1 made their first contribution in #9653
- @AlessandroMiola made their first contribution in #9740
- @mylapallilavanyaa made their first contribution in #9746
- @lazyhope made their first contribution in #9754
- @YassinNouh21 made their first contribution in #9759
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.4...v2.8.0b1/
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v1.10.17 (2024-06-20)
What's Changed
- Advertise Python 3.12 for 1.10.x! Part Deux by @vfazio in https://github.com/pydantic/pydantic/pull/9644
- Mirrored modules in
v1namespace to fix typing and object resolution in python>3.11 by @exs-dwoodward in https://github.com/pydantic/pydantic/pull/9660 - setup: remove upper bound from python_requires by @vfazio in https://github.com/pydantic/pydantic/pull/9685
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.16...v1.10.17
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.7.4 (2024-06-12)
What's Changed
Packaging
- Bump
pydantic.v1tov1.10.16reference by @sydney-runkle in #9639
Fixes
- Specify
recursive_guardas kwarg inFutureRef._evaluateby @vfazio in #9612
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.3...v2.7.4
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v1.10.16 (2024-06-11)
What's Changed
- Import modules/objects directly from
v1namespace by @exs-dwoodward in https://github.com/pydantic/pydantic/pull/9162 - Fix mypy v1 plugin for upcoming mypy release by @cdce8p in https://github.com/pydantic/pydantic/pull/9586
- Specify
recursive_guardas kwarg inFutureRef._evaluateby @vfazio in https://github.com/pydantic/pydantic/pull/9612
New Contributors
- @exs-dwoodward made their first contribution in https://github.com/pydantic/pydantic/pull/9162
- @vfazio made their first contribution in https://github.com/pydantic/pydantic/pull/9612
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.15...v1.10.16
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.7.3 (2024-06-03)
What's Changed
Packaging
- Bump
pydantic-coretov2.18.4by @sydney-runkle in #9550
Fixes
- Fix u style unicode strings in python @samuelcolvin in pydantic/jiter#110
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.2...v2.7.3/*
- Python
Published by sydney-runkle almost 2 years ago
pydantic - v2.7.2 (2024-05-28)
What's Changed
Packaging
- Bump
pydantic-coretov2.18.3by @sydney-runkle in #9515
Fixes
- Replace
__spec__.parentwith__package__by @hramezani in #9331 - Fix validation of
ints with leading unary minus by @RajatRajdeep in pydantic/pydantic-core#1291 - Fix
strsubclass validation for enums by @sydney-runkle in [pydantic/pydantic-core#1273]https://github.com/pydantic/pydantic-core/pull/1273 - Support
BigInts inLiterals andEnums by @samuelcolvin in [pydantic/pydantic-core#1297]https://github.com/pydantic/pydantic-core/pull/1297 - Fix: uuid - allow
strsubclass as input by @davidhewitt in [pydantic/pydantic-core#1296]https://github.com/pydantic/pydantic-core/pull/1296
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.1...v2.7.2/
- Python
Published by sydney-runkle about 2 years ago
pydantic - v2.7.1 (2024-04-23)
What's Changed
Packaging
New Features
- Ftp and Websocket connection strings support by @CherrySuryp in #9205
Changes
- Use field description for RootModel schema description when there is
…by @LouisGobert in #9214
Fixes
- Fix
validation_aliasbehavior withmodel_constructforAliasChoicesandAliasPathby @sydney-runkle in #9223 - Revert
typing.Literaland import it outside the TYPE_CHECKING block by @frost-nzcr4 in #9232 - Fix
Secretserialization schema, applicable for unions by @sydney-runkle in #9240 - Fix
strictapplication tofunction-afterwithuse_enum_valuesby @sydney-runkle in #9279 - Address case where
model_constructon a class which definesmodel_post_initfails withAttributeErrorby @babygrimes in #9168 - Fix
model_json_schemawith config types by @NeevCohen in #9287 - Support multiple zeros as an
intby @samuelcolvin in pydantic/pydantic-core#1269 - Fix validation of
ints with leading unary plus by @cknv in pydantic/pydantic-core#1272 - Fix interaction between
extra != 'ignore'andfrom_attributes=Trueby @davidhewitt in pydantic/pydantic-core#1276 - Handle error from
Enum'smissingfunction asValidationErrorby @sydney-runkle in pydantic/pydantic-core#1274 - Fix memory leak with
Iterablevalidation by @davidhewitt in pydantic/pydantic-core#1271
New Contributors
- @zzstoatzz made their first contribution in #9219
- @frost-nzcr4 made their first contribution in #9232
- @CherrySuryp made their first contribution in #9205
- @vagenas made their first contribution in #9268
- @ollz272 made their first contribution in #9262
- @babygrimes made their first contribution in #9168
- @swelborn made their first contribution in #9296
- @kf-novi made their first contribution in #9236
- @lgeiger made their first contribution in #9288
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.7.0...v2.7.1/
- Python
Published by sydney-runkle about 2 years ago
pydantic - v2.7.0
v2.7.0 (2024-04-11)
The code released in v2.7.0 is practically identical to that of v2.7.0b1.
What's Changed
Packaging
- Reorganize
pyproject.tomlsections by @Viicos in #8899 - Bump
pydantic-coretov2.18.1by @sydney-runkle in #9211 - Adopt
jiterv0.2.0by @samuelcolvin in pydantic/pydantic-core#1250
New Features
- Extract attribute docstrings from
FieldInfo.descriptionby @Viicos in #6563 - Add a
with_configdecorator to comply with typing spec by @Viicos in #8611 - Allow an optional separator splitting the value and unit of the result of
ByteSize.human_readableby @jks15satoshi in #8706 - Add generic
Secretbase type by @conradogarciaberrotaran in #8519 - Make use of
Sphinxinventories for cross references in docs by @Viicos in #8682 - Add environment variable to disable plugins by @geospackle in #8767
- Add support for
deprecatedfields by @Viicos in #8237 - Allow
field_serializer('*')by @ornariece in #9001 - Handle a case when
model_configis defined as a model property by @alexeyt101 in #9004 - Update
create_model()to supporttyping.Annotatedas input by @wannieman98 in #8947 - Add
ClickhouseDsnsupport by @solidguy7 in #9062 - Add support for
re.Pattern[str]topatternfield by @jag-k in #9053 - Support for
serialize_as_anyruntime setting by @sydney-runkle in #8830 - Add support for
typing.Selfby @Youssefares in #9023 - Ability to pass
contextto serialization by @ornariece in #8965 - Add feedback widget to docs with flarelytics integration by @sydney-runkle in #9129
- Support for parsing partial JSON strings in Python by @samuelcolvin in pydantic/jiter#66
Finalized in v2.7.0, rather than v2.7.0b1:
* Add support for field level number to str coercion option by @NeevCohen in #9137
* Update warnings parameter for serialization utilities to allow raising a warning by @Lance-Drane in #9166
Changes
- Correct docs, logic for
model_constructbehavior withextraby @sydney-runkle in #8807 - Improve error message for improper
RootModelsubclasses by @sydney-runkle in #8857 - Use
PEP570syntax by @Viicos in #8940 - Add
enumandtypeto the JSON schema for single item literals by @dmontagu in #8944 - Deprecate
update_json_schemainternal function by @sydney-runkle in #9125 - Serialize duration to hour minute second, instead of just seconds by @kakilangit in pydantic/speedate#50
- Trimming str before parsing to int and float by @hungtsetse in pydantic/pydantic-core#1203
Performance
enumvalidator improvements by @samuelcolvin in #9045- Move
enumvalidation and serialization to Rust by @samuelcolvin in #9064 - Improve schema generation for nested dataclasses by @sydney-runkle in #9114
- Fast path for ASCII python string creation in JSON by @samuelcolvin in in pydantic/jiter#72
- SIMD integer and string JSON parsing on
aarch64(Note: SIMD on x86 will be implemented in a future release) by @samuelcolvin in in pydantic/jiter#65 - Support JSON
Cow<str>fromjiterby @davidhewitt in pydantic/pydantic-core#1231 - MAJOR performance improvement: update to PyO3 0.21 final by @davidhewitt in pydantic/pydantic-core#1248
- cache Python strings by @samuelcolvin in pydantic/pydantic-core#1240
Fixes
- Fix strict parsing for some
Sequences by @sydney-runkle in #8614 - Add a check on the existence of
__qualname__by @anci3ntr0ck in #8642 - Handle
__pydantic_extra__annotation being a string or inherited by @alexmojaki in #8659 - Fix json validation for
NameEmailby @Holi0317 in #8650 - Fix type-safety of attribute access in
BaseModelby @bluenote10 in #8651 - Fix bug with
mypyplugin andno_strict_optional = Trueby @dmontagu in #8666 - Fix
ByteSizeerrortypechange by @sydney-runkle in #8681 - Fix inheriting annotations in dataclasses by @sydney-runkle in #8679
- Fix regression in core schema generation for indirect definition references by @dmontagu in #8702
- Fix unsupported types bug with plain validator by @sydney-runkle in #8710
- Reverting problematic fix from 2.6 release, fixing schema building bug by @sydney-runkle in #8718
- fixes
__pydantic_config__ignored for TypeDict by @13sin in #8734 - Fix test failures with
pytest v8.0.0due topytest.warns()starting to work insidepytest.raises()by @mgorny in #8678 - Use
is_valid_fieldfrom 1.x formypyplugin by @DanielNoord in #8738 - Better-support
mypystrict equality flag by @dmontagu in #8799 - modeljsonschema export with Annotated types misses 'required' parameters by @LouisGobert in #8793
- Fix default inclusion in
FieldInfo.__repr_args__by @sydney-runkle in #8801 - Fix resolution of forward refs in dataclass base classes that are not present in the subclass module namespace by @matsjoyce-refeyn in #8751
- Fix
BaseModeltype annotations to be resolvable bytyping.get_type_hintsby @devmonkey22 in #7680 - Fix: allow empty string aliases with
AliasGeneratorby @sydney-runkle in #8810 - Fix test along with
date->datetimetimezone assumption fix by @sydney-runkle in #8823 - Fix deprecation warning with usage of
ast.Strby @Viicos in #8837 - Add missing
deprecateddecorators by @Viicos in #8877 - Fix serialization of
NameEmailif name includes an email address by @NeevCohen in #8860 - Add information about class in error message of schema generation by @Czaki in #8917
- Make
TypeAdapter's typing compatible with special forms by @adriangb in #8923 - Fix issue with config behavior being baked into the ref schema for
enums by @dmontagu in #8920 - More helpful error re wrong
model_json_schemausage by @sydney-runkle in #8928 - Fix nested discriminated union schema gen, pt 2 by @sydney-runkle in #8932
- Fix schema build for nested dataclasses / TypedDicts with discriminators by @sydney-runkle in #8950
- Remove unnecessary logic for definitions schema gen with discriminated unions by @sydney-runkle in #8951
- Fix handling of optionals in
mypyplugin by @dmontagu in #9008 - Fix
PlainSerializerusage with std type constructor by @sydney-runkle in #9031 - Remove unnecessary warning for config in plugin by @dmontagu in #9039
- Fix default value serializing by @NeevCohen in #9066
- Fix extra fields check in
Model.__getattr__()by @NeevCohen in #9082 - Fix
ClassVarforward ref inherited from parent class by @alexmojaki in #9097 - fix sequence like validator with strict
Trueby @andresliszt in #8977 - Improve warning message when a field name shadows a field in a parent model by @chan-vince in #9105
- Do not warn about shadowed fields if they are not redefined in a child class by @chan-vince in #9111
- Fix discriminated union bug with unsubstituted type var by @sydney-runkle in #9124
- Support serialization of
dequewhen passed toSequence[blah blah blah]by @sydney-runkle in #9128 - Init private attributes from super-types in
model_post_initby @Viicos in #9134 - fix
model_constructwithvalidation_aliasby @ornariece in #9144 - Ensure json-schema generator handles
Literalnulltypes by @bruno-f-cruz in #9135 - Fixed in v2.7.0: Fix allow extra generic by @dmontagu in #9193
New Contributors
- @hungtsetse made their first contribution in #8546
- @StrawHatDrag0n made their first contribution in #8583
- @anci3ntr0ck made their first contribution in #8642
- @Holi0317 made their first contribution in #8650
- @bluenote10 made their first contribution in #8651
- @ADSteele916 made their first contribution in #8703
- @musicinmybrain made their first contribution in #8731
- @jks15satoshi made their first contribution in #8706
- @13sin made their first contribution in #8734
- @DanielNoord made their first contribution in #8738
- @conradogarciaberrotaran made their first contribution in #8519
- @chris-griffin made their first contribution in #8775
- @LouisGobert made their first contribution in #8793
- @matsjoyce-refeyn made their first contribution in #8751
- @devmonkey22 made their first contribution in #7680
- @adamency made their first contribution in #8847
- @MamfTheKramf made their first contribution in #8851
- @ornariece made their first contribution in #9001
- @alexeyt101 made their first contribution in #9004
- @wannieman98 made their first contribution in #8947
- @solidguy7 made their first contribution in #9062
- @kloczek made their first contribution in #9047
- @jag-k made their first contribution in #9053
- @priya-gitTest made their first contribution in #9088
- @Youssefares made their first contribution in #9023
- @chan-vince made their first contribution in #9105
- @bruno-f-cruz made their first contribution in #9135
- @Lance-Drane made their first contribution in #9166
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.4...v2.7.0/
- Python
Published by sydney-runkle about 2 years ago
pydantic - v2.7.0b1
v2.7.0b1 (2024-04-03)
What's Changed
Packaging
- Reorganize
pyproject.tomlsections by @Viicos in #8899 - Bump
pydantic-coretov2.18.0by @sydney-runkle in #9153 - Adopt
jiterv0.2.0by @samuelcolvin in pydantic/pydantic-core#1250
New Features
- Extract attribute docstrings from
FieldInfo.descriptionby @Viicos in #6563 - Add a
with_configdecorator to comply with typing spec by @Viicos in #8611 - Allow an optional separator splitting the value and unit of the result of
ByteSize.human_readableby @jks15satoshi in #8706 - Add generic
Secretbase type by @conradogarciaberrotaran in #8519 - Make use of
Sphinxinventories for cross references in docs by @Viicos in #8682 - Add environment variable to disable plugins by @geospackle in #8767
- Add support for
deprecatedfields by @Viicos in #8237 - Allow
field_serializer('*')by @ornariece in #9001 - Handle a case when
model_configis defined as a model property by @alexeyt101 in #9004 - Update
create_model()to supporttyping.Annotatedas input by @wannieman98 in #8947 - Add
ClickhouseDsnsupport by @solidguy7 in #9062 - Add support for
re.Pattern[str]topatternfield by @jag-k in #9053 - Support for
serialize_as_anyruntime setting by @sydney-runkle in #8830 - Add support for
typing.Selfby @Youssefares in #9023 - Ability to pass
contextto serialization by @ornariece in #8965 - Add feedback widget to docs with flarelytics integration by @sydney-runkle in #9129
- Support for parsing partial JSON strings in Python by @samuelcolvin in pydantic/jiter#66
Changes
- Correct docs, logic for
model_constructbehavior withextraby @sydney-runkle in #8807 - Improve error message for improper
RootModelsubclasses by @sydney-runkle in #8857 - Use
PEP570syntax by @Viicos in #8940 - Add
enumandtypeto the JSON schema for single item literals by @dmontagu in #8944 - Deprecate
update_json_schemainternal function by @sydney-runkle in #9125 - Serialize duration to hour minute second, instead of just seconds by @kakilangit in pydantic/speedate#50
- Trimming str before parsing to int and float by @hungtsetse in pydantic/pydantic-core#1203
Performance
enumvalidator improvements by @samuelcolvin in #9045- Move
enumvalidation and serialization to Rust by @samuelcolvin in #9064 - Improve schema generation for nested dataclasses by @sydney-runkle in #9114
- Fast path for ASCII python string creation in JSON by @samuelcolvin in in pydantic/jiter#72
- SIMD integer and string JSON parsing on
aarch64(Note: SIMD on x86 will be implemented in a future release) by @samuelcolvin in in pydantic/jiter#65 - Support JSON
Cow<str>fromjiterby @davidhewitt in pydantic/pydantic-core#1231 - MAJOR performance improvement: update to PyO3 0.21 final by @davidhewitt in pydantic/pydantic-core#1248
- cache Python strings by @samuelcolvin in pydantic/pydantic-core#1240
Fixes
- Fix strict parsing for some
Sequences by @sydney-runkle in #8614 - Add a check on the existence of
__qualname__by @anci3ntr0ck in #8642 - Handle
__pydantic_extra__annotation being a string or inherited by @alexmojaki in #8659 - Fix json validation for
NameEmailby @Holi0317 in #8650 - Fix type-safety of attribute access in
BaseModelby @bluenote10 in #8651 - Fix bug with
mypyplugin andno_strict_optional = Trueby @dmontagu in #8666 - Fix
ByteSizeerrortypechange by @sydney-runkle in #8681 - Fix inheriting annotations in dataclasses by @sydney-runkle in #8679
- Fix regression in core schema generation for indirect definition references by @dmontagu in #8702
- Fix unsupported types bug with plain validator by @sydney-runkle in #8710
- Reverting problematic fix from 2.6 release, fixing schema building bug by @sydney-runkle in #8718
- fixes
__pydantic_config__ignored for TypeDict by @13sin in #8734 - Fix test failures with
pytest v8.0.0due topytest.warns()starting to work insidepytest.raises()by @mgorny in #8678 - Use
is_valid_fieldfrom 1.x formypyplugin by @DanielNoord in #8738 - Better-support
mypystrict equality flag by @dmontagu in #8799 - modeljsonschema export with Annotated types misses 'required' parameters by @LouisGobert in #8793
- Fix default inclusion in
FieldInfo.__repr_args__by @sydney-runkle in #8801 - Fix resolution of forward refs in dataclass base classes that are not present in the subclass module namespace by @matsjoyce-refeyn in #8751
- Fix
BaseModeltype annotations to be resolvable bytyping.get_type_hintsby @devmonkey22 in #7680 - Fix: allow empty string aliases with
AliasGeneratorby @sydney-runkle in #8810 - Fix test along with
date->datetimetimezone assumption fix by @sydney-runkle in #8823 - Fix deprecation warning with usage of
ast.Strby @Viicos in #8837 - Add missing
deprecateddecorators by @Viicos in #8877 - Fix serialization of
NameEmailif name includes an email address by @NeevCohen in #8860 - Add information about class in error message of schema generation by @Czaki in #8917
- Make
TypeAdapter's typing compatible with special forms by @adriangb in #8923 - Fix issue with config behavior being baked into the ref schema for
enums by @dmontagu in #8920 - More helpful error re wrong
model_json_schemausage by @sydney-runkle in #8928 - Fix nested discriminated union schema gen, pt 2 by @sydney-runkle in #8932
- Fix schema build for nested dataclasses / TypedDicts with discriminators by @sydney-runkle in #8950
- Remove unnecessary logic for definitions schema gen with discriminated unions by @sydney-runkle in #8951
- Fix handling of optionals in
mypyplugin by @dmontagu in #9008 - Fix
PlainSerializerusage with std type constructor by @sydney-runkle in #9031 - Remove unnecessary warning for config in plugin by @dmontagu in #9039
- Fix default value serializing by @NeevCohen in #9066
- Fix extra fields check in
Model.__getattr__()by @NeevCohen in #9082 - Fix
ClassVarforward ref inherited from parent class by @alexmojaki in #9097 - fix sequence like validator with strict
Trueby @andresliszt in #8977 - Improve warning message when a field name shadows a field in a parent model by @chan-vince in #9105
- Do not warn about shadowed fields if they are not redefined in a child class by @chan-vince in #9111
- Fix discriminated union bug with unsubstituted type var by @sydney-runkle in #9124
- Support serialization of
dequewhen passed toSequence[blah blah blah]by @sydney-runkle in #9128 - Init private attributes from super-types in
model_post_initby @Viicos in #9134 - fix
model_constructwithvalidation_aliasby @ornariece in #9144 - Ensure json-schema generator handles
Literalnulltypes by @bruno-f-cruz in #9135
New Contributors
- @hungtsetse made their first contribution in #8546
- @StrawHatDrag0n made their first contribution in #8583
- @anci3ntr0ck made their first contribution in #8642
- @Holi0317 made their first contribution in #8650
- @bluenote10 made their first contribution in #8651
- @ADSteele916 made their first contribution in #8703
- @musicinmybrain made their first contribution in #8731
- @jks15satoshi made their first contribution in #8706
- @13sin made their first contribution in #8734
- @DanielNoord made their first contribution in #8738
- @conradogarciaberrotaran made their first contribution in #8519
- @chris-griffin made their first contribution in #8775
- @LouisGobert made their first contribution in #8793
- @matsjoyce-refeyn made their first contribution in #8751
- @devmonkey22 made their first contribution in #7680
- @adamency made their first contribution in #8847
- @MamfTheKramf made their first contribution in #8851
- @ornariece made their first contribution in #9001
- @alexeyt101 made their first contribution in #9004
- @wannieman98 made their first contribution in #8947
- @solidguy7 made their first contribution in #9062
- @kloczek made their first contribution in #9047
- @jag-k made their first contribution in #9053
- @priya-gitTest made their first contribution in #9088
- @Youssefares made their first contribution in #9023
- @chan-vince made their first contribution in #9105
- @bruno-f-cruz made their first contribution in #9135
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.4...v2.7.0b1/
- Python
Published by sydney-runkle about 2 years ago
pydantic - v1.10.15
What's Changed
- Add pydantic.v1 namespace to Pydantic v1 by @exs-dmiketa in https://github.com/pydantic/pydantic/pull/9042
- Relax version of typing-extensions for V1 by @SonOfLilit in https://github.com/pydantic/pydantic/pull/8819
- patch fix for mypy by @sydney-runkle in https://github.com/pydantic/pydantic/pull/8765
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.14...v1.10.15
- Python
Published by sydney-runkle about 2 years ago
pydantic - v2.6.4 (2024-03-12)
What's Changed
Fixes
- Fix usage of
AliasGeneratorwithcomputed_fielddecorator by @sydney-runkle in #8806 - Fix nested discriminated union schema gen, pt 2 by @sydney-runkle in #8932
- Fix bug with nostrictoptional=True caused by API deferral by @dmontagu in #8826
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.3...v2.6.4/
- Python
Published by sydney-runkle about 2 years ago
pydantic - v2.6.3 2024-02-27
What's Changed
Packaging
- Update
pydantic-settingsversion in the docs by @hramezani in #8906
Fixes
- Fix discriminated union schema gen bug by @sydney-runkle in #8904
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.2...v2.6.3/
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.6.2 2024-02-23
What's Changed
Packaging
- Upgrade to
pydantic-core2.16.3 by @sydney-runkle in #8879
Fixes
- 'YYYY-MM-DD' date string coerced to datetime shouldn't infer timezone by @sydney-runkle in pydantic/pydantic-core#1193
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.1...v2.6.2/
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.6.1 2024-02-05
v2.6.1 (2024-02-05)
What's Changed
Packaging
- Upgrade to
pydantic-core2.16.2 by @sydney-runkle in #8717
Fixes
- Fix bug with
mypyplugin andno_strict_optional = Trueby @dmontagu in #8666 - Fix
ByteSizeerrortypechange by @sydney-runkle in #8681 - Fix inheriting
Fieldannotations in dataclasses by @sydney-runkle in #8679 - Fix regression in core schema generation for indirect definition references by @dmontagu in #8702
- Fix unsupported types bug with
PlainValidatorby @sydney-runkle in #8710 - Reverting problematic fix from 2.6 release, fixing schema building bug by @sydney-runkle in #8718
- Fix warning for tuple of wrong size in
Unionby @davidhewitt in pydantic/pydantic-core#1174 - Fix
computed_fieldJSON serializerexclude_nonebehavior by @sydney-runkle in pydantic/pydantic-core#1187
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.6.0...v2.6.1/
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.6.0 2024-01-29
v2.6.0 (2024-01-29)
The code released in v2.6.0 is practically identical to that of v2.6.0b1.
What's Changed
Packaging
- Check for
email-validatorversion >= 2.0 by @commonism in #6033 - Upgrade
ruff` target version to Python 3.8 by @Elkiwa in #8341 - Update to
pydantic-extra-types==2.4.1by @yezz123 in #8478 - Update to
pyright==1.1.345by @Viicos in #8453 - Update pydantic-core from 2.14.6 to 2.16.1, significant changes from these updates are described below, full changelog here
New Features
- Add
NatsDsnby @ekeew in #6874 - Add
ConfigDict.ser_json_inf_nanby @davidhewitt in #8159 - Add
types.OnErrorOmitby @adriangb in #8222 - Support
AliasGeneratorusage by @sydney-runkle in #8282 - Add Pydantic People Page to docs by @sydney-runkle in #8345
- Support
yyyy-MM-DDdatetime parsing by @sydney-runkle in #8404 - Added bits conversions to the
ByteSizeclass #8415 by @luca-matei in #8507 - Enable json schema creation with type
ByteSizeby @geospackle in #8537 - Add
eval_type_backportto handle union operator and builtin generic subscripting in older Pythons by @alexmojaki in #8209 - Add support for
dataclassfieldsinitby @dmontagu in #8552 - Implement pickling for
ValidationErrorby @davidhewitt in pydantic/pydantic-core#1119 - Add unified tuple validator that can handle "variadic" tuples via PEP-646 by @dmontagu in pydantic/pydantic-core#865
Changes
- Drop Python3.7 support by @hramezani in #7188
- Drop Python 3.7, and PyPy 3.7 and 3.8 by @davidhewitt in pydantic/pydantic-core#1129
- Use positional-only
selfinBaseModelconstructor, so no field name can ever conflict with it by @ariebovenberg in #8072 - Make
@validate_callreturn a function instead of a custom descriptor - fixes binding issue with inheritance and addsself/clsargument to validation errors by @alexmojaki in #8268 - Exclude
BaseModeldocstring from JSON schema description by @sydney-runkle in #8352 - Introducing
classpropertydecorator formodel_computed_fieldsby @Jocelyn-Gas in #8437 - Explicitly raise an error if field names clashes with types by @Viicos in #8243
- Use stricter serializer for unions of simple types by @alexdrydew pydantic/pydantic-core#1132
Performance
- Add Codspeed profiling Actions workflow by @lambertsbennett in #8054
- Improve
intextraction by @samuelcolvin in pydantic/pydantic-core#1155 - Improve performance of recursion guard by @samuelcolvin in pydantic/pydantic-core#1156
dataclassserialization speedups by @samuelcolvin in pydantic/pydantic-core#1162- Avoid
HashMapcreation when looking up small JSON objects inLazyIndexMapsby @samuelcolvin in pydantic/jiter#55 - use hashbrown to speedup python string caching by @davidhewitt in pydantic/jiter#51
- Replace
Peakwith more efficientPeekby @davidhewitt in pydantic/jiter#48
Fixes
- Move
getattrwarning in deprecatedBaseConfigby @tlambert03 in #7183 - Only hash
model_fields, not whole__dict__by @alexmojaki in #7786 - Fix mishandling of unions while freezing types in the
mypyplugin by @dmontagu in #7411 - Fix
mypyerror on untypedClassVarby @vincent-hachin-wmx in #8138 - Only compare pydantic fields in
BaseModel.__eq__instead of whole__dict__by @QuentinSoubeyranAqemia in #7825 - Update
strictdocstring inmodel_validatemethod. by @LukeTonin in #8223 - Fix overload position of
computed_fieldby @Viicos in #8227 - Fix custom type type casting used in multiple attributes by @ianhfc in #8066
- Fix issue not allowing
validate_calldecorator to be dynamically assigned to a class method by @jusexton in #8249 - Fix issue
unittest.mockdeprecation warnings by @ibleedicare in #8262 - Added tests for the case
JsonValuecontains subclassed primitive values by @jusexton in #8286 - Fix
mypyerror on free before validator (classmethod) by @sydney-runkle in #8285 - Fix
to_snakeconversion by @jevins09 in #8316 - Fix type annotation of
ModelMetaclass.__prepare__by @slanzmich in #8305 - Disallow
configspecification when initializing aTypeAdapterwhen the annotated type has config already by @sydney-runkle in #8365 - Fix a naming issue with JSON schema for generics parametrized by recursive type aliases by @dmontagu in #8389
- Fix type annotation in pydantic people script by @shenxiangzhuang in #8402
- Add support for field
aliasindataclasssignature by @NeevCohen in #8387 - Fix bug with schema generation with
Field(...)in a forward ref by @dmontagu in #8494 - Fix ordering of keys in
__dict__withmodel_constructcall by @sydney-runkle in #8500 - Fix module
path_typecreation when globals does not contain__name__by @hramezani in #8470 - Fix for namespace issue with dataclasses with
from __future__ import annotationsby @sydney-runkle in #8513 - Fix: make function validator types positional-only by @pmmmwh in #8479
- Fix usage of
@deprecatedby @Viicos in #8294 - Add more support for private attributes in
model_constructcall by @sydney-runkle in #8525 - Use a stack for the types namespace by @dmontagu in #8378
- Fix schema-building bug with
TypeAliasTypefor types with refs by @dmontagu in #8526 - Support
pydantic.Field(repr=False)in dataclasses by @tigeryy2 in #8511 - Override
dataclass_transformbehavior forRootModelby @Viicos in #8163 - Refactor signature generation for simplicity by @sydney-runkle in #8572
- Fix ordering bug of PlainValidator annotation by @Anvil in #8567
- Fix
exclude_nonefor json serialization ofcomputed_fields by @sydney-runkle in pydantic/pydantic-core#1098 - Support yyyy-MM-DD string for datetimes by @sydney-runkle in pydantic/pydantic-core#1124
- Tweak ordering of definitions in generated schemas by @StrawHatDrag0n in #8583
New Contributors
pydantic
- @ekeew made their first contribution in #6874
- @lambertsbennett made their first contribution in #8054
- @vincent-hachin-wmx made their first contribution in #8138
- @QuentinSoubeyranAqemia made their first contribution in #7825
- @ariebovenberg made their first contribution in #8072
- @LukeTonin made their first contribution in #8223
- @denisart made their first contribution in #8231
- @ianhfc made their first contribution in #8066
- @eonu made their first contribution in #8255
- @amandahla made their first contribution in #8263
- @ibleedicare made their first contribution in #8262
- @jevins09 made their first contribution in #8316
- @cuu508 made their first contribution in #8322
- @slanzmich made their first contribution in #8305
- @jensenbox made their first contribution in #8331
- @szepeviktor made their first contribution in #8356
- @Elkiwa made their first contribution in #8341
- @parhamfh made their first contribution in #8395
- @shenxiangzhuang made their first contribution in #8402
- @NeevCohen made their first contribution in #8387
- @zby made their first contribution in #8497
- @patelnets made their first contribution in #8491
- @edwardwli made their first contribution in #8503
- @luca-matei made their first contribution in #8507
- @Jocelyn-Gas made their first contribution in #8437
- @bL34cHig0 made their first contribution in #8501
- @tigeryy2 made their first contribution in #8511
- @geospackle made their first contribution in #8537
- @Anvil made their first contribution in #8567
- @hungtsetse made their first contribution in #8546
- @StrawHatDrag0n made their first contribution in #8583
pydantic-core
- @mariuswinger made their first contribution in pydantic/pydantic-core#1087
- @adamchainz made their first contribution in pydantic/pydantic-core#1090
- @akx made their first contribution in pydantic/pydantic-core#1123
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.6.0b1 2024-01-19
What's Changed
Packaging
- Check for
email-validatorversion >= 2.0 by @commonism in #6033 - Upgrade
ruff` target version to Python 3.8 by @Elkiwa in #8341 - Update to
pydantic-extra-types==2.4.1by @yezz123 in #8478 - Update to
pyright==1.1.345by @Viicos in #8453 - Update pydantic-core from 2.14.6 to 2.16.1, significant changes from these updates are described below, full changelog here
New Features
- Add
NatsDsnby @ekeew in #6874 - Add
ConfigDict.ser_json_inf_nanby @davidhewitt in #8159 - Add
types.OnErrorOmitby @adriangb in #8222 - Support
AliasGeneratorusage by @sydney-runkle in #8282 - Add Pydantic People Page to docs by @sydney-runkle in #8345
- Support
yyyy-MM-DDdatetime parsing by @sydney-runkle in #8404 - Added bits conversions to the
ByteSizeclass #8415 by @luca-matei in #8507 - Enable json schema creation with type
ByteSizeby @geospackle in #8537 - Add
eval_type_backportto handle union operator and builtin generic subscripting in older Pythons by @alexmojaki in #8209 - Add support for
dataclassfieldsinitby @dmontagu in #8552 - Implement pickling for
ValidationErrorby @davidhewitt in pydantic/pydantic-core#1119 - Add unified tuple validator that can handle "variadic" tuples via PEP-646 by @dmontagu in pydantic/pydantic-core#865
Changes
- Drop Python3.7 support by @hramezani in #7188
- Drop Python 3.7, and PyPy 3.7 and 3.8 by @davidhewitt in pydantic/pydantic-core#1129
- Use positional-only
selfinBaseModelconstructor, so no field name can ever conflict with it by @ariebovenberg in #8072 - Make
@validate_callreturn a function instead of a custom descriptor - fixes binding issue with inheritance and addsself/clsargument to validation errors by @alexmojaki in #8268 - Exclude
BaseModeldocstring from JSON schema description by @sydney-runkle in #8352 - Introducing
classpropertydecorator formodel_computed_fieldsby @Jocelyn-Gas in #8437 - Explicitly raise an error if field names clashes with types by @Viicos in #8243
- Use stricter serializer for unions of simple types by @alexdrydew pydantic/pydantic-core#1132
Performance
- Add Codspeed profiling Actions workflow by @lambertsbennett in #8054
- Improve
intextraction by @samuelcolvin in pydantic/pydantic-core#1155 - Improve performance of recursion guard by @samuelcolvin in pydantic/pydantic-core#1156
dataclassserialization speedups by @samuelcolvin in pydantic/pydantic-core#1162- Avoid
HashMapcreation when looking up small JSON objects inLazyIndexMapsby @samuelcolvin in pydantic/jiter#55 - use hashbrown to speedup python string caching by @davidhewitt in pydantic/jiter#51
- Replace
Peakwith more efficientPeekby @davidhewitt in pydantic/jiter#48
Fixes
- Move
getattrwarning in deprecatedBaseConfigby @tlambert03 in #7183 - Only hash
model_fields, not whole__dict__by @alexmojaki in #7786 - Fix mishandling of unions while freezing types in the
mypyplugin by @dmontagu in #7411 - Fix
mypyerror on untypedClassVarby @vincent-hachin-wmx in #8138 - Only compare pydantic fields in
BaseModel.__eq__instead of whole__dict__by @QuentinSoubeyranAqemia in #7825 - Update
strictdocstring inmodel_validatemethod. by @LukeTonin in #8223 - Fix overload position of
computed_fieldby @Viicos in #8227 - Fix custom type type casting used in multiple attributes by @ianhfc in #8066
- Fix issue not allowing
validate_calldecorator to be dynamically assigned to a class method by @jusexton in #8249 - Fix issue
unittest.mockdeprecation warnings by @ibleedicare in #8262 - Added tests for the case
JsonValuecontains subclassed primitive values by @jusexton in #8286 - Fix
mypyerror on free before validator (classmethod) by @sydney-runkle in #8285 - Fix
to_snakeconversion by @jevins09 in #8316 - Fix type annotation of
ModelMetaclass.__prepare__by @slanzmich in #8305 - Disallow
configspecification when initializing aTypeAdapterwhen the annotated type has config already by @sydney-runkle in #8365 - Fix a naming issue with JSON schema for generics parametrized by recursive type aliases by @dmontagu in #8389
- Fix type annotation in pydantic people script by @shenxiangzhuang in #8402
- Add support for field
aliasindataclasssignature by @NeevCohen in #8387 - Fix bug with schema generation with
Field(...)in a forward ref by @dmontagu in #8494 - Fix ordering of keys in
__dict__withmodel_constructcall by @sydney-runkle in #8500 - Fix module
path_typecreation when globals does not contain__name__by @hramezani in #8470 - Fix for namespace issue with dataclasses with
from __future__ import annotationsby @sydney-runkle in #8513 - Fix: make function validator types positional-only by @pmmmwh in #8479
- Fix usage of
@deprecatedby @Viicos in #8294 - Add more support for private attributes in
model_constructcall by @sydney-runkle in #8525 - Use a stack for the types namespace by @dmontagu in #8378
- Fix schema-building bug with
TypeAliasTypefor types with refs by @dmontagu in #8526 - Support
pydantic.Field(repr=False)in dataclasses by @tigeryy2 in #8511 - Override
dataclass_transformbehavior forRootModelby @Viicos in #8163 - Refactor signature generation for simplicity by @sydney-runkle in #8572
- Fix ordering bug of PlainValidator annotation by @Anvil in #8567
- Fix
exclude_nonefor json serialization ofcomputed_fields by @sydney-runkle in pydantic/pydantic-core#1098 - Support yyyy-MM-DD string for datetimes by @sydney-runkle in pydantic/pydantic-core#1124
New Contributors
pydantic
- @ekeew made their first contribution in #6874
- @lambertsbennett made their first contribution in #8054
- @vincent-hachin-wmx made their first contribution in #8138
- @QuentinSoubeyranAqemia made their first contribution in #7825
- @ariebovenberg made their first contribution in #8072
- @LukeTonin made their first contribution in #8223
- @denisart made their first contribution in #8231
- @ianhfc made their first contribution in #8066
- @eonu made their first contribution in #8255
- @amandahla made their first contribution in #8263
- @ibleedicare made their first contribution in #8262
- @jevins09 made their first contribution in #8316
- @cuu508 made their first contribution in #8322
- @slanzmich made their first contribution in #8305
- @jensenbox made their first contribution in #8331
- @szepeviktor made their first contribution in #8356
- @Elkiwa made their first contribution in #8341
- @parhamfh made their first contribution in #8395
- @shenxiangzhuang made their first contribution in #8402
- @NeevCohen made their first contribution in #8387
- @zby made their first contribution in #8497
- @patelnets made their first contribution in #8491
- @edwardwli made their first contribution in #8503
- @luca-matei made their first contribution in #8507
- @Jocelyn-Gas made their first contribution in #8437
- @bL34cHig0 made their first contribution in #8501
- @tigeryy2 made their first contribution in #8511
- @geospackle made their first contribution in #8537
- @Anvil made their first contribution in #8567
pydantic-core
- @mariuswinger made their first contribution in pydantic/pydantic-core#1087
- @adamchainz made their first contribution in pydantic/pydantic-core#1090
- @akx made their first contribution in pydantic/pydantic-core#1123
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.5.3...v2.6.0b1
- Python
Published by sydney-runkle over 2 years ago
pydantic - v1.10.14 2024-01-19
What's Changed
- Update install.md by @dmontagu in https://github.com/pydantic/pydantic/pull/7690
- Fix ci to only deploy docs on release by @sydney-runkle in https://github.com/pydantic/pydantic/pull/7740
- Ubuntu fixes for V1 by @sydney-runkle in https://github.com/pydantic/pydantic/pull/8540 and https://github.com/pydantic/pydantic/pull/8587
- Fix
cached_propertyhandling in dataclasses when copied by @rdbisme in https://github.com/pydantic/pydantic/pull/8407
New Contributors
- @rdbisme made their first contribution in https://github.com/pydantic/pydantic/pull/8407
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.13...v1.10.14
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.5.3 2023-12-22
v2.5.3 (2023-12-22)
What's Changed
Packaging
- uprev
pydantic-coreto 2.14.6
Fixes
- Fix memory leak with recursive definitions creating reference cycles by @davidhewitt in pydantic/pydantic-core#1125
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.5.2...v2.5.3/
- Python
Published by hramezani over 2 years ago
pydantic - v2.5.2 2023-11-22
v2.5.2 (2023-11-22)
What's Changed
Packaging
- uprev
pydantic-coreto 2.14.5
New Features
- Add
ConfigDict.ser_json_inf_nanby @davidhewitt in #8159
Fixes
- Fix validation of
Literalfrom JSON keys when used asdictkey by @sydney-runkle in pydantic/pydantic-core#1075 - Fix bug re
custom_initon members ofUnionby @sydney-runkle in pydantic/pydantic-core#1076 - Fix
JsonValueboolserialization by @sydney-runkle in #8190 - Fix handling of unhashable inputs with
LiteralinUnions by @sydney-runkle in pydantic/pydantic-core#1089
https://github.com/pydantic/pydantic/compare/v2.5.1...v2.5.2/
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.5.1 2023-11-15
v2.5.1 (2023-11-15)
What's Changed
Packaging
- uprev pydantic-core to 2.14.3 by @samuelcolvin in #8120
Fixes
- Fix package description limit by @dmontagu in #8097
- Fix
ValidateCallWrappererror when creating a model which has a @validate_call wrapped field annotation by @sydney-runkle in #8110
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.5.0...v2.5.1/
- Python
Published by hramezani over 2 years ago
pydantic - 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.335by @Viicos in #8075
New Features
- Allow plugins to catch non
ValidationErrorerrors by @adriangb in #7806 - Support
__doc__argument increate_model()by @chris-spann in #7863 - Expose
regex_engineflag - 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
ComputedFieldInfoby @alexmojaki in #7889 - Adopting
ruffformatter by @Luca-Blight in #7930 - Added
validation_error_causeto config by @zakstucke in #7626 - Make path of the item to validate available in plugin by @hramezani in #7861
- Add
CallableDiscriminatorandTagby @dmontagu in #7983CallableDiscriminatorrenamed toDiscriminatorby @dmontagu in #8047
- Make union case tags affect union error messages by @dmontagu in #8001
- Add
examplesandjson_schema_extrato@computed_fieldby @alexmojaki in #8013 - Add
JsonValuetype by @dmontagu in #7998 - Allow
stras argument toDiscriminatorby @dmontagu in #8047 - Add
SchemaSerializer.__reduce__method to enable pickle serialization by @edoakes in pydantic/pydantic-core#1006
Changes
- Significant Change: replace
ultra_strictwith 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
Enumtypes with no cases by @sydney-runkle in #7927 - Warn if a class inherits from
GenericbeforeBaseModelby @alexmojaki in #7891
Performance
- New custom JSON parser,
jiterby @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 #7947
Fixes
- Fix
mypyissue with subclasses ofRootModelby @sydney-runkle in #7677 - Properly rebuild the
FieldInfowhen a forward ref gets evaluated by @dmontagu in #7698 - Fix failure to load
SecretStrfrom JSON (regression in v2.4) by @sydney-runkle in #7729 - Fix
defer_buildbehavior withTypeAdapterby @sydney-runkle in #7736 - Improve compatibility with legacy
mypyversions by @dmontagu in #7742 - Fix: update
TypeVarhandling when default is not set by @pmmmwh in #7719 - Support specification of
strictonEnumtype fields by @sydney-runkle in #7761 - Wrap
weakref.refinstead of subclassing to fixcloudpickleserialization by @edoakes in #7780 - Keep values of private attributes set within
model_post_initin subclasses by @alexmojaki in #7775 - Add more specific type for non-callable
json_schema_extraby @alexmojaki in #7803 - Raise an error when deleting frozen (model) fields by @alexmojaki in #7800
- Fix schema sorting bug with default values by @sydney-runkle in #7817
- Use generated alias for aliases that are not specified otherwise by @alexmojaki in #7802
- Support
strictspecification forUUIDtypes by @sydney-runkle in #7865 - JSON schema: fix extra parameter handling by @me-and in #7810
- Fix: support
pydantic.Field(kw_only=True)with inherited dataclasses by @PrettyWood in #7827 - Support
validate_calldecorator for methods in classes with__slots__by @sydney-runkle in #7883 - Fix pydantic dataclass problem with
dataclasses.fielddefault by @hramezani in #7898 - Fix schema generation for generics with union type bounds by @sydney-runkle in #7899
- Fix version for
importlib_metadataon python 3.7 by @sydney-runkle in #7904 - Support
|operator (Union) in PydanticRecursiveRef by @alexmojaki in #7892 - Fix
display_as_typeforTypeAliasTypein python 3.12 by @dmontagu in #7929 - Add support for
NotRequiredgenerics inTypedDictby @sydney-runkle in #7932 - Make generic
TypeAliasTypespecifications produce different schema definitions by @alexdrydew in #7893 - Added fix for signature of inherited dataclass by @howsunjow in #7925
- Make the model name generation more robust in JSON schema by @joakimnordling in #7881
- Fix plurals in validation error messages (in tests) by @Iipin in #7972
PrivateAttris passed fromAnnotateddefault position by @tabassco in #8004- Don't decode bytes (which may not be UTF8) when displaying SecretBytes by @alexmojaki in #8012
- Use
classmethodinstead ofclassmethod[Any, Any, Any]by @Mr-Pepe in #7979 - Clearer error on invalid Plugin by @samuelcolvin in #8023
- Correct pydantic dataclasses import by @samuelcolvin in #8027
- Fix misbehavior for models referencing redefined type aliases by @dmontagu in #8050
- Fix
Optionalfield withvalidate_defaultonly performing one field validation by @sydney-runkle in pydantic/pydantic-core#1002 - Fix
definition-refbug withDictkeys by @sydney-runkle in pydantic/pydantic-core#1014 - Fix bug allowing validation of
booltypes withcoerce_numbers_to_str=Trueby @sydney-runkle in pydantic/pydantic-core#1017 - Don't accept
NaNin float and decimal constraints by @davidhewitt in pydantic/pydantic-core#1037 - Add
lax_strandlax_intsupport for enum values not inherited from str/int by @michaelhly in pydantic/pydantic-core#1015 - Support subclasses in lists in
UnionofListtypes by @sydney-runkle in pydantic/pydantic-core#1039 - Allow validation against
max_digitsanddecimalsto pass if normalized or non-normalized input is valid by @sydney-runkle in pydantic/pydantic-core#1049 - Fix: proper pluralization in
ValidationErrormessages by @Iipin in pydantic/pydantic-core#1050 - Disallow the string
'-'asdatetimeinput by @davidhewitt in pydantic/speedate#52 & pydantic/pydantic-core#1060 - Fix: NaN and Inf float serialization by @davidhewitt in pydantic/pydantic-core#1062
- Restore manylinux-compatible PGO builds by @davidhewitt in pydantic/pydantic-core#1068
New Contributors
pydantic
- @schneebuzz made their first contribution in #7699
- @edoakes made their first contribution in #7780
- @alexmojaki made their first contribution in #7775
- @NickG123 made their first contribution in #7751
- @gowthamgts made their first contribution in #7830
- @jamesbraza made their first contribution in #7848
- @laundmo made their first contribution in #7850
- @rahmatnazali made their first contribution in #7870
- @waterfountain1996 made their first contribution in #7878
- @chris-spann made their first contribution in #7863
- @me-and made their first contribution in #7810
- @utkini made their first contribution in #7768
- @bn-l made their first contribution in #7744
- @alexdrydew made their first contribution in #7893
- @Luca-Blight made their first contribution in #7930
- @howsunjow made their first contribution in #7925
- @joakimnordling made their first contribution in #7881
- @icfly2 made their first contribution in #7976
- @Yummy-Yums made their first contribution in #8003
- @Iipin made their first contribution in #7972
- @tabassco made their first contribution in #8004
- @Mr-Pepe made their first contribution in #7979
- @0x00cl made their first contribution in #8010
- @barraponto made their first contribution in #8032
pydantic-core
- @sisp made their first contribution in pydantic/pydantic-core#995
- @michaelhly made their first contribution in pydantic/pydantic-core#1015
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.2...v2.5.0
- Python
Published by sydney-runkle over 2 years ago
pydantic - v2.5.0b1 (2023-11-09)
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
New Features
- Allow plugins to catch non
ValidationErrorerrors by @adriangb in #7806 - Support
__doc__argument increate_model()by @chris-spann in #7863 - Expose
regex_engineflag - 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
ComputedFieldInfoby @alexmojaki in #7889 - Adopting
ruffformatter by @Luca-Blight in #7930 - Added
validation_error_causeto config by @zakstucke in #7626 - Make path of the item to validate available in plugin by @hramezani in #7861
- Add
CallableDiscriminatorandTagby @dmontagu in #7983 - Make union case tags affect union error messages by @dmontagu in #8001
- Add
examplesandjson_schema_extrato@computed_fieldby @alexmojaki in #8013 - Add
JsonValuetype by @dmontagu in #7998 - Allow
stras argument toDiscriminatorby @dmontagu in #8047 - Add
SchemaSerializer.__reduce__method to enable pickle serialization by @edoakes in pydantic/pydantic-core#1006
Changes
- Significant Change: replace
ultra_strictwith 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
Enumtypes with no cases by @sydney-runkle in #7927 - Warn if a class inherits from
GenericbeforeBaseModelby @alexmojaki in #7891
Performance
- New custom JSON parser,
jiterby @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 #7947
Fixes
- Fix
mypyissue with subclasses ofRootModelby @sydney-runkle in #7677 - Properly rebuild the
FieldInfowhen a forward ref gets evaluated by @dmontagu in #7698 - Fix failure to load
SecretStrfrom JSON (regression in v2.4) by @sydney-runkle in #7729 - Fix
defer_buildbehavior withTypeAdapterby @sydney-runkle in #7736 - Improve compatibility with legacy
mypyversions by @dmontagu in #7742 - Fix: update
TypeVarhandling when default is not set by @pmmmwh in #7719 - Support specification of
strictonEnumtype fields by @sydney-runkle in #7761 - Wrap
weakref.refinstead of subclassing to fixcloudpickleserialization by @edoakes in #7780 - Keep values of private attributes set within
model_post_initin subclasses by @alexmojaki in #7775 - Add more specific type for non-callable
json_schema_extraby @alexmojaki in #7803 - Raise an error when deleting frozen (model) fields by @alexmojaki in #7800
- Fix schema sorting bug with default values by @sydney-runkle in #7817
- Use generated alias for aliases that are not specified otherwise by @alexmojaki in #7802
- Support
strictspecification forUUIDtypes by @sydney-runkle in #7865 - JSON schema: fix extra parameter handling by @me-and in #7810
- Fix: support
pydantic.Field(kw_only=True)with inherited dataclasses by @PrettyWood in #7827 - Support
validate_calldecorator for methods in classes with__slots__by @sydney-runkle in #7883 - Fix pydantic dataclass problem with
dataclasses.fielddefault by @hramezani in #7898 - Fix schema generation for generics with union type bounds by @sydney-runkle in #7899
- Fix version for
importlib_metadataon python 3.7 by @sydney-runkle in #7904 - Support
|operator (Union) in PydanticRecursiveRef by @alexmojaki in #7892 - Fix
display_as_typeforTypeAliasTypein python 3.12 by @dmontagu in #7929 - Add support for
NotRequiredgenerics inTypedDictby @sydney-runkle in #7932 - Make generic
TypeAliasTypespecifications produce different schema definitions by @alexdrydew in #7893 - Added fix for signature of inherited dataclass by @howsunjow in #7925
- Make the model name generation more robust in JSON schema by @joakimnordling in #7881
- Fix plurals in validation error messages (in tests) by @Iipin in #7972
PrivateAttris passed fromAnnotateddefault position by @tabassco in #8004- Don't decode bytes (which may not be UTF8) when displaying SecretBytes by @alexmojaki in #8012
- Use
classmethodinstead ofclassmethod[Any, Any, Any]by @Mr-Pepe in #7979 - Clearer error on invalid Plugin by @samuelcolvin in #8023
- Correct pydantic dataclasses import by @samuelcolvin in #8027
- Fix misbehavior for models referencing redefined type aliases by @dmontagu in #8050
- Fix
Optionalfield withvalidate_defaultonly performing one field validation by @sydney-runkle in pydantic/pydantic-core#1002 - Fix
definition-refbug withDictkeys by @sydney-runkle in pydantic/pydantic-core#1014 - Fix bug allowing validation of
booltypes withcoerce_numbers_to_str=Trueby @sydney-runkle in pydantic/pydantic-core#1017 - Don't accept
NaNin float and decimal constraints by @davidhewitt in pydantic/pydantic-core#1037 - Add
lax_strandlax_intsupport for enum values not inherited from str/int by @michaelhly in pydantic/pydantic-core#1015 - Support subclasses in lists in
UnionofListtypes by @sydney-runkle in pydantic/pydantic-core#1039 - Allow validation against
max_digitsanddecimalsto pass if normalized or non-normalized input is valid by @sydney-runkle in pydantic/pydantic-core#1049 - Fix: proper pluralization in
ValidationErrormessages by @Iipin in pydantic/pydantic-core#1050 - Disallow the string
'-'asdatetimeinput by @davidhewitt in pydantic/speedate#52 & pydantic/pydantic-core#1060 - Fix: NaN and Inf float serialization by @davidhewitt in pydantic/pydantic-core#1062
- Restore manylinux-compatible PGO builds by @davidhewitt in pydantic/pydantic-core#1068
New Contributors
pydantic
- @schneebuzz made their first contribution in #7699
- @edoakes made their first contribution in #7780
- @alexmojaki made their first contribution in #7775
- @NickG123 made their first contribution in #7751
- @gowthamgts made their first contribution in #7830
- @jamesbraza made their first contribution in #7848
- @laundmo made their first contribution in #7850
- @rahmatnazali made their first contribution in #7870
- @waterfountain1996 made their first contribution in #7878
- @chris-spann made their first contribution in #7863
- @me-and made their first contribution in #7810
- @utkini made their first contribution in #7768
- @bn-l made their first contribution in #7744
- @alexdrydew made their first contribution in #7893
- @Luca-Blight made their first contribution in #7930
- @howsunjow made their first contribution in #7925
- @joakimnordling made their first contribution in #7881
- @icfly2 made their first contribution in #7976
- @Yummy-Yums made their first contribution in #8003
- @Iipin made their first contribution in #7972
- @tabassco made their first contribution in #8004
- @Mr-Pepe made their first contribution in #7979
- @0x00cl made their first contribution in #8010
- @barraponto made their first contribution in #8032
pydantic-core
- @sisp made their first contribution in pydantic/pydantic-core#995
- @michaelhly made their first contribution in pydantic/pydantic-core#1015
Full changelog: Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.2...v2.5.0b1/
- Python
Published by samuelcolvin over 2 years ago
pydantic - v2.4.2 2023-09-27
What's Changed
Fixes
- Fix bug with JSON schema for sequence of discriminated union by @dmontagu in #7647
- Fix schema references in discriminated unions by @adriangb in #7646
- Fix json schema generation for recursive models by @adriangb in #7653
- Fix
models_json_schemafor generic models by @adriangb in #7654 - Fix xfailed test for generic model signatures by @adriangb in #7658
New Contributors
- @austinorr made their first contribution in #7657
- @peterHoburg made their first contribution in #7670
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.1...v2.4.2/
- Python
Published by hramezani over 2 years ago
pydantic - V1.10.13 2023-09-27
What's Changed
- Update pip commands to install 1.10 by @chbndrhnns in https://github.com/pydantic/pydantic/pull/6930
- Make the v1 mypy plugin work with both v1 and v2 by @dmontagu in https://github.com/pydantic/pydantic/pull/6920
- [Backport] Add max length check to
validate_emailby @hramezani in https://github.com/pydantic/pydantic/pull/7673
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.12...v1.10.13
- Python
Published by hramezani over 2 years ago
pydantic - v2.4.1 2023-09-26
What's Changed
Packaging
- Update pydantic-core to 2.10.1 by @davidhewitt in #7633
Fixes
- Serialize unsubstituted type vars as
Anyby @adriangb in #7606 - Remove schema building caches by @adriangb in #7624
- Fix an issue where JSON schema extras weren't JSON encoded by @dmontagu in #7625
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.4.0...v2.4.1/
- Python
Published by hramezani over 2 years ago
pydantic - v2.4.0 2023-09-25
What's Changed
Packaging
- Update pydantic-core to 2.10.0 by @samuelcolvin in #7542
New Features
- Add
Base64Urltypes by @dmontagu in #7286 - Implement optional
numbertostrcoercion by @lig in #7508 - Allow access to
field_nameanddatain all validators if there is data and a field name by @samuelcolvin in #7542 - Add
BaseModel.model_validate_stringsandTypeAdapter.validate_stringsby @hramezani in #7552 - Add Pydantic
pluginsexperimental implementation by @lig @samuelcolvin and @Kludex in #6820
Changes
- Do not override
model_post_initin subclass with private attrs by @Viicos in #7302 - Make fields with defaults not required in the serialization schema by default by @dmontagu in #7275
- Mark
Extraas deprecated by @disrupted in #7299 - Make
EncodedStra dataclass by @Kludex in #7396 - Move
annotated_handlersto be public by @samuelcolvin in #7569
Performance
- Simplify flattening and inlining of
CoreSchemaby @adriangb in #7523 - Remove unused copies in
CoreSchemawalking by @adriangb in #7528 - Add caches for collecting definitions and invalid schemas from a CoreSchema by @adriangb in #7527
- Eagerly resolve discriminated unions and cache cases where we can't by @adriangb in #7529
- Replace
dict.getanddict.setdefaultwith more verbose versions inCoreSchemabuilding hot paths by @adriangb in #7536 - Cache invalid
CoreSchemadiscovery by @adriangb in #7535 - Allow disabling
CoreSchemavalidation for faster startup times by @adriangb in #7565
Fixes
- Fix config detection for
TypedDictfrom grandparent classes by @dmontagu in #7272 - Fix hash function generation for frozen models with unusual MRO by @dmontagu in #7274
- Make
strictconfig overridable in field for Path by @hramezani in #7281 - Use
ser_json_<timedelta|bytes>on default inGenerateJsonSchemaby @Kludex in #7269 - Adding a check that alias is validated as an identifier for Python by @andree0 in #7319
- Raise an error when computed field overrides field by @sydney-runkle in #7346
- Fix applying
SkipValidationto referenced schemas by @adriangb in #7381 - Enforce behavior of private attributes having double leading underscore by @lig in #7265
- Standardize
__get_pydantic_core_schema__signature by @hramezani in #7415 - Fix generic dataclass fields mutation bug (when using
TypeAdapter) by @sydney-runkle in #7435 - Fix
TypeErroronmodel_validatorinwrapmode by @pmmmwh in #7496 - Improve enum error message by @hramezani in #7506
- Make
reprwork for instances that failed initialization when handlingValidationErrors by @dmontagu in #7439 - Fixed a regular expression denial of service issue by limiting whitespaces by @prodigysml in #7360
- Fix handling of
UUIDvalues havingUUID.version=Noneby @lig in #7566 - Fix
__iter__returning privatecached_propertyinfo by @sydney-runkle in #7570 - Improvements to version info message by @samuelcolvin in #7594
New Contributors
- @15498th made their first contribution in #7238
- @GabrielCappelli made their first contribution in #7213
- @tobni made their first contribution in #7184
- @redruin1 made their first contribution in #7282
- @FacerAin made their first contribution in #7288
- @acdha made their first contribution in #7297
- @andree0 made their first contribution in #7319
- @gordonhart made their first contribution in #7375
- @pmmmwh made their first contribution in #7496
- @disrupted made their first contribution in #7299
- @prodigysml made their first contribution in #7360
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.3.0...v2.4.0
- Python
Published by samuelcolvin over 2 years ago
pydantic - v2.3.0
What's Changed
- 🔥 Remove orphaned changes file from repo by @lig in https://github.com/pydantic/pydantic/pull/7168
- Add copy button on documentation by @Kludex in https://github.com/pydantic/pydantic/pull/7190
- Fix docs on JSON type by @Kludex in https://github.com/pydantic/pydantic/pull/7189
- Update mypy 1.5.0 to 1.5.1 in CI by @hramezani in https://github.com/pydantic/pydantic/pull/7191
- fix download links badge by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7200
- add 2.2.1 to changelog by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7212
- Make ModelWrapValidator protocols generic by @dmontagu in https://github.com/pydantic/pydantic/pull/7154
- Correct
Field(..., exclude: bool)docs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7214 - Make shadowing attributes a warning instead of an error by @adriangb in https://github.com/pydantic/pydantic/pull/7193
- Document
Base64StrandBase64Bytesby @Kludex in https://github.com/pydantic/pydantic/pull/7192 - Fix
config.defer_buildfor serialization first cases by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7024 - clean Model docstrings in JSON Schema by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7210
- fix #7228 (typo): docs in
validators.mdto correctvalidate_defaultkwarg by @lmmx in https://github.com/pydantic/pydantic/pull/7229 - ✅ Implement
tzinfo.fromutcmethod forTzInfoinpydantic-coreby @lig in https://github.com/pydantic/pydantic/pull/7019 - Support
__get_validators__by @hramezani in https://github.com/pydantic/pydantic/pull/7197
New Contributors
- @lmmx made their first contribution in https://github.com/pydantic/pydantic/pull/7229
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.2.1...v2.2.2
- Python
Published by adriangb almost 3 years ago
pydantic - v2.2.1 2023-08-18
What's Changed
- Make xfailing test for root model extra stop xfailing by @dmontagu in https://github.com/pydantic/pydantic/pull/6937
- Optimize recursion detection by stopping on the second visit for the … by @mciucu in https://github.com/pydantic/pydantic/pull/7160
- fix link in docs by @tlambert03 in https://github.com/pydantic/pydantic/pull/7166
- Bump pydantic-core to 2.6.1 and prepare 2.2.1 release by @adriangb in https://github.com/pydantic/pydantic/pull/7176
New Contributors
- @mciucu made their first contribution in https://github.com/pydantic/pydantic/pull/7160
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.2.0...v2.2.1
- Python
Published by adriangb almost 3 years ago
pydantic - v2.2.0 2023-08-17
What's Changed
- Split "pipx install" setup command into two commands on the documentation site by @nomadmtb in https://github.com/pydantic/pydantic/pull/6869
- Deprecate
Field.includeby @hramezani in https://github.com/pydantic/pydantic/pull/6852 - Fix typo in default factory error msg by @hramezani in https://github.com/pydantic/pydantic/pull/6880
- Simplify handling of typing.Annotated in GenerateSchema by @dmontagu in https://github.com/pydantic/pydantic/pull/6887
- Re-enable fastapi tests in CI by @dmontagu in https://github.com/pydantic/pydantic/pull/6883
- Make it harder to hit collisions with json schema defrefs by @dmontagu in https://github.com/pydantic/pydantic/pull/6566
- Cleaner error for invalid input to
Pathfields by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6903 - :memo: support Coordinate Type by @yezz123 in https://github.com/pydantic/pydantic/pull/6906
- Fix
ForwardRefwrapper for py 3.10.0 (shim until bpo-45166) by @randomir in https://github.com/pydantic/pydantic/pull/6919 - Fix misbehavior related to copying of RootModel by @dmontagu in https://github.com/pydantic/pydantic/pull/6918
- Fix issue with recursion error caused by ParamSpec by @dmontagu in https://github.com/pydantic/pydantic/pull/6923
- Add section about Constrained classes to the Migration Guide by @Kludex in https://github.com/pydantic/pydantic/pull/6924
- Use
mainbranch for badge links by @Viicos in https://github.com/pydantic/pydantic/pull/6925 - Add test for v1/v2 Annotated discrepancy by @carlbordum in https://github.com/pydantic/pydantic/pull/6926
- Make the v1 mypy plugin work with both v1 and v2 by @dmontagu in https://github.com/pydantic/pydantic/pull/6921
- Fix issue where generic models couldn't be parametrized with BaseModel by @dmontagu in https://github.com/pydantic/pydantic/pull/6933
- Remove xfail for discriminated union with alias by @dmontagu in https://github.com/pydantic/pydantic/pull/6938
- add fieldserializer to computedfield by @andresliszt in https://github.com/pydantic/pydantic/pull/6965
- Use union_schema with Type[Union[...]] by @JeanArhancet in https://github.com/pydantic/pydantic/pull/6952
- Fix inherited typeddict attributes / config by @adriangb in https://github.com/pydantic/pydantic/pull/6981
- fix dataclass annotated before validator called twice by @davidhewitt in https://github.com/pydantic/pydantic/pull/6998
- Update test-fastapi deselected tests by @hramezani in https://github.com/pydantic/pydantic/pull/7014
- Fix validator doc format by @hramezani in https://github.com/pydantic/pydantic/pull/7015
- Fix typo in docstring of modeljsonschema by @AdamVinch-Federated in https://github.com/pydantic/pydantic/pull/7032
- remove unused "type ignores" with pyright by @samuelcolvin in https://github.com/pydantic/pydantic/pull/7026
- Add benchmark representing FastAPI startup time by @adriangb in https://github.com/pydantic/pydantic/pull/7030
- Fix json_encoders for Enum subclasses by @adriangb in https://github.com/pydantic/pydantic/pull/7029
- Update docstring of
ser_json_bytesregarding base64 encoding by @Viicos in https://github.com/pydantic/pydantic/pull/7052 - Allow
@validate_callto work on async methods by @adriangb in https://github.com/pydantic/pydantic/pull/7046 - Fix: mypy error with
SettingsandSettingsConfigDictby @JeanArhancet in https://github.com/pydantic/pydantic/pull/7002 - Fix some typos (repeated words and it's/its) by @eumiro in https://github.com/pydantic/pydantic/pull/7063
- Fix the typo in docstring by @harunyasar in https://github.com/pydantic/pydantic/pull/7062
- Docs: Fix broken URL in the pydantic-settings package recommendation by @swetjen in https://github.com/pydantic/pydantic/pull/6995
- Handle constraints being applied to schemas that don't accept it by @adriangb in https://github.com/pydantic/pydantic/pull/6951
- Replace almostequalfloats with math.isclose by @eumiro in https://github.com/pydantic/pydantic/pull/7082
- bump pydantic-core to 2.5.0 by @davidhewitt in https://github.com/pydantic/pydantic/pull/7077
- Add
short_versionand use it in links by @hramezani in https://github.com/pydantic/pydantic/pull/7115 - 📝 Add usage link to
RootModelby @Kludex in https://github.com/pydantic/pydantic/pull/7113 - Revert "Fix default port for mongosrv DSNs (#6827)" by @Kludex in https://github.com/pydantic/pydantic/pull/7116
- Clarify validate_default and _Unset handling in usage docs and migration guide by @benbenbang in https://github.com/pydantic/pydantic/pull/6950
- Tweak documentation of
Field.excludeby @Viicos in https://github.com/pydantic/pydantic/pull/7086 - Do not require
validate_assignmentto useField.frozenby @Viicos in https://github.com/pydantic/pydantic/pull/7103 - tweaks to
_core_utilsby @samuelcolvin in https://github.com/pydantic/pydantic/pull/7040 - Make DefaultDict working with set by @hramezani in https://github.com/pydantic/pydantic/pull/7126
- Don't always require typing.Generic as a base for partially parametrized models by @dmontagu in https://github.com/pydantic/pydantic/pull/7119
- Fix issue with JSON schema incorrectly using parent class core schema by @dmontagu in https://github.com/pydantic/pydantic/pull/7020
- Fix xfailed test related to TypedDict and alias_generator by @dmontagu in https://github.com/pydantic/pydantic/pull/6940
- Improve error message for NameEmail by @dmontagu in https://github.com/pydantic/pydantic/pull/6939
- Fix generic computed fields by @dmontagu in https://github.com/pydantic/pydantic/pull/6988
- Reflect namedtuple default values during validation by @dmontagu in https://github.com/pydantic/pydantic/pull/7144
- Update dependencies, fix pydantic-core usage, fix CI issues by @dmontagu in https://github.com/pydantic/pydantic/pull/7150
- Add mypy 1.5.0 by @hramezani in https://github.com/pydantic/pydantic/pull/7118
- Handle non-json native enum values by @adriangb in https://github.com/pydantic/pydantic/pull/7056
- document
round_tripin Json type documentation by @jc-louis in https://github.com/pydantic/pydantic/pull/7137 - Relax signature checks to better support builtins and C extension functions as validators by @adriangb in https://github.com/pydantic/pydantic/pull/7101
- add unionmode='leftto_right' by @davidhewitt in https://github.com/pydantic/pydantic/pull/7151
- Include an error message hint for inherited ordering by @yvalencia91 in https://github.com/pydantic/pydantic/pull/7124
- Fix one docs link and resolve some warnings for two others by @dmontagu in https://github.com/pydantic/pydantic/pull/7153
- Include Field extra keys name in warning by @hramezani in https://github.com/pydantic/pydantic/pull/7136
- Prepare for v2.2.0 by @dmontagu in https://github.com/pydantic/pydantic/pull/7157
New Contributors
- @nomadmtb made their first contribution in https://github.com/pydantic/pydantic/pull/6869
- @RS-Credentive made their first contribution in https://github.com/pydantic/pydantic/pull/6878
- @ialarmedalien made their first contribution in https://github.com/pydantic/pydantic/pull/6886
- @randomir made their first contribution in https://github.com/pydantic/pydantic/pull/6919
- @carlbordum made their first contribution in https://github.com/pydantic/pydantic/pull/6926
- @vishallama made their first contribution in https://github.com/pydantic/pydantic/pull/6947
- @andresliszt made their first contribution in https://github.com/pydantic/pydantic/pull/6965
- @AdamVinch-Federated made their first contribution in https://github.com/pydantic/pydantic/pull/7032
- @eumiro made their first contribution in https://github.com/pydantic/pydantic/pull/7063
- @harunyasar made their first contribution in https://github.com/pydantic/pydantic/pull/7062
- @mo1ein made their first contribution in https://github.com/pydantic/pydantic/pull/7074
- @swetjen made their first contribution in https://github.com/pydantic/pydantic/pull/6995
- @benbenbang made their first contribution in https://github.com/pydantic/pydantic/pull/6950
- @jc-louis made their first contribution in https://github.com/pydantic/pydantic/pull/7137
- @yvalencia91 made their first contribution in https://github.com/pydantic/pydantic/pull/7124
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.1.1...v2.2.0
- Python
Published by lig almost 3 years ago
pydantic - v2.1.1 2023-07-25
What's Changed
- Skip FieldInfo merging when unnecessary by @dmontagu in https://github.com/pydantic/pydantic/pull/6862
- Prepare 2.1.1 by @dmontagu in https://github.com/pydantic/pydantic/pull/6865
- Python
Published by dmontagu almost 3 years ago
pydantic - v2.1.0 2023-07-25
What's Changed
- Add StringConstraints for use as Annotated metadata by @adriangb in https://github.com/pydantic/pydantic/pull/6605
- Try to fix intermittently failing CI by @adriangb in https://github.com/pydantic/pydantic/pull/6683
- Remove redundant example of optional vs default. by @ehiggs-deliverect in https://github.com/pydantic/pydantic/pull/6676
- Docs update by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6692
- Remove the Validate always section in validator docs by @adriangb in https://github.com/pydantic/pydantic/pull/6679
- Fix recursion error in json schema generation by @adriangb in https://github.com/pydantic/pydantic/pull/6720
- Fix incorrect subclass check for secretstr by @AlexVndnblcke in https://github.com/pydantic/pydantic/pull/6730
- update pdm / pdm lockfile to 2.8.0 by @davidhewitt in https://github.com/pydantic/pydantic/pull/6714
- unpin pdm on more CI jobs by @davidhewitt in https://github.com/pydantic/pydantic/pull/6755
- improve source locations for auxiliary packages in docs by @davidhewitt in https://github.com/pydantic/pydantic/pull/6749
- Assume builtins don't accept an info argument by @adriangb in https://github.com/pydantic/pydantic/pull/6754
- Fix bug where calling
help(BaseModelSubclass)raises errors by @hramezani in https://github.com/pydantic/pydantic/pull/6758 - Fix mypy plugin handling of @model_validator(mode="after") by @ljodal in https://github.com/pydantic/pydantic/pull/6753
- update pydantic-core to 2.3.1 by @davidhewitt in https://github.com/pydantic/pydantic/pull/6756
- Mypy plugin for settings by @hramezani in https://github.com/pydantic/pydantic/pull/6760
- Use contentSchema keyword for JSON schema by @dmontagu in https://github.com/pydantic/pydantic/pull/6715
- fast-path checking finite decimals by @davidhewitt in https://github.com/pydantic/pydantic/pull/6769
- Docs update by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6771
- Improve json schema doc by @hramezani in https://github.com/pydantic/pydantic/pull/6772
- Update validator docs by @adriangb in https://github.com/pydantic/pydantic/pull/6695
- Fix typehint for wrap validator by @dmontagu in https://github.com/pydantic/pydantic/pull/6788
- 🐛 Fix validation warning for unions of Literal and other type by @lig in https://github.com/pydantic/pydantic/pull/6628
- Update documentation for generics support in V2 by @tpdorsey in https://github.com/pydantic/pydantic/pull/6685
- add pydantic-core build info to
version_info()by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6785 - Fix pydantic dataclasses that use slots with default values by @dmontagu in https://github.com/pydantic/pydantic/pull/6796
- Fix inheritance of hash function for frozen models by @dmontagu in https://github.com/pydantic/pydantic/pull/6789
- ✨ Add
SkipJsonSchemaannotation by @Kludex in https://github.com/pydantic/pydantic/pull/6653 - Error if an invalid field name is used with Field by @dmontagu in https://github.com/pydantic/pydantic/pull/6797
- Add GenericModel to MOVEDINV2 by @adriangb in https://github.com/pydantic/pydantic/pull/6776
- Remove unused code from
docs/usage/types/custom.mdby @hramezani in https://github.com/pydantic/pydantic/pull/6803 - Fix float -> Decimal coercion precision loss by @adriangb in https://github.com/pydantic/pydantic/pull/6810
- remove email validation from the north star benchmark by @davidhewitt in https://github.com/pydantic/pydantic/pull/6816
- Fix link to mypy by @progsmile in https://github.com/pydantic/pydantic/pull/6824
- Improve initialization hooks example by @hramezani in https://github.com/pydantic/pydantic/pull/6822
- Fix default port for mongosrv DSNs by @dmontagu in https://github.com/pydantic/pydantic/pull/6827
- Improve API documentation, in particular more links between usage and API docs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6780
- update pydantic-core to 2.4.0 by @davidhewitt in https://github.com/pydantic/pydantic/pull/6831
- Fix annotated_types.MaxLen validator for custom sequence types by @ImogenBits in https://github.com/pydantic/pydantic/pull/6809
- Update V1 by @hramezani in https://github.com/pydantic/pydantic/pull/6833
- Make it so callable JSON schema extra works by @dmontagu in https://github.com/pydantic/pydantic/pull/6798
- Fix serialization issue with InstanceOf by @dmontagu in https://github.com/pydantic/pydantic/pull/6829
- Add back support for
json_encodersby @adriangb in https://github.com/pydantic/pydantic/pull/6811 - Update field annotations when building the schema by @dmontagu in https://github.com/pydantic/pydantic/pull/6838
- Use WeakValueDictionary to fix generic memory leak by @dmontagu in https://github.com/pydantic/pydantic/pull/6681
- Add
config.defer_buildto optionally make model building lazy by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6823 - delegate UUID serialization to pydantic-core by @davidhewitt in https://github.com/pydantic/pydantic/pull/6850
- Update
json_encodersdocs by @adriangb in https://github.com/pydantic/pydantic/pull/6848 - Fix error message for staticmethod/classmethod order with validate_call by @dmontagu in https://github.com/pydantic/pydantic/pull/6686
- Improve documentation for config by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6847
- Update serialization doc to mention
Field.excludetakes priority over call-timeinclude/excludeby @hramezani in https://github.com/pydantic/pydantic/pull/6851 - Allow customizing core schema generation by making
GenerateSchemapublic by @adriangb in https://github.com/pydantic/pydantic/pull/6737 - Prepare for release of v2.1.0 by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6853
New Contributors
- @ehiggs-deliverect made their first contribution in https://github.com/pydantic/pydantic/pull/6676
- @AlexVndnblcke made their first contribution in https://github.com/pydantic/pydantic/pull/6730
- @ljodal made their first contribution in https://github.com/pydantic/pydantic/pull/6753
- @progsmile made their first contribution in https://github.com/pydantic/pydantic/pull/6824
- @ImogenBits made their first contribution in https://github.com/pydantic/pydantic/pull/6809
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0.3...v2.1.0
- Python
Published by samuelcolvin almost 3 years ago
pydantic - V1.10.12
What's Changed
- Deque's maxlen property dropped on V1 validation by @maciekglowka in https://github.com/pydantic/pydantic/pull/6586
- Prepare release 1.10.12 by @hramezani in https://github.com/pydantic/pydantic/pull/6825
New Contributors
- @maciekglowka made their first contribution in https://github.com/pydantic/pydantic/pull/6586
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.11...v1.10.12
- Python
Published by hramezani almost 3 years ago
pydantic - v2.0.3
What's Changed
- Mention PyObject (v1) moving to ImportString (v2) in migration doc by @slafs in https://github.com/pydantic/pydantic/pull/6456
- Fix release-tweet CI by @Kludex in https://github.com/pydantic/pydantic/pull/6461
- Revise the section on required / optional / nullable fields. by @ybressler in https://github.com/pydantic/pydantic/pull/6468
- Warn if a type hint is not in fact a type by @adriangb in https://github.com/pydantic/pydantic/pull/6479
- Replace TransformSchema with GetPydanticSchema by @dmontagu in https://github.com/pydantic/pydantic/pull/6484
- Fix the un-hashability of various annotation types, for use in caching generic containers by @dmontagu in https://github.com/pydantic/pydantic/pull/6480
- PYD-164: Rework custom types docs by @adriangb in https://github.com/pydantic/pydantic/pull/6490
- Fix ci by @adriangb in https://github.com/pydantic/pydantic/pull/6507
- Fix forward ref in generic by @adriangb in https://github.com/pydantic/pydantic/pull/6511
- Fix generation of serialization JSON schemas for core_schema.ChainSchema by @dmontagu in https://github.com/pydantic/pydantic/pull/6515
- Document the change in
Field.aliasbehavior in Pydantic V2 by @hramezani in https://github.com/pydantic/pydantic/pull/6508 - Give better error message attempting to compute the json schema of a model with undefined fields by @dmontagu in https://github.com/pydantic/pydantic/pull/6519
- Document
alias_priorityby @tpdorsey in https://github.com/pydantic/pydantic/pull/6520 - Add redirect for types documentation by @tpdorsey in https://github.com/pydantic/pydantic/pull/6513
- Allow updating docs without release by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6551
- Ensure docs tests always run in the right folder by @dmontagu in https://github.com/pydantic/pydantic/pull/6487
- Defer evaluation of return type hints for serializer functions by @dmontagu in https://github.com/pydantic/pydantic/pull/6516
- Disable E501 from Ruff and rely on just Black by @adriangb in https://github.com/pydantic/pydantic/pull/6552
- Update JSON Schema documentation for V2 by @tpdorsey in https://github.com/pydantic/pydantic/pull/6492
- Add documentation of cyclic reference handling by @dmontagu in https://github.com/pydantic/pydantic/pull/6493
- Remove the need for change files by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6556
- add "north star" benchmark by @davidhewitt in https://github.com/pydantic/pydantic/pull/6547
- Update Dataclasses docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/6470
- ♻️ Use different error message on v1 redirects by @Kludex in https://github.com/pydantic/pydantic/pull/6595
- ⬆ Upgrade
pydantic-coreto v2.2.0 by @lig in https://github.com/pydantic/pydantic/pull/6589 - Fix serialization for IPvAny by @dmontagu in https://github.com/pydantic/pydantic/pull/6572
- Improve CI by using PDM instead of pip to install typing-extensions by @adriangb in https://github.com/pydantic/pydantic/pull/6602
- Add
enumerror type docs by @lig in https://github.com/pydantic/pydantic/pull/6603 - 🐛 Fix
max_lengthfor unicode strings by @lig in https://github.com/pydantic/pydantic/pull/6559 - Add documentation for accessing features via
pydantic.v1by @tpdorsey in https://github.com/pydantic/pydantic/pull/6604 - Include extra when iterating over a model by @adriangb in https://github.com/pydantic/pydantic/pull/6562
- Fix typing of model_validator by @adriangb in https://github.com/pydantic/pydantic/pull/6514
- Touch up Decimal validator by @adriangb in https://github.com/pydantic/pydantic/pull/6327
- Fix various docstrings using fixed pytest-examples by @dmontagu in https://github.com/pydantic/pydantic/pull/6607
- Handle function validators in a discriminated union by @dmontagu in https://github.com/pydantic/pydantic/pull/6570
- Review json_schema.md by @tpdorsey in https://github.com/pydantic/pydantic/pull/6608
- Make validate_call work on basemodel methods by @dmontagu in https://github.com/pydantic/pydantic/pull/6569
- add test for big int json serde by @davidhewitt in https://github.com/pydantic/pydantic/pull/6614
- Fix pydantic dataclass problem with dataclasses.field default_factory by @hramezani in https://github.com/pydantic/pydantic/pull/6616
- Fixed mypy type inferrence for TypeAdapter by @zakstucke in https://github.com/pydantic/pydantic/pull/6617
- Make it work to use None as a generic parameter by @dmontagu in https://github.com/pydantic/pydantic/pull/6609
- Make it work to use
$refas an alias by @dmontagu in https://github.com/pydantic/pydantic/pull/6568 - add note to migration guide about changes to
AnyUrletc by @davidhewitt in https://github.com/pydantic/pydantic/pull/6618 - 🐛 Support defining
json_schema_extraonRootModelusingFieldby @lig in https://github.com/pydantic/pydantic/pull/6622 - Update pre-commit to prevent commits to main branch on accident by @dmontagu in https://github.com/pydantic/pydantic/pull/6636
- Fix PDM CI for python 3.7 on MacOS/windows by @dmontagu in https://github.com/pydantic/pydantic/pull/6627
- Produce more accurate signatures for pydantic dataclasses by @dmontagu in https://github.com/pydantic/pydantic/pull/6633
- Updates to Url types for Pydantic V2 by @tpdorsey in https://github.com/pydantic/pydantic/pull/6638
- Fix list markdown in
transformdocstring by @StefanBRas in https://github.com/pydantic/pydantic/pull/6649 - simplify slots_dataclass construction to appease mypy by @davidhewitt in https://github.com/pydantic/pydantic/pull/6639
- Update TypedDict schema generation docstring by @adriangb in https://github.com/pydantic/pydantic/pull/6651
- Detect and lint-error for prints by @dmontagu in https://github.com/pydantic/pydantic/pull/6655
- Add xfailing test for pydantic-core PR 766 by @dmontagu in https://github.com/pydantic/pydantic/pull/6641
- Ignore unrecognized fields from dataclasses metadata by @dmontagu in https://github.com/pydantic/pydantic/pull/6634
- Make non-existent class getattr a mypy error by @dmontagu in https://github.com/pydantic/pydantic/pull/6658
- Update pydantic-core to 2.3.0 by @hramezani in https://github.com/pydantic/pydantic/pull/6648
- Use OrderedDict from typing_extensions by @dmontagu in https://github.com/pydantic/pydantic/pull/6664
- Fix typehint for JSON schema extra callable by @dmontagu in https://github.com/pydantic/pydantic/pull/6659
New Contributors
- @slafs made their first contribution in https://github.com/pydantic/pydantic/pull/6456
- @zakstucke made their first contribution in https://github.com/pydantic/pydantic/pull/6617
- @StefanBRas made their first contribution in https://github.com/pydantic/pydantic/pull/6649
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0.2...v2.03
- Python
Published by adriangb almost 3 years ago
pydantic - v2.0.2 2023-07-05
What's Changed
- 💚 Insert the version without double quotes on tweet by @Kludex in https://github.com/pydantic/pydantic/pull/6437
- tests - test for #6416 by @commonism in https://github.com/pydantic/pydantic/pull/6424
- Fix the changelog address on pyproject.toml by @hakancelikdev in https://github.com/pydantic/pydantic/pull/6445
- Fix
GenerateJsonSchema.generate_definitionssignature by @dmontagu in https://github.com/pydantic/pydantic/pull/6436 - Fix list indentation by @ofek in https://github.com/pydantic/pydantic/pull/6408
- Docs: Fixing constr argument regex -> pattern // Typo by @miili in https://github.com/pydantic/pydantic/pull/6452
- 👷 Require change files by @Kludex in https://github.com/pydantic/pydantic/pull/6428
- 💚 Fix git usage in FastAPI integration tests by @lig in https://github.com/pydantic/pydantic/pull/6434
- Update pydantic-core to 2.1.2 by @adriangb in https://github.com/pydantic/pydantic/pull/6392
- Fix issue with union parsing of enums by @dmontagu in https://github.com/pydantic/pydantic/pull/6440
- Allow single-item discriminated unions by @dmontagu in https://github.com/pydantic/pydantic/pull/6405
- Fix pickling of RootModel by @dmontagu in https://github.com/pydantic/pydantic/pull/6457
- Prepare for v2.0.2 by @dmontagu in https://github.com/pydantic/pydantic/pull/6460
New Contributors
- @hakancelikdev made their first contribution in https://github.com/pydantic/pydantic/pull/6445
- @miili made their first contribution in https://github.com/pydantic/pydantic/pull/6452
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0.1...v2.0.2
- Python
Published by dmontagu almost 3 years ago
pydantic - v2.0.1 2023-07-04
What's Changed
- 📝 Add note about Bump Pydantic by @Kludex in https://github.com/pydantic/pydantic/pull/6281
- Parse Decimal in python to avoid precision loss by @adriangb in https://github.com/pydantic/pydantic/pull/6321
- Fix typo of
model_parametrized_nameindocs/usage/models.mdby @hramezani in https://github.com/pydantic/pydantic/pull/6325 - fix(docs): typo fix for docs by @ozgurturkiye in https://github.com/pydantic/pydantic/pull/6335
- Allow
__modify_schema__to co-exist__get_pydantic_json_schema__by @adriangb in https://github.com/pydantic/pydantic/pull/6334 - Fix tagged unions multiple processing in submodels by @suharnikov in https://github.com/pydantic/pydantic/pull/6340
- Unpack json schema refs for custom types by @adriangb in https://github.com/pydantic/pydantic/pull/6315
- Fix typo in
create_modelfunction by @TimDiekmann in https://github.com/pydantic/pydantic/pull/6347 - Update README.md by @weqopy in https://github.com/pydantic/pydantic/pull/6363
- Adding extra field via
setattradds field to model_extra by @aaraney in https://github.com/pydantic/pydantic/pull/6365 - Fix
validate_callschema generation and doc error forTypedDictby @adriangb in https://github.com/pydantic/pydantic/pull/6370 - :memo: Include
Mac Addressdocumentation by @yezz123 in https://github.com/pydantic/pydantic/pull/6367 - Remove warning from top of
docs/usage/types/encoded.mdby @hramezani in https://github.com/pydantic/pydantic/pull/6377 - Remove datamodel code generator not working warning from doc by @hramezani in https://github.com/pydantic/pydantic/pull/6378
- Fix some uses of
Fieldinside ofAnnotatedby @adriangb in https://github.com/pydantic/pydantic/pull/6373 - 🔨 Include
pydantic-extra-typesto integration tests by @yezz123 in https://github.com/pydantic/pydantic/pull/6344 - add davidhewitt to hooky respondents by @davidhewitt in https://github.com/pydantic/pydantic/pull/6385
- Update pydantic-core to 2.0.2 by @adriangb in https://github.com/pydantic/pydantic/pull/6389
- 🐛 Don't call
repr()on qualname retrieval by @Kludex in https://github.com/pydantic/pydantic/pull/6382 - Warn instead of error protected namespace by @dmontagu in https://github.com/pydantic/pydantic/pull/6326
- Do not recommend raising
TypeErrorin validators by @Viicos in https://github.com/pydantic/pydantic/pull/6391 - Test model_extra is None when extra='forbid' by @dmontagu in https://github.com/pydantic/pydantic/pull/6341
- Remove --verbose flag from docs build to clean up CI logs by @adriangb in https://github.com/pydantic/pydantic/pull/6399
- Add note about changes to regex engine used by @adriangb in https://github.com/pydantic/pydantic/pull/6400
- Allow combining
Fieldannotations by merging them by @adriangb in https://github.com/pydantic/pydantic/pull/6398 - BaseSettings moved, not removed by @tpdorsey in https://github.com/pydantic/pydantic/pull/6401
- Bind
validate_callto instance when decorating methods by @dmontagu in https://github.com/pydantic/pydantic/pull/6406 - 💚 Use "result" instead of "status" on GitHub Action conditional by @Kludex in https://github.com/pydantic/pydantic/pull/6410
- Update models.md by @dmontagu in https://github.com/pydantic/pydantic/pull/6331
- 🐛 Add
__hash__forWithJsonSchemaandExamplesby @Kludex in https://github.com/pydantic/pydantic/pull/6414 - 🐛 Fix generic tuple cannot have more than one item by @lig in https://github.com/pydantic/pydantic/pull/6384
- Upate mypy plugin to consider pydantic-settings model by @hramezani in https://github.com/pydantic/pydantic/pull/6396
- Improve
BaseModel.__getattr__to raise a better error in case of AttributeError in model property by @hramezani in https://github.com/pydantic/pydantic/pull/6417 - Fix issue where validate_call methods would break when accessed as a class attribute by @dmontagu in https://github.com/pydantic/pydantic/pull/6431
- Update Pydantic V1 to 1.10.11 by @hramezani in https://github.com/pydantic/pydantic/pull/6427
- Rework how JSON schema refs get built/"simplified" by @dmontagu in https://github.com/pydantic/pydantic/pull/6402
- Prepare for v2.0.1 by @dmontagu in https://github.com/pydantic/pydantic/pull/6433
- 💚 Use
main-pv2FastAPI branch in integration tests by @lig in https://github.com/pydantic/pydantic/pull/6432
New Contributors
- @ozgurturkiye made their first contribution in https://github.com/pydantic/pydantic/pull/6335
- @suharnikov made their first contribution in https://github.com/pydantic/pydantic/pull/6340
- @TimDiekmann made their first contribution in https://github.com/pydantic/pydantic/pull/6347
- @weqopy made their first contribution in https://github.com/pydantic/pydantic/pull/6363
- @aaraney made their first contribution in https://github.com/pydantic/pydantic/pull/6365
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0...v2.0.1
- Python
Published by dmontagu almost 3 years ago
pydantic - V1.10.11
What's Changed
- Fix import of create_model in tools.py by @SharathHuddar in https://github.com/pydantic/pydantic/pull/6364
- Prepare for 1.10.11 by @hramezani in https://github.com/pydantic/pydantic/pull/6420
New Contributors
- @SharathHuddar made their first contribution in https://github.com/pydantic/pydantic/pull/6364
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.10...v1.10.11
- Python
Published by hramezani almost 3 years ago
pydantic - v2.0 2023-06-30
What's Changed
- 📝 Don't recomend to use
TypeErroron validators by @Kludex in https://github.com/pydantic/pydantic/pull/6179 - 📝 Add docs about custom error messages by @Kludex in https://github.com/pydantic/pydantic/pull/6182
- Change allow mutation wording by @mark-todd in https://github.com/pydantic/pydantic/pull/6184
- 📝 Improve fields documentation by @Kludex in https://github.com/pydantic/pydantic/pull/6183
- Ignore deprecated methods of
pydantic.mainin pydocstyle check by @hramezani in https://github.com/pydantic/pydantic/pull/6185 - Another solution to custom getattr/delattr by @dmontagu in https://github.com/pydantic/pydantic/pull/6165
- 🐛 Fix
RootModeldefault values by @lig in https://github.com/pydantic/pydantic/pull/5949 - Improve conversion_table by @hramezani in https://github.com/pydantic/pydantic/pull/6186
- Uncomment
from_ormdeprecateddecorator by @hramezani in https://github.com/pydantic/pydantic/pull/6189 - Complete
pydantic/root_model.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6193 - Complete
pydantic/functional_validators.pydocstrings by @hramezani in https://github.com/pydantic/pydantic/pull/6191 - Fix access of 'required' key for TypedDictField in GenerateJsonSchema by @adriangb in https://github.com/pydantic/pydantic/pull/6200
- 💚 Use the same conditions on
send_tweetasreleaseby @Kludex in https://github.com/pydantic/pydantic/pull/6170 - 📝 Add migration reference to the "Import Error" section by @Kludex in https://github.com/pydantic/pydantic/pull/6208
- Improve
pydantic/mypy.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6207 - 📝 Update documentation about "Number Types" by @Kludex in https://github.com/pydantic/pydantic/pull/6211
- Don't sort model keys by @adriangb in https://github.com/pydantic/pydantic/pull/6212
- Add documentation for strict mode by @tpdorsey in https://github.com/pydantic/pydantic/pull/6196
- Add documentation for strict types by @tpdorsey in https://github.com/pydantic/pydantic/pull/6218
- Update serialization decorator documentation by @tpdorsey in https://github.com/pydantic/pydantic/pull/6216
- Update list and set docs by @dmontagu in https://github.com/pydantic/pydantic/pull/6142
- Update docs for sequence_iterable by @dmontagu in https://github.com/pydantic/pydantic/pull/6220
- 👷 Add Integration CI workflow for
pydantic-settingsby @lig in https://github.com/pydantic/pydantic/pull/6221 - ⬆ Upgrade to pydantic-core 0.41.0 by @lig in https://github.com/pydantic/pydantic/pull/6219
- Document Strict on Annotated fields by @tpdorsey in https://github.com/pydantic/pydantic/pull/6223
- 🐛 Fix crash on serializing a union of RootModel and BaseModel by @lig in https://github.com/pydantic/pydantic/pull/6201
- Run docstring tests by @dmontagu in https://github.com/pydantic/pydantic/pull/6175
- Add documentation for PlainSerializer and WrapSerializer by @tpdorsey in https://github.com/pydantic/pydantic/pull/6230
- Improve mypy documentation by @hramezani in https://github.com/pydantic/pydantic/pull/6226
- 🚸 Improve error message when BaseSettings is imported by @Kludex in https://github.com/pydantic/pydantic/pull/6229
- correct deprecation warning for parse_file by @davidhewitt in https://github.com/pydantic/pydantic/pull/6228
- Update migration docs to include a note about
parse_env_varremoval by @hramezani in https://github.com/pydantic/pydantic/pull/6235 - Add warning about datamodel-code-generator to docs by @hramezani in https://github.com/pydantic/pydantic/pull/6236
- PYD-124: improve docs for
__get_pydantic_core_schema__by @adriangb in https://github.com/pydantic/pydantic/pull/6224 - Minor edits from review of Enum docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/6238
- Update and consolidate links in number types by @tpdorsey in https://github.com/pydantic/pydantic/pull/6239
- Update V2 vs V1 section in README.md by @adriangb in https://github.com/pydantic/pydantic/pull/6242
- Add type key to enums by @adriangb in https://github.com/pydantic/pydantic/pull/6243
- 🐛 Restrict range on Python version for
_make_forward_refby @Kludex in https://github.com/pydantic/pydantic/pull/6246 - 💚 Add timeout on
publish_docsjob by @Kludex in https://github.com/pydantic/pydantic/pull/6247 - 👷 Enable FastAPI tests by @Kludex in https://github.com/pydantic/pydantic/pull/6249
- docs: use pydanticcore.pyi as only docs source for now by @davidhewitt in https://github.com/pydantic/pydantic/pull/6257
- Reorder basemodel methods by @dmontagu in https://github.com/pydantic/pydantic/pull/6260
- Improve file type docs by @hramezani in https://github.com/pydantic/pydantic/pull/6252
- 🔧 Add
assigneeslist to the hooky config by @lig in https://github.com/pydantic/pydantic/pull/6264 - Document "wrap" validators by @tpdorsey in https://github.com/pydantic/pydantic/pull/6258
- Update validate_call documentation by @tpdorsey in https://github.com/pydantic/pydantic/pull/6255
- 📝 Update docs about hypothesis by @Kludex in https://github.com/pydantic/pydantic/pull/6266
- Update docs for validation errors by @dmontagu in https://github.com/pydantic/pydantic/pull/6262
- 📝 Improve docstrings on
json_schema.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6267 - Update internal links to be compatible with versions by @tpdorsey in https://github.com/pydantic/pydantic/pull/6271
- Update pydantic-core to 0.42.0 by @adriangb in https://github.com/pydantic/pydantic/pull/6272
- 📝 Add documentation on Special Types by @Kludex in https://github.com/pydantic/pydantic/pull/6269
- Fix deduplication of Enum refs in CoreSchema by @adriangb in https://github.com/pydantic/pydantic/pull/6274
- 🔥 Remove
finalkeyword fromFieldby @Kludex in https://github.com/pydantic/pydantic/pull/6284 - Fix relative links for logos by @tpdorsey in https://github.com/pydantic/pydantic/pull/6285
- 🐛 Fix
TypeErroron mixed discriminated unions by @lig in https://github.com/pydantic/pydantic/pull/6282 - Defer building discriminated unions until after all schemas are defined by @adriangb in https://github.com/pydantic/pydantic/pull/6288
- Update the return type for RootModel.model_dump and document how to override it by @dmontagu in https://github.com/pydantic/pydantic/pull/6290
- 🐛 Fix
RootModel.construct()andRootModel.__init__()results aren't equal by @lig in https://github.com/pydantic/pydantic/pull/6283 - Improve the rendering of the conversion table by @dmontagu in https://github.com/pydantic/pydantic/pull/6275
- Fix privateattr clobbering classvars with future annotations by @dmontagu in https://github.com/pydantic/pydantic/pull/6287
- Add documentation of Strict Mode by @dmontagu in https://github.com/pydantic/pydantic/pull/6276
- 💥 Use custom
PydanticDeprecationWarningwarning instead of the generic one by @lig in https://github.com/pydantic/pydantic/pull/6180 - PYD-140: Fix
use_enum_valuesconfig flag by @adriangb in https://github.com/pydantic/pydantic/pull/6294 - PYD-142: Fix use of Annotated + Field for dataclasses by @adriangb in https://github.com/pydantic/pydantic/pull/6293
- Add missing metadata to computed field JSON schemas by @dmontagu in https://github.com/pydantic/pydantic/pull/6299
- Move export_models to serialization by @tpdorsey in https://github.com/pydantic/pydantic/pull/6303
- Review custom types by @tpdorsey in https://github.com/pydantic/pydantic/pull/6292
- Improve types dict mapping doc by @hramezani in https://github.com/pydantic/pydantic/pull/6265
- Change mypy tests to put comments in-line in a python module by @dmontagu in https://github.com/pydantic/pydantic/pull/6305
- Update installation for release by @tpdorsey in https://github.com/pydantic/pydantic/pull/6289
- Blog and announce bar for v2 release by @tpdorsey in https://github.com/pydantic/pydantic/pull/6291
- Review and update Standard Types by @tpdorsey in https://github.com/pydantic/pydantic/pull/6240
- Update Pydantic V1 to 1.10.10 by @hramezani in https://github.com/pydantic/pydantic/pull/6311
- Document validation context, and fix up some other issues with validators.md by @dmontagu in https://github.com/pydantic/pydantic/pull/6256
- adding page about version compatibility by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6309
- 📝 Add note about page not up-to-date by @Kludex in https://github.com/pydantic/pydantic/pull/6312
- pydantic-core 2.0.1 by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6310
- Update mypy plugin by @dmontagu in https://github.com/pydantic/pydantic/pull/6306
- PYD-131 Links between API and usage docs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6307
- Remove warning on top of
docs/usage/types/callables.mdby @hramezani in https://github.com/pydantic/pydantic/pull/6318 - Index improvements by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6314
- Prepare for release by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6319
New Contributors
- @davidhewitt made their first contribution in https://github.com/pydantic/pydantic/pull/6228
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0b3...v2.0
- Python
Published by samuelcolvin almost 3 years ago
pydantic - V1.10.10
What's Changed
- Fix racy doctests by @K900 in https://github.com/pydantic/pydantic/pull/6103
- ✅ Update FastAPI test script by @Kludex in https://github.com/pydantic/pydantic/pull/6117
- add roadmap to annoucement by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6120
- Fixed literal validator errors for unhashable values by @markus1978 in https://github.com/pydantic/pydantic/pull/6194
- Bug fix for forward refs in generics by @mark-todd in https://github.com/pydantic/pydantic/pull/6157
- Add Pydantic
Jsonfield support to settings management by @hramezani in https://github.com/pydantic/pydantic/pull/6250
New Contributors
- @K900 made their first contribution in https://github.com/pydantic/pydantic/pull/6103
- @markus1978 made their first contribution in https://github.com/pydantic/pydantic/pull/6194
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.9...v1.10.10
- Python
Published by hramezani almost 3 years ago
pydantic - v2.0b3 2023-06-16
What's Changed
- Fix SchemaError when multiple computed fields point to the same type by @adriangb in https://github.com/pydantic/pydantic/pull/5987
- Fix bug in BaseModel signature generation when a field uses Annotated by @adriangb in https://github.com/pydantic/pydantic/pull/5990
- Fix json schema for single empty tuple by @adriangb in https://github.com/pydantic/pydantic/pull/5988
- Fix testextrausedasenum to use pytest.warns() by @mgorny in https://github.com/pydantic/pydantic/pull/5994
- Improve test coverage of pydantic.internal.typing_extra by @hramezani in https://github.com/pydantic/pydantic/pull/5978
- 🗑️ Deprecate
ColorandPaymentCardNumberby @Kludex in https://github.com/pydantic/pydantic/pull/6003 - Allow
__pydantic_config__to be used on vanilla dataclasses by @adriangb in https://github.com/pydantic/pydantic/pull/6008 - Give nicer error when using a bare root_validator by @dmontagu in https://github.com/pydantic/pydantic/pull/6009
- Fix bug with model_construct when extra=allow by @dmontagu in https://github.com/pydantic/pydantic/pull/6012
- 👷 Add mkdocs-material-insiders to pipeline by @Kludex in https://github.com/pydantic/pydantic/pull/6014
- Add more types to conversion table by @hramezani in https://github.com/pydantic/pydantic/pull/6005
- 📝 Add documentation for
model_configby @Kludex in https://github.com/pydantic/pydantic/pull/6021 - 📦 Import
RootModeldynamically when accessed directly only by @lig in https://github.com/pydantic/pydantic/pull/5951 - 🐛 Fix aliases priority by @Kludex in https://github.com/pydantic/pydantic/pull/6023
- Improve usage models doc by @hramezani in https://github.com/pydantic/pydantic/pull/6019
- 📝 Add documentation for
PhoneNumberandABARoutingNumberby @Kludex in https://github.com/pydantic/pydantic/pull/6031 - Improve docs/usage/exporting_models doc by @hramezani in https://github.com/pydantic/pydantic/pull/6030
- 📝 Include API documentation for
pydantic-settingsby @Kludex in https://github.com/pydantic/pydantic/pull/6035 - Fix api links in docs by @hramezani in https://github.com/pydantic/pydantic/pull/6036
- 💚 Remove installation of
mkdocs-material-insiderson forks by @Kludex in https://github.com/pydantic/pydantic/pull/6037 - Add tests for mypy inspection of metaclass arguments by @cpratt34 in https://github.com/pydantic/pydantic/pull/5982
- Sort produced json schemas by @adriangb in https://github.com/pydantic/pydantic/pull/6043
- Add 1.10 releases to HISTORY.md by @hramezani in https://github.com/pydantic/pydantic/pull/6044
- Improve docs/usage/dataclasses.md by @hramezani in https://github.com/pydantic/pydantic/pull/6046
- 📝 Reference
ConfigDictAPI documentation frommodel_config.mdby @Kludex in https://github.com/pydantic/pydantic/pull/6047 - 📝 Update
postponed_annotations.mddocumentation by @Kludex in https://github.com/pydantic/pydantic/pull/6048 - 📝 Add API documentation for
pydantic-extra-typesby @Kludex in https://github.com/pydantic/pydantic/pull/6050 - 📝 Add docstrings for top level modules by @Kludex in https://github.com/pydantic/pydantic/pull/6053
- 📝 Update documentation for the color module by @Kludex in https://github.com/pydantic/pydantic/pull/6057
- Update datetime.md by @Phantom1472 in https://github.com/pydantic/pydantic/pull/6061
- Add API docs file for root_model.py (issue DOC-3) by @dmontagu in https://github.com/pydantic/pydantic/pull/6060
- Improve
docs/usage/types/string_types.mdby @hramezani in https://github.com/pydantic/pydantic/pull/6058 - Minor docs improvements by @dmontagu in https://github.com/pydantic/pydantic/pull/6064
- Update dataclasses.py docstrings by @dmontagu in https://github.com/pydantic/pydantic/pull/6065
- Docstring formatting fixes for dataclasses and functional_validators by @tpdorsey in https://github.com/pydantic/pydantic/pull/6063
- Add
pydocstyleruff rules by @Kludex in https://github.com/pydantic/pydantic/pull/6067 - Specify members to appear in documentation for pydantic_core by @tpdorsey in https://github.com/pydantic/pydantic/pull/6062
- 📝 Update docstings on
networks.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6069 - 📝 Add docstrings on
version.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6070 - 📝 Update
install.mddocumentation by @Kludex in https://github.com/pydantic/pydantic/pull/6071 - Create
fields.mdon the documentation by @Kludex in https://github.com/pydantic/pydantic/pull/6072 - Fix broken and incorrectly formatting internal links by @tpdorsey in https://github.com/pydantic/pydantic/pull/6075
- Document docstring requirements with examples by @tpdorsey in https://github.com/pydantic/pydantic/pull/6081
- ✅ Update installation of FastAPI for tests by @tiangolo in https://github.com/pydantic/pydantic/pull/6084
- Improve config docstring by @hramezani in https://github.com/pydantic/pydantic/pull/6066
- Allow applying serializers and constraints to named/ref schemas by @adriangb in https://github.com/pydantic/pydantic/pull/6007
- Improve
pydantic/_internal/_annotated_handlers.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6086 - 🔥 Remove Google Analytics by @Kludex in https://github.com/pydantic/pydantic/pull/6087
- 📝 Add docstrings for
functional_serializers.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6092 - Update datetime usage docs by @dmontagu in https://github.com/pydantic/pydantic/pull/6077
- Update Pydantic V1 to 1.10.9 by @hramezani in https://github.com/pydantic/pydantic/pull/6093
- Replace pydantic with Pydantic in docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/6097
- Improve
docs/usage/errors.mddocs by @hramezani in https://github.com/pydantic/pydantic/pull/6098 - 📝 Add docstrings to
types.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6091 - 📝 Improve
fields.pydocstring by @Kludex in https://github.com/pydantic/pydantic/pull/6088 - ♻️ Remove
SecretFieldfrom public API by @Kludex in https://github.com/pydantic/pydantic/pull/6094 - Update generic custom type example in
docs/usage/types/custom.mdby @adriangb in https://github.com/pydantic/pydantic/pull/5935 - Update pydantic-core by @adriangb in https://github.com/pydantic/pydantic/pull/5958
- Fix
__get_pydantic_core_schema__for Enum by @adriangb in https://github.com/pydantic/pydantic/pull/6100 - Improve
pydantic/_internal/_dataclasses.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6105 - Replace
deprecated-kwargswithremoved-kwargsby @hramezani in https://github.com/pydantic/pydantic/pull/6107 - 📝 Improve "Config Model" documentation by @Kludex in https://github.com/pydantic/pydantic/pull/6108
- 📝 Add docstrings to
type_adapter.pyby @Kludex in https://github.com/pydantic/pydantic/pull/6109 - 📝 Move "Arbitrary Types Allowed" section to "Model Config" page by @Kludex in https://github.com/pydantic/pydantic/pull/6110
- Simplify our usage of
handler.generate_schema()to simplify explaining it in the docs by @adriangb in https://github.com/pydantic/pydantic/pull/6102 - Improve
pydantic/_internal/_core_metadata.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6089 - Improve
pydantic/_internal/_decorators.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6114 - Fix typo in errors doc by @hramezani in https://github.com/pydantic/pydantic/pull/6118
- add road-map to annoucement bar by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6119
- Document the behavior of non-hashable default values by @dmontagu in https://github.com/pydantic/pydantic/pull/6122
- Fix extra fields behavior for TypedDict and make additionalProperties explicit in JSON schema by @adriangb in https://github.com/pydantic/pydantic/pull/6115
- Skip test
test_del_model_attr_errorto run on PyPy < 3.9 by @hramezani in https://github.com/pydantic/pydantic/pull/6131 - Update docs related to postponed annotations by @dmontagu in https://github.com/pydantic/pydantic/pull/6123
- Improve documentation related to model_construct by @dmontagu in https://github.com/pydantic/pydantic/pull/6121
- Revert "Skip test
test_del_model_attr_errorto run on PyPy < 3.9 (#6131)" by @hramezani in https://github.com/pydantic/pydantic/pull/6133 - 📝 Add documentation about
model_configinheritance by @Kludex in https://github.com/pydantic/pydantic/pull/6132 - Make it work when using a type annotation on the
model_configby @dmontagu in https://github.com/pydantic/pydantic/pull/6136 - 📝 Add documentation about
AliasPathandAliasChoicesby @Kludex in https://github.com/pydantic/pydantic/pull/6129 - Improve
pydantic/_internal/_decorators_v1.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6128 - Remove default factory call results from the JSON schema by @dmontagu in https://github.com/pydantic/pydantic/pull/6126
- Improve
pydantic/_internal/_discriminated_union.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6134 - Landing page fix links and minor edits by @tpdorsey in https://github.com/pydantic/pydantic/pull/6074
- Improve the regex used for NameEmail validation by @dmontagu in https://github.com/pydantic/pydantic/pull/6125
- Docs updates for type adapter by @tpdorsey in https://github.com/pydantic/pydantic/pull/6052
- Update documentation about exporting models by @dmontagu in https://github.com/pydantic/pydantic/pull/6078
- 📝 Update
union.mddocumentation by @Kludex in https://github.com/pydantic/pydantic/pull/6055 - Update booleans.md and bytesize.md by @dmontagu in https://github.com/pydantic/pydantic/pull/6076
- 🐛 Remove dataclass field with
init_varfrom__pydantic__fields__by @Kludex in https://github.com/pydantic/pydantic/pull/6141 - Improve
pydantic/_internal/_fields.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6138 - Fix typo in
pydantic._internal._fieldsby @Viicos in https://github.com/pydantic/pydantic/pull/6148 - Skip
test_del_model_attr_erroron PyPy by @hramezani in https://github.com/pydantic/pydantic/pull/6153 - 💡 Update links to RootModel docs section everywhere by @lig in https://github.com/pydantic/pydantic/pull/6154
- Remove not needed code from
pydantic/_internal/_forward_ref.pyby @hramezani in https://github.com/pydantic/pydantic/pull/6146 - Improve
pydantic/_internal/_known_annotated_metadata.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6155 - Improve
pydantic/_internal/_generics.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6151 - 🐛 Fix RootModel json schema meta info by @lig in https://github.com/pydantic/pydantic/pull/6104
- Fix definitions unpacking and registering when building a schema that uses a model by @adriangb in https://github.com/pydantic/pydantic/pull/6144
- Add additional links and notes regarding extra types by @tpdorsey in https://github.com/pydantic/pydantic/pull/6160
- PYD-92: Add custom type docs for Annotated and TypeAliasType by @adriangb in https://github.com/pydantic/pydantic/pull/6161
- DOC-104: add note about preserving input types to migration guide by @adriangb in https://github.com/pydantic/pydantic/pull/6135
- Add SerializeAsAny for opt-in duck typed serialization by @adriangb in https://github.com/pydantic/pydantic/pull/6162
- Improve
pydantic/_internal/_generate_schema.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6149 - Improve
pydantic/_internal/_internal_dataclass.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6152 - correct
PrivateAttrdocs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/6164 - Allow setting type for values in
__pydantic_extra__by @adriangb in https://github.com/pydantic/pydantic/pull/6139 - Improve
pydantic/_internal/_model_construction.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6166 - Improve
pydantic/_internal/_schema_generation_shared.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6168 - Improve
pydantic/functional_validators.pydocstring by @hramezani in https://github.com/pydantic/pydantic/pull/6169 - ✅ Try reproducing rebuilding recursive schema with a ForwardRef by @lig in https://github.com/pydantic/pydantic/pull/6159
- Make unannotated private attrs into private attrs by @dmontagu in https://github.com/pydantic/pydantic/pull/6111
- Add Examples annotation and re-organize existing annotations by @adriangb in https://github.com/pydantic/pydantic/pull/6174
- Improve
pydantic/main.pydocstrings by @hramezani in https://github.com/pydantic/pydantic/pull/6173 - V2 migration guide updates by @dmontagu in https://github.com/pydantic/pydantic/pull/6006
- 📝 Improve documentation on
fields.mdby @Kludex in https://github.com/pydantic/pydantic/pull/6137 - Prepare for v2.0b3 by @dmontagu in https://github.com/pydantic/pydantic/pull/6176
New Contributors
- @mgorny made their first contribution in https://github.com/pydantic/pydantic/pull/5994
- @cpratt34 made their first contribution in https://github.com/pydantic/pydantic/pull/5982
- @Phantom1472 made their first contribution in https://github.com/pydantic/pydantic/pull/6061
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0b2...v2.0b3
- Python
Published by dmontagu almost 3 years ago
pydantic - V1.10.9
What's Changed
- Add Pydantic classifier by @hramezani in https://github.com/pydantic/pydantic/pull/5847
- 📌 Use Cython < v3 by @lig in https://github.com/pydantic/pydantic/pull/5845
- [cherry-pick] Fix mypy plugin for 1.4.0 (#5927) by @cdce8p in https://github.com/pydantic/pydantic/pull/5928
- Add future and past date hypothesis strategies by @bschoenmaeckers in https://github.com/pydantic/pydantic/pull/5850
- [Backport] Fix Decimal trailing zero handling by @hramezani in https://github.com/pydantic/pydantic/pull/5968
- Prepare for 1.10.9 by @hramezani in https://github.com/pydantic/pydantic/pull/6034
New Contributors
- @bschoenmaeckers made their first contribution in https://github.com/pydantic/pydantic/pull/5850
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.8...v1.10.9
- Python
Published by hramezani almost 3 years ago
pydantic - v2.0b2 2023-06-03
What's Changed
- Improve test coverage for pydantic.dataclasses by @hramezani in https://github.com/pydantic/pydantic/pull/5973
- ✅ Improve coverage for
pydantic/main.pyby @lig in https://github.com/pydantic/pydantic/pull/5977 - Increase coverage for
_generate_schema.pyby @Kludex in https://github.com/pydantic/pydantic/pull/5966 - Docstrings for main by @tpdorsey in https://github.com/pydantic/pydantic/pull/5976
- Increase coverage for
_generate_schema.pyby @Kludex in https://github.com/pydantic/pydantic/pull/5975 - Add
from_attributestoTypeAdapter.validate_pythonby @adriangb in https://github.com/pydantic/pydantic/pull/5983 - Add
from_attributestoBaseModel.validate_pythonby @adriangb in https://github.com/pydantic/pydantic/pull/5985 - Prepare for v2.0b2 by @adriangb in https://github.com/pydantic/pydantic/pull/5986
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0b1...v2.0b2
- Python
Published by adriangb almost 3 years ago
pydantic - v2.0b1 2023-06-01
What's Changed
- Replace deprecated
validatorusage by @Viicos in https://github.com/pydantic/pydantic/pull/5712 - Use
typing.Selffor@classmethodconstructors by @Viicos in https://github.com/pydantic/pydantic/pull/5713 - Improve usage errors by @hramezani in https://github.com/pydantic/pydantic/pull/5699
- ⚡ Speedup
ModelPrivateAttrby @lig in https://github.com/pydantic/pydantic/pull/5709 - Updates model docstrings by @tpdorsey in https://github.com/pydantic/pydantic/pull/5715
- Re-organize exports for new validators and serializers by @adriangb in https://github.com/pydantic/pydantic/pull/5641
- Replace TypeError with ValidationError in forzen model by @hramezani in https://github.com/pydantic/pydantic/pull/5717
- ✅ Improve internal validators test coverage by @lig in https://github.com/pydantic/pydantic/pull/5700
- Generate separate JSON schema for inputs vs. outputs by @dmontagu in https://github.com/pydantic/pydantic/pull/5707
- Add PastDatetime and FutureDatetime types by @hramezani in https://github.com/pydantic/pydantic/pull/5720
- Uprev pydantic-core to 0.31.0 by @adriangb in https://github.com/pydantic/pydantic/pull/5727
- Fix typo in error message by @hramezani in https://github.com/pydantic/pydantic/pull/5734
- Fix use of None as type of private attribute by @dmontagu in https://github.com/pydantic/pydantic/pull/5735
- Models usage docs revisions by @tpdorsey in https://github.com/pydantic/pydantic/pull/5738
- Don't try to automatically handle subclasses of known types by @adriangb in https://github.com/pydantic/pydantic/pull/5737
- ✅ Improve test coverage by @lig in https://github.com/pydantic/pydantic/pull/5710
- Improve validation errors doc by @hramezani in https://github.com/pydantic/pydantic/pull/5733
- Make usage errors code blocks testable. by @hramezani in https://github.com/pydantic/pydantic/pull/5743
- Respect config.alias_generator in pydantic dataclass by @hramezani in https://github.com/pydantic/pydantic/pull/5673
- Fix typo in error code by @hramezani in https://github.com/pydantic/pydantic/pull/5748
- updates to errors and fields docstrings by @tpdorsey in https://github.com/pydantic/pydantic/pull/5746
- correct deprecated warning message in copyandsetvalues method by @rmargar in https://github.com/pydantic/pydantic/pull/5753
- ✅ Improve test coverage by @lig in https://github.com/pydantic/pydantic/pull/5742
- Eliminate the undefined types warning by @dmontagu in https://github.com/pydantic/pydantic/pull/5754
- Fixes typo in documentation by @halfdanrump in https://github.com/pydantic/pydantic/pull/5756
- Do not try to automatically handle subclasses of mappings by @adriangb in https://github.com/pydantic/pydantic/pull/5744
- Add
ligto the reviewers list by @lig in https://github.com/pydantic/pydantic/pull/5759 - Generate JSON schema for Sequence[T] as though it was List[T] by @dmontagu in https://github.com/pydantic/pydantic/pull/5706
- Remove xfail from
tests.test_edge_cases.test_custom_generic_validatorsby @dmontagu in https://github.com/pydantic/pydantic/pull/5764 - Add pydantic-settings test to CI by @hramezani in https://github.com/pydantic/pydantic/pull/5758
- stop BaseModel inheriting from
_repr.Representationby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5740 - Edits for Usage Error documentation by @tpdorsey in https://github.com/pydantic/pydantic/pull/5774
- Add protected namespaces by @hramezani in https://github.com/pydantic/pydantic/pull/5768
- More docstrings edits - json schema and functional serializers by @tpdorsey in https://github.com/pydantic/pydantic/pull/5762
- add api docs for pydantic-core by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5695
- Remove dead code by @adriangb in https://github.com/pydantic/pydantic/pull/5775
- Copy edits for validation errors by @tpdorsey in https://github.com/pydantic/pydantic/pull/5777
- 🔥 Remove
_base_class_definedhack in favor of an empty bases check by @lig in https://github.com/pydantic/pydantic/pull/5761 - Support recursive dataclasses by @dmontagu in https://github.com/pydantic/pydantic/pull/5760
- Update typo in computed_fields.md by @john-g-g in https://github.com/pydantic/pydantic/pull/5786
- Use uvicorn-style strings for ImportString by @dmontagu in https://github.com/pydantic/pydantic/pull/5776
- Add v1 namespace inside pydantic by @hramezani in https://github.com/pydantic/pydantic/pull/5780
- Add a convenience type to override JSON schema by @dmontagu in https://github.com/pydantic/pydantic/pull/5788
- Add a signature for init_subclass to typecheck class kwargs by @dmontagu in https://github.com/pydantic/pydantic/pull/5791
- BaseModel class attributes documented by @tpdorsey in https://github.com/pydantic/pydantic/pull/5787
- Add note about dynamically created model pickling by @hramezani in https://github.com/pydantic/pydantic/pull/5781
- Do not inherit config in model fields that are themselves of type model by @dmontagu in https://github.com/pydantic/pydantic/pull/5793
- Replace class Config with model_config by @hramezani in https://github.com/pydantic/pydantic/pull/5799
- Uprev pydantic-core to 0.32.0 by @adriangb in https://github.com/pydantic/pydantic/pull/5805
- Make decoratorinfos attributes plural by @dmontagu in https://github.com/pydantic/pydantic/pull/5802
- Rework
__prepare_pydantic_annotations__to make it easier to wrap "known" types by @adriangb in https://github.com/pydantic/pydantic/pull/5801 - Remove various TODO comments by @dmontagu in https://github.com/pydantic/pydantic/pull/5806
- Address more todo comments by @dmontagu in https://github.com/pydantic/pydantic/pull/5809
- Add annotation that lets you skip validation by @dmontagu in https://github.com/pydantic/pydantic/pull/5583
- ✨ Add
RootModelsupport by @lig in https://github.com/pydantic/pydantic/pull/5765 - Fix some issues with pydantic extra by @dmontagu in https://github.com/pydantic/pydantic/pull/5810
- Move error handling to Error Messages by @tpdorsey in https://github.com/pydantic/pydantic/pull/5794
- Fix json type json schema test by @dmontagu in https://github.com/pydantic/pydantic/pull/5808
- Fix tests for create_model title and description by @hramezani in https://github.com/pydantic/pydantic/pull/5796
- Improve typechecking, docs, and minor bugs with Field/FieldInfo by @dmontagu in https://github.com/pydantic/pydantic/pull/5800
- Add a convenience type for transforming a core schema via annotation by @dmontagu in https://github.com/pydantic/pydantic/pull/5819
- see what happens with cf pages by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5828
- Do not automatically handle subclasses of Iterable by @dmontagu in https://github.com/pydantic/pydantic/pull/5834
- Improve contribution guidelines by @tpdorsey in https://github.com/pydantic/pydantic/pull/5817
- Use alias generator with computed fields by @dmontagu in https://github.com/pydantic/pydantic/pull/5836
- Address root model feedback by @dmontagu in https://github.com/pydantic/pydantic/pull/5820
- Ignore pytest warnings on 3.12 by @JelleZijlstra in https://github.com/pydantic/pydantic/pull/5849
- Change pydantic to be compatible with typing-extension==4.6.1 by @hramezani in https://github.com/pydantic/pydantic/pull/5843
- Add note about V1 PRs by @tpdorsey in https://github.com/pydantic/pydantic/pull/5855
- Fix bug partial get core schema by @adriangb in https://github.com/pydantic/pydantic/pull/5856
- Revise documentation landing page by @tpdorsey in https://github.com/pydantic/pydantic/pull/5835
- Add Kludex to reviewer list by @Kludex in https://github.com/pydantic/pydantic/pull/5862
- Use
durationinstead oftime-deltatype fortimedeltaon JSON schema by @Kludex in https://github.com/pydantic/pydantic/pull/5864 - Add InstanceOf type/annotation by @dmontagu in https://github.com/pydantic/pydantic/pull/5778
- Update pydantic-core to 0.34.0 by @adriangb in https://github.com/pydantic/pydantic/pull/5860
- Add a test demonstrating initvar works with inheritance by @dmontagu in https://github.com/pydantic/pydantic/pull/5859
- Disallow non-nested types as non-annotated values by @dmontagu in https://github.com/pydantic/pydantic/pull/5869
- Handle validators on vanilla dataclass fields by @dmontagu in https://github.com/pydantic/pydantic/pull/5857
- Refactor handling of Enum and IP types to homogenize known type handling by @adriangb in https://github.com/pydantic/pydantic/pull/5837
- move
ModelMetaclassto_internal._model_constructionby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5865 - Fix kw_only inheritance by @dmontagu in https://github.com/pydantic/pydantic/pull/5873
- ⚡ Optimize kw_only inheritance by @lig in https://github.com/pydantic/pydantic/pull/5878
- Fix dataclass stuff by @dmontagu in https://github.com/pydantic/pydantic/pull/5874
- Update pydantic-core to 0.35.0 by @hramezani in https://github.com/pydantic/pydantic/pull/5846
- Ensure
__get_pydantic_json_schema__always gets the schema passed down from a wrapping handler by @adriangb in https://github.com/pydantic/pydantic/pull/5876 - Add hideinputin_errors config by @hramezani in https://github.com/pydantic/pydantic/pull/5879
- ✅ Improve test coverage by @lig in https://github.com/pydantic/pydantic/pull/5885
- 🐛 Config option
allow_inf_nandoesn't work forDecimalby @lig in https://github.com/pydantic/pydantic/pull/5868 - Allow
__prepare_pydantic_annotations__to exist without__get_pydantic_core_schema__by @adriangb in https://github.com/pydantic/pydantic/pull/5886 - Bump pyright to 1.1.310 by @adriangb in https://github.com/pydantic/pydantic/pull/5887
- Fix botched merge, cleanup unused code by @adriangb in https://github.com/pydantic/pydantic/pull/5888
- prevent
_internalobjects becoming public by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5892 - Use
__pydantic_private__for storing private attributes by @dmontagu in https://github.com/pydantic/pydantic/pull/5891 - fixing xfails by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5894
- Fix
@model_validatoron nested models by @adriangb in https://github.com/pydantic/pydantic/pull/5889 - Complete ConfigWrapper test coverage by @hramezani in https://github.com/pydantic/pydantic/pull/5900
- ✅ Improve test coverage by @lig in https://github.com/pydantic/pydantic/pull/5895
- Update typing-extensions to 4.6.1 by @adriangb in https://github.com/pydantic/pydantic/pull/5901
- Enforce constraints on arbitrary types via functional validators by @adriangb in https://github.com/pydantic/pydantic/pull/5883
- Add validators for TypedDict by @adriangb in https://github.com/pydantic/pydantic/pull/5877
- Add test for default values in annotated schema by @adriangb in https://github.com/pydantic/pydantic/pull/5902
- Uprev pydantic-core to 0.37.0 by @adriangb in https://github.com/pydantic/pydantic/pull/5905
- 🐛 Fix
AttributeErroron deleting a field of a Model having aPrivateAttrdefined by @lig in https://github.com/pydantic/pydantic/pull/5897 - 💚 Move email tests to "tests with deps" job by @lig in https://github.com/pydantic/pydantic/pull/5904
- Move model before validators by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5898
- Feat/serialize import string by @ybressler in https://github.com/pydantic/pydantic/pull/5841
- remove xfails from docs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5910
- add compatibility shim for
__fields__->model_fieldsby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5912 - improve coverage in main.py by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5913
- Complete test coverage pydantic/internal/serializers.py by @hramezani in https://github.com/pydantic/pydantic/pull/5915
- Add
lenient_issubclassandlenient_isinstancetoDEPRECATED_MOVED_IN_V2by @Kludex in https://github.com/pydantic/pydantic/pull/5916 - Improve test coverage for pydantic.internal.utils by @hramezani in https://github.com/pydantic/pydantic/pull/5917
- Add most used imports to
DEPRECATED_MOVED_IN_V2by @Kludex in https://github.com/pydantic/pydantic/pull/5926 - Hide pydantic_* from @dataclass_transform by @dmontagu in https://github.com/pydantic/pydantic/pull/5923
- Fix mypy plugin for 1.4.0 by @cdce8p in https://github.com/pydantic/pydantic/pull/5927
- Improve test coverage for pydantic.internal.core_metadata by @hramezani in https://github.com/pydantic/pydantic/pull/5933
- support for
return_schemaon functional serializers by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5920 - Support TypeAliasType for generic and recursive type aliases by @adriangb in https://github.com/pydantic/pydantic/pull/5861
- fix datetime parsing tests by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5938
- Logo grid for pydantic users by @tpdorsey in https://github.com/pydantic/pydantic/pull/5880
- Disallow passing config to TypeAdapter for models and implement config for TypedDict by @adriangb in https://github.com/pydantic/pydantic/pull/5939
- fix dataclasses, uprev pydantic-core by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5942
- Improve test coverage for pydantic.type_adapter by @hramezani in https://github.com/pydantic/pydantic/pull/5930
- Improve test coverage of pydantic.internal.core_utils by @hramezani in https://github.com/pydantic/pydantic/pull/5936
- Update docstrings - errors through functional serializers by @tpdorsey in https://github.com/pydantic/pydantic/pull/5940
- ✅ More
RootModeltests by @lig in https://github.com/pydantic/pydantic/pull/5943 - Improve test coverage for pydantic.types by @hramezani in https://github.com/pydantic/pydantic/pull/5950
- Update docstrings - alias_generators through dataclasses by @tpdorsey in https://github.com/pydantic/pydantic/pull/5932
- Make instanceof schema work with arbitrary types by @dmontagu in https://github.com/pydantic/pydantic/pull/5947
- Improve test coverage for pydantic.functional_validator by @hramezani in https://github.com/pydantic/pydantic/pull/5955
- 🐛 Fix
RootModelequality logic by @lig in https://github.com/pydantic/pydantic/pull/5948 - Increase coverage for
json_schema.pyby @Kludex in https://github.com/pydantic/pydantic/pull/5934 - Improve test coverage for pydantic._migration by @hramezani in https://github.com/pydantic/pydantic/pull/5964
- Increase coverage for
json_schema.pyby @Kludex in https://github.com/pydantic/pydantic/pull/5963 - Move
pydantic.annotatedto top level by @adriangb in https://github.com/pydantic/pydantic/pull/5954 - Rename old analyzed type variables name in test by @hramezani in https://github.com/pydantic/pydantic/pull/5965
- Fix Decimal trailing zero handling by @hramezani in https://github.com/pydantic/pydantic/pull/5962
- Docstrings updates for validation by @tpdorsey in https://github.com/pydantic/pydantic/pull/5967
- Prepare for Beta 1 release by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5969
New Contributors
- @Viicos made their first contribution in https://github.com/pydantic/pydantic/pull/5712
- @rmargar made their first contribution in https://github.com/pydantic/pydantic/pull/5753
- @halfdanrump made their first contribution in https://github.com/pydantic/pydantic/pull/5756
- @john-g-g made their first contribution in https://github.com/pydantic/pydantic/pull/5786
- @JelleZijlstra made their first contribution in https://github.com/pydantic/pydantic/pull/5849
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0a4...v2.0b1
- Python
Published by adriangb almost 3 years ago
pydantic - v1.10.8 2023-05-23
What's Changed
- Fix a bug in
Literalusage withtyping-extension==4.6.0, #5826 by @hramezani - This solves the (closed) issue #3849 where aliased fields that use discriminated union fail to validate when the data contains the non-aliased field name, #5736 by @benwah
- Update email-validator dependency to >=2.0.0post2, #5627 by @adriangb
- update
AnyClassMethodfor changes in python/typeshed#9771, #5505 by @ITProKyle
New Contributors
- @DimitriPapadopoulos made their first contribution in https://github.com/pydantic/pydantic/pull/5375
- @ITProKyle made their first contribution in https://github.com/pydantic/pydantic/pull/5505
- @benwah made their first contribution in https://github.com/pydantic/pydantic/pull/5736
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.7...v1.10.8
- Python
Published by dmontagu about 3 years ago
pydantic - v2.0a4 2023-05-05
What's Changed
- Add
pydantic.typing.evaluate_forwardrefon the REMOVEDINV2 list by @Kludex in https://github.com/pydantic/pydantic/pull/5559 - Move types documentation to usage/types and fix links by @tpdorsey in https://github.com/pydantic/pydantic/pull/5556
- Fix bug caused by builtin generics not converting str to ForwardRef by @dmontagu in https://github.com/pydantic/pydantic/pull/5554
- Add docstrings for decorators.py by @tpdorsey in https://github.com/pydantic/pydantic/pull/5565
- Bump typing-extensions minimum version to 4.5.0 by @KanchiShimono in https://github.com/pydantic/pydantic/pull/5552
- Add test for validate_call by @hramezani in https://github.com/pydantic/pydantic/pull/5574
- Fix reviewer name on pyproject.toml by @Kludex in https://github.com/pydantic/pydantic/pull/5577
- test for allow info with
Decimalby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5585 - raise
TypeErrorinFieldandPrivateAttrby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5587 - Use only relative imports by @Kludex in https://github.com/pydantic/pydantic/pull/5576
- Change bare-enum behavior for strict json by @adriangb in https://github.com/pydantic/pydantic/pull/5591
- Json schema modify function as middleware by @adriangb in https://github.com/pydantic/pydantic/pull/5570
- Fix bug with recursive models with multiple references to the same type by @dmontagu in https://github.com/pydantic/pydantic/pull/5555
- Add a test for validation using context by @dmontagu in https://github.com/pydantic/pydantic/pull/5593
- Support UUID serialization to JSON by @Kludex in https://github.com/pydantic/pydantic/pull/5564
- Minor formatting fixes in docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/5575
- Add test that proves order is preserved by @Kludex in https://github.com/pydantic/pydantic/pull/5600
- Uprev pydantic-core to 0.26.0 by @adriangb in https://github.com/pydantic/pydantic/pull/5602
- Support more complex typing structures with
Annotatedby @Kludex in https://github.com/pydantic/pydantic/pull/5603 - Improve consistency of error messages for Enum by @dmontagu in https://github.com/pydantic/pydantic/pull/5604
- Make it possible to have a plain BaseModel field annotation by @dmontagu in https://github.com/pydantic/pydantic/pull/5609
- Pydantic core 0.27.0 by @dmontagu in https://github.com/pydantic/pydantic/pull/5612
- Support
PathLikeby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5589 - Add test for exotic approaches to forward refs by @dmontagu in https://github.com/pydantic/pydantic/pull/5526
- Add tests for date types by @Kludex in https://github.com/pydantic/pydantic/pull/5605
- Use PDM for lockfiles & env management by @adriangb in https://github.com/pydantic/pydantic/pull/5610
- Add
datetime_parsemodule to the migration logic by @Kludex in https://github.com/pydantic/pydantic/pull/5617 - Migration notes for optional and nullable fields by @tpdorsey in https://github.com/pydantic/pydantic/pull/5618
- Fix dataclass module name by @adriangb in https://github.com/pydantic/pydantic/pull/5624
- Create a GetCoreSchemaHandler class by @adriangb in https://github.com/pydantic/pydantic/pull/5619
- Add modelvalidator to `pydantic.all_` by @dmontagu in https://github.com/pydantic/pydantic/pull/5633
- using "mike" for documenting multiple versions by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5626
- docs preview with CloudFlare pages by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5638
- port alpha release blog post by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5637
- fix blog images and devtools example by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5639
- Attempt to fix CI python versions by @dmontagu in https://github.com/pydantic/pydantic/pull/5643
- Add make help command by @dmontagu in https://github.com/pydantic/pydantic/pull/5634
- Fix double-calling of json schema funcs w/ Annotated by @adriangb in https://github.com/pydantic/pydantic/pull/5647
- remove unused info arguments from validator functions by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5653
- set URL for errors by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5655
- Add error message for
unique_itemsparameter inconlistby @Kludex in https://github.com/pydantic/pydantic/pull/5650 - Update copyonmodel_validation tests by @hramezani in https://github.com/pydantic/pydantic/pull/5658
- Add missing types docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/5616
- Error more eagerly for proper subclasses of generics that we don't know how to validate by @dmontagu in https://github.com/pydantic/pydantic/pull/5629
- Add alias generators to pydantic by @dmontagu in https://github.com/pydantic/pydantic/pull/5568
- Expand alias generator docstrings by @tpdorsey in https://github.com/pydantic/pydantic/pull/5669
- Expand validate_call docstring by @tpdorsey in https://github.com/pydantic/pydantic/pull/5670
- Remove xfail from
tests.test_edge_cases.test_int_subclassas it is expected behavior by @hramezani in https://github.com/pydantic/pydantic/pull/5665 - 🐛
Sequence[str]does not raise onstrby @lig in https://github.com/pydantic/pydantic/pull/5599 - Delegate equality checks for BaseModel by @dmontagu in https://github.com/pydantic/pydantic/pull/5662
- Pin urllib3 in CI by @adriangb in https://github.com/pydantic/pydantic/pull/5675
- Add
deprecatedonBaseModelmethods by @Kludex in https://github.com/pydantic/pydantic/pull/5646 - Fix walk and apply by @adriangb in https://github.com/pydantic/pydantic/pull/5652
- Add job to create a tweet on release by @Kludex in https://github.com/pydantic/pydantic/pull/5567
- Add support for
*tofield_validatorby @Kludex in https://github.com/pydantic/pydantic/pull/5657 - Re-add schema_extra functionality removed from config by @dmontagu in https://github.com/pydantic/pydantic/pull/5676
- Revise models docs to indicate attributes are copied for validation by @tpdorsey in https://github.com/pydantic/pydantic/pull/5632
- ✨ Add
Base64and a generalEncodedtypes by @lig in https://github.com/pydantic/pydantic/pull/5615 - Remove Kludex from hooky temporarily by @dmontagu in https://github.com/pydantic/pydantic/pull/5678
- rename tests/internal.py -> tests/test_internal.py by @adriangb in https://github.com/pydantic/pydantic/pull/5684
- Rename AnalyzedType to TypeAdapter by @hramezani in https://github.com/pydantic/pydantic/pull/5689
- Move errors docs to top nav by @tpdorsey in https://github.com/pydantic/pydantic/pull/5685
- Add
__prepare_pydantic_annotations__for custom types by @adriangb in https://github.com/pydantic/pydantic/pull/5674 - Fix botched merge w/ rename of AnalyzedType -> TypeAdapter by @adriangb in https://github.com/pydantic/pydantic/pull/5692
- Use pydantic core main by @adriangb in https://github.com/pydantic/pydantic/pull/5680
- Test: Add test for variadic generic by @caniko in https://github.com/pydantic/pydantic/pull/5625
- 🔥 Remove Hypothesis plugin for now by @lig in https://github.com/pydantic/pydantic/pull/5691
- Use pydantic_serializer for serializing Any fields by @dmontagu in https://github.com/pydantic/pydantic/pull/5578
- Add a test demonstrating how to integrate with a third-party type by @dmontagu in https://github.com/pydantic/pydantic/pull/5620
- Pydantic settings docs by @tpdorsey in https://github.com/pydantic/pydantic/pull/5682
- Add
UrlConstraints.__hash__by @madkinsz in https://github.com/pydantic/pydantic/pull/5697 - Add custom init support by @dmontagu in https://github.com/pydantic/pydantic/pull/5703
- Bump version to 2.0a4 by @dmontagu in https://github.com/pydantic/pydantic/pull/5704
New Contributors
- @KanchiShimono made their first contribution in https://github.com/pydantic/pydantic/pull/5552
- @lig made their first contribution in https://github.com/pydantic/pydantic/pull/5599
- @caniko made their first contribution in https://github.com/pydantic/pydantic/pull/5625
- @madkinsz made their first contribution in https://github.com/pydantic/pydantic/pull/5697
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0a3...v2.0a4
- Python
Published by dmontagu about 3 years ago
pydantic - v2.0a3 2023-04-20
What's Changed
- Preserve maxlen attribute on validated deques by @dmontagu in https://github.com/pydantic/pydantic/pull/5458
- Defer evaluation of dataclasses for test 2162 by @dmontagu in https://github.com/pydantic/pydantic/pull/5462
- Remove
__all__from private modules by @Kludex in https://github.com/pydantic/pydantic/pull/5467 - pydantic-core v0.24.0 by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5464
validate_callto replacevalidate_argumentsby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5342- Add
BaseConfigback to thepydantic.configmodule by @Kludex in https://github.com/pydantic/pydantic/pull/5479 - Docs page for validation errors by @tpdorsey in https://github.com/pydantic/pydantic/pull/5459
- Fix handling of default values of BaseModel subclasses in JSON schema by @dmontagu in https://github.com/pydantic/pydantic/pull/5368
- Use cached BaseModel core schema to hopefully improve model building performance when a model is reused by @dmontagu in https://github.com/pydantic/pydantic/pull/5485
- Split
__get_pydantic_core_schema__into__modify_pydantic_core_schema__and__get_pydantic_core_schema__by @adriangb in https://github.com/pydantic/pydantic/pull/5472 - Refactor dataclasses, and get simple generics working by @dmontagu in https://github.com/pydantic/pydantic/pull/5473
- Add docstring coverage for dataclasses by @tpdorsey in https://github.com/pydantic/pydantic/pull/5471
- Move logic from generateschema.py to annotated_arguments.py by @adriangb in https://github.com/pydantic/pydantic/pull/5491
- Move
toolsmodule todeprecatednamespace by @Kludex in https://github.com/pydantic/pydantic/pull/5483 - Rework
__get_pydantic_core_schema__APIs by @adriangb in https://github.com/pydantic/pydantic/pull/5490 - Add AliasPath and AliasPathChoices and use them in validation_alias type by @hramezani in https://github.com/pydantic/pydantic/pull/5500
- Uprev pydantic-core to 0.24.1 by @adriangb in https://github.com/pydantic/pydantic/pull/5494
- feat: allow accessing attributes as strings by @dijonkitchen in https://github.com/pydantic/pydantic/pull/5501
- Add docstring coverage for fields by @tpdorsey in https://github.com/pydantic/pydantic/pull/5469
- add codspell to pre-commit by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5516
- improve some coverage by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5518
- No case enum by @dmontagu in https://github.com/pydantic/pydantic/pull/5506
- Fix / rewrite xfail tests in docs by @adriangb in https://github.com/pydantic/pydantic/pull/5503
- Add docstring coverage for errors by @tpdorsey in https://github.com/pydantic/pydantic/pull/5482
- docs: fix spelling and wording by @dijonkitchen in https://github.com/pydantic/pydantic/pull/5525
- Computed Fields by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5502
- Fix a couple of bugs in
@model_validatorby @adriangb in https://github.com/pydantic/pydantic/pull/5529 - Add test showing that missing abstractmethods error for all decorators by @dmontagu in https://github.com/pydantic/pydantic/pull/5530
- Add migration error messages to V2 by @Kludex in https://github.com/pydantic/pydantic/pull/5480
- Add support for Hashable by @dmontagu in https://github.com/pydantic/pydantic/pull/5489
- Change errors URL for next release by @dmontagu in https://github.com/pydantic/pydantic/pull/5538
- Prepare for 2.0a3 release by @dmontagu in https://github.com/pydantic/pydantic/pull/5540
- Revert "feat: allow accessing attributes as strings" by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5541
New Contributors
- @dijonkitchen made their first contribution in https://github.com/pydantic/pydantic/pull/5501
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0a2...v2.0a3
- Python
Published by dmontagu about 3 years ago
pydantic - v2.0a2 2023-04-12
What's Changed
- Convert schema_of to use AnalyzedType by @adriangb in https://github.com/pydantic/pydantic/pull/5355
- Return hramezani back to the reviewers list by @hramezani in https://github.com/pydantic/pydantic/pull/5374
- Remove apparently-unnecessary model_rebuild by @dmontagu in https://github.com/pydantic/pydantic/pull/5371
- Add auto generate conversion table to doc by @hramezani in https://github.com/pydantic/pydantic/pull/5324
- Remove contuple from types by @hramezani in https://github.com/pydantic/pydantic/pull/5384
- Prevent multiple field serializers for a field in same class by @hramezani in https://github.com/pydantic/pydantic/pull/5378
- Handle functools.partial/partialmethod in validators by @adriangb in https://github.com/pydantic/pydantic/pull/5362
- Add support for frozen and final fields by @dmontagu in https://github.com/pydantic/pydantic/pull/5366
- Make types hashable by @hramezani in https://github.com/pydantic/pydantic/pull/5392
- Error URLs by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5356
- Fix root validators & subclasses by @adriangb in https://github.com/pydantic/pydantic/pull/5390
- Only call pydanticpostinit with positional arguments by @dmontagu in https://github.com/pydantic/pydantic/pull/5382
- Move generic metadata into a typeddict by @dmontagu in https://github.com/pydantic/pydantic/pull/5361
- Rework allow_reuse in decorators by @adriangb in https://github.com/pydantic/pydantic/pull/5398
- Reorganize .gitignore file by @dmontagu in https://github.com/pydantic/pydantic/pull/5404
- Add typesnamespace argument to model_rebuild by @dmontagu in https://github.com/pydantic/pydantic/pull/5385
- Break out types into individual topics by @tpdorsey in https://github.com/pydantic/pydantic/pull/5372
- Add pre-commit hooks installation to Contribute page by @tpdorsey in https://github.com/pydantic/pydantic/pull/5403
- support pydantic-core v0.23 by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5396
- Use pyright for type checking; fix errors and add type ignores by @adriangb in https://github.com/pydantic/pydantic/pull/5399
- make typecheck should run even if there are no changed files by @adriangb in https://github.com/pydantic/pydantic/pull/5407
- add docstring to _ModelNamespaceDict by @adriangb in https://github.com/pydantic/pydantic/pull/5408
- new
ConfigWrapperby @samuelcolvin in https://github.com/pydantic/pydantic/pull/5411 - fix type checking for python 3.7 and simplify ForwardRef wrapper by @adriangb in https://github.com/pydantic/pydantic/pull/5415
- Convert internal classes into dataclasses by @adriangb in https://github.com/pydantic/pydantic/pull/5416
- Add pydanticinitsubclass classmethod by @dmontagu in https://github.com/pydantic/pydantic/pull/5386
- Add
@model_validatorby @adriangb in https://github.com/pydantic/pydantic/pull/5379 - Rename internal dataclass decorator by @adriangb in https://github.com/pydantic/pydantic/pull/5417
- Implement Annotated validators by @adriangb in https://github.com/pydantic/pydantic/pull/5364
- Fix reference in _decorators.py by @adriangb in https://github.com/pydantic/pydantic/pull/5418
- Add test for validators with underscores in their names by @adriangb in https://github.com/pydantic/pydantic/pull/5420
- add pydantic-core to version-info by @samuelcolvin in https://github.com/pydantic/pydantic/pull/5424
- Make Extra a literal by @adriangb in https://github.com/pydantic/pydantic/pull/5431
- Add Migration Guide page by @tpdorsey in https://github.com/pydantic/pydantic/pull/5429
- Clean up and add tests for extra and serialization by @adriangb in https://github.com/pydantic/pydantic/pull/5428
- Remove unused fixture and args in test_serializer.py by @adriangb in https://github.com/pydantic/pydantic/pull/5410
- Add substance to migration guide section on validator decorators by @adriangb in https://github.com/pydantic/pydantic/pull/5438
- Uprev pydantic-core to 0.23.1 by @adriangb in https://github.com/pydantic/pydantic/pull/5439
- Add Kludex to list of reviewers by @Kludex in https://github.com/pydantic/pydantic/pull/5445
- Clean up Field parameters by @hramezani in https://github.com/pydantic/pydantic/pull/5425
- Pin the version of pydantic-core by @dmontagu in https://github.com/pydantic/pydantic/pull/5451
- Fix mypy issue by @dmontagu in https://github.com/pydantic/pydantic/pull/5450
- Fix aliases and add
validation_aliasandserialization_aliastoFieldby @hramezani in https://github.com/pydantic/pydantic/pull/5433 - Fix more tests by @adriangb in https://github.com/pydantic/pydantic/pull/5455
- Build API docs with mkdocstrings by @tpdorsey in https://github.com/pydantic/pydantic/pull/5427
- Prep for v2.0a2 by @dmontagu in https://github.com/pydantic/pydantic/pull/5456
Full Changelog: https://github.com/pydantic/pydantic/compare/v2.0a1...v2.0a2
- Python
Published by dmontagu about 3 years ago
pydantic - v2.0a1 2023-04-03
First pre-release of Pydantic V2!
See this post for more details.
New Contributors
- @treylav made their first contribution in https://github.com/pydantic/pydantic/pull/4512
- @zunzara made their first contribution in https://github.com/pydantic/pydantic/pull/4533
- @zachkirsch made their first contribution in https://github.com/pydantic/pydantic/pull/4593
- @Natim made their first contribution in https://github.com/pydantic/pydantic/pull/4596
- @ischaojie made their first contribution in https://github.com/pydantic/pydantic/pull/4616
- @webknjaz made their first contribution in https://github.com/pydantic/pydantic/pull/4615
- @morian made their first contribution in https://github.com/pydantic/pydantic/pull/4690
- @Evorage0 made their first contribution in https://github.com/pydantic/pydantic/pull/4711
- @mnixry made their first contribution in https://github.com/pydantic/pydantic/pull/4734
- @VolkerH made their first contribution in https://github.com/pydantic/pydantic/pull/4743
- @iudeen made their first contribution in https://github.com/pydantic/pydantic/pull/4764
- @pmithrandir made their first contribution in https://github.com/pydantic/pydantic/pull/4758
- @lieryan made their first contribution in https://github.com/pydantic/pydantic/pull/4777
- @rifatrakib made their first contribution in https://github.com/pydantic/pydantic/pull/4855
- @jimkring made their first contribution in https://github.com/pydantic/pydantic/pull/4843
- @gr8jam made their first contribution in https://github.com/pydantic/pydantic/pull/4876
- @florianfischer91 made their first contribution in https://github.com/pydantic/pydantic/pull/4889
- @danielkjellid made their first contribution in https://github.com/pydantic/pydantic/pull/4931
- @kennethreitz made their first contribution in https://github.com/pydantic/pydantic/pull/4934
- @sudouser777 made their first contribution in https://github.com/pydantic/pydantic/pull/4920
- @mwgamble made their first contribution in https://github.com/pydantic/pydantic/pull/4912
- @ybressler made their first contribution in https://github.com/pydantic/pydantic/pull/4901
- @tiwilliam made their first contribution in https://github.com/pydantic/pydantic/pull/4869
- @pgiraud made their first contribution in https://github.com/pydantic/pydantic/pull/5001
- @glebmxyz made their first contribution in https://github.com/pydantic/pydantic/pull/5004
- @bgoldstone made their first contribution in https://github.com/pydantic/pydantic/pull/4870
- @ddneilson made their first contribution in https://github.com/pydantic/pydantic/pull/5010
- @antonagestam made their first contribution in https://github.com/pydantic/pydantic/pull/5075
- @theonlykingpin made their first contribution in https://github.com/pydantic/pydantic/pull/5139
- @andreyrcdias made their first contribution in https://github.com/pydantic/pydantic/pull/5210
- @tpdorsey made their first contribution in https://github.com/pydantic/pydantic/pull/5268
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.2...v2.0a1
- Python
Published by samuelcolvin about 3 years ago
pydantic - v1.10.7 2023-03-22
What's Changed
- Fix creating schema from model using
ConstrainedStrwithregexas dict key, #5223 by @matejetz - Address bug in mypy plugin caused by explicitpackagebases=True, #5191 by @dmontagu
- Add implicit defaults in the mypy plugin for Field with no default argument, #5190 by @dmontagu
- Fix schema generated for Enum values used as Literals in discriminated unions, #5188 by @javibookline
- Fix mypy failures caused by the pydantic mypy plugin when users define
from_ormin their own classes, #5187 by @dmontagu - Fix
InitVarusage with pydantic dataclasses, mypy version1.1.1and the custom mypy plugin, #5162 by @cdce8p
New Contributors
- @javibookline made their first contribution in https://github.com/pydantic/pydantic/pull/5188
- @matejetz made their first contribution in https://github.com/pydantic/pydantic/pull/5223
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.6...v1.10.7
- Python
Published by dmontagu about 3 years ago
pydantic - v1.10.6 2023-03-02
What's Changed
- Implement logic to support creating validators from non standard callables by using defaults to identify them and unwrapping
functools.partialandfunctools.partialmethodwhen checking the signature, #5126 by @JensHeinrich - Fix mypy plugin for v1.1.1, and fix
dataclass_transformdecorator for pydantic dataclasses, #5111 by @cdce8p - Raise
ValidationError, notConfigError, when a discriminator value is unhashable, #4773 by @kurtmckee
New Contributors
- @mrmammadov made their first contribution in https://github.com/pydantic/pydantic/pull/5074
- @JensHeinrich made their first contribution in https://github.com/pydantic/pydantic/pull/5127
- @kurtmckee made their first contribution in https://github.com/pydantic/pydantic/pull/5132
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.5...v1.10.6
- Python
Published by dmontagu about 3 years ago
pydantic - v1.10.5 (2023-02-15)
- Fix broken parametrized bases handling with
GenericModels with complex sets of models, #5052 by @MarkusSintonen - Invalidate mypy cache if plugin config changes, #5007 by @cdce8p
- Fix
RecursionErrorwhen deep-copying dataclass types wrapped by pydantic, #4949 by @mbillingr - Fix
X | Yunion syntax breakingGenericModel, #4146 by @thenx - Switch coverage badge to show coverage for this branch/release, #5060 by @samuelcolvin
New Contributors
- @thenx made their first contribution in https://github.com/pydantic/pydantic/pull/4977
- @mbillingr made their first contribution in https://github.com/pydantic/pydantic/pull/4963
- @MarkusSintonen made their first contribution in https://github.com/pydantic/pydantic/pull/5052
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.4...v1.10.5
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.4 (2022-12-30)
- Change dependency to
typing-extensions>=4.2.0, #4885 by @samuelcolvin
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.3...v1.10.4
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.3 (2022-12-29)
- fix parsing of custom root models, #4883 by @gou177
- fix: use dataclass proxy for frozen or empty dataclasses, #4878 by @PrettyWood
- Fix
schemaandschema_jsonon models where a model instance is a one of default values, #4781 by @Bobronium - Add Jina AI to sponsors on docs index page, #4767 by @samuelcolvin
- fix: support assignment on
DataclassProxy, #4695 by @PrettyWood - Add
postgresql+psycopgas allowed scheme forPostgreDsnto make it usable with SQLAlchemy 2, #4689 by @morian - Allow dict schemas to have both
patternPropertiesandadditionalProperties, #4641 by @jparise - Fixes error passing None for optional lists with
unique_items, #4568 by @mfulgo - Fix
GenericModelwithCallableparam raising aTypeError, #4551 by @mfulgo - Fix field regex with
StrictStrtype annotation, #4538 by @sisp - Correct
dataclass_transformkeyword argument name fromfield_descriptorstofield_specifiers, #4500 by @samuelcolvin - fix: avoid multiple calls of
__post_init__when dataclasses are inherited, #4487 by @PrettyWood - Reduce the size of binary wheels, #2276 by @samuelcolvin
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.2...v1.10.3
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.2 (2022-09-05)
- Revert Change: Revert percent encoding of URL parts which was originally added in #4224, #4470 by @samuelcolvin
- Prevent long (length >
4_300) strings/bytes as input to int fields, see python/cpython#95778 and CVE-2020-10735, #1477 by @samuelcolvin - fix: dataclass wrapper was not always called, #4477 by @PrettyWood
- Use
tomllibon Python 3.11 when parsingmypyconfiguration, #4476 by @hauntsaninja - Basic fix of
GenericModelcache to detect order of arguments inUnionmodels, #4474 by @sveinugu - Fix mypy plugin when using bare types like
listanddictasdefault_factory, #4457 by @samuelcolvin
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.1...v1.10.2
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.1 (2022-08-31)
- Add
__hash__method topydancic.color.Colorclass, #4454 by @czaki
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.10.0...v1.10.1
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.0 (2022-08-30)
See #4419 for feedback and discussion, docs are live at pydantic-docs.helpmanual.io.
- Refactor the whole pydantic
dataclassdecorator to really act like its standard lib equivalent. It hence keeps__eq__,__hash__, ... and makes comparison with its non-validated version possible. It also fixes usage offrozendataclasses in fields and usage ofdefault_factoryin nested dataclasses. The support ofConfig.extrahas been added. Finally, config customization directly via adictis now possible, #2557 by @PrettyWood
BREAKING CHANGES:- The
compiledboolean (whether pydantic is compiled with cython) has been moved frommain.pytoversion.py - Now that
Config.extrais supported,dataclassignores by default extra arguments (likeBaseModel)
- The
- Fix PEP487
__set_name__protocol inBaseModelfor PrivateAttrs, #4407 by @tlambert03 - Allow for custom parsing of environment variables via
parse_env_varinConfig, #4406 by @acmiyaguchi - Rename
mastertomain, #4405 by @hramezani - Fix
StrictStrdoes not raiseValidationErrorwhenmax_lengthis present inField, #4388 by @hramezani - Make
SecretStrandSecretByteshashable, #4387 by @chbndrhnns - Fix
StrictBytesdoes not raiseValidationErrorwhenmax_lengthis present inField, #4380 by @JeanArhancet - Add support for bare
type, #4375 by @hramezani - Support Python 3.11, including binaries for 3.11 in PyPI, #4374 by @samuelcolvin
- Add support for
re.Pattern, #4366 by @hramezani - Fix
__post_init_post_parse__is incorrectly passed keyword arguments when no__post_init__is defined, #4361 by @hramezani - Fix implicitly importing
ForwardRefandCallablefrompydantic.typinginstead oftypingand also exposeMappingIntStrAny, #4358 by @aminalaee - remove
Anytypes from thedataclassdecorator so it can be used with thedisallow_any_exprmypy option, #4356 by @DetachHead - moved repo to
pydantic/pydantic, #4348 by @yezz123 - fix "extra fields not permitted" error when dataclass with
Extra.forbidis validated multiple times, #4343 by @detachhead - Add Python 3.9 and 3.10 examples to docs, #4339 by @Bobronium
- Discriminated union models now use
oneOfinstead ofanyOfwhen generating OpenAPI schema definitions, #4335 by @MaxwellPayne - Allow type checkers to infer inner type of
Jsontype.Json[list[str]]will be now inferred aslist[str],Json[Any]should be used instead of plainJson. Runtime behaviour is not changed, #4332 by @Bobronium - Allow empty string aliases by using a
alias is not Nonecheck, rather thanbool(alias), #4253 by @sergeytsaplin - Update
ForwardRefs inField.outer_type_, #4249 by @JacobHayes - The use of
__dataclass_transform__has been replaced bytyping_extensions.dataclass_transform, which is the preferred way to mark pydantic models as a dataclass under PEP 681, #4241 by @multimeric - Use parent model's
Configwhen validating nestedNamedTuplefields, #4219 by @synek - Update
BaseModel.constructto work with aliased Fields, #4192 by @kylebamos - Catch certain raised errors in
smart_deepcopyand revert todeepcopyif so, #4184 by @coneybeare - Add
Config.anystr_upperandto_upperkwarg to constr and conbytes, #4165 by @satheler - Fix JSON schema for
setandfrozensetwhen they include default values, #4155 by @aminalaee - Teach the mypy plugin that methods decorated by
@validatorare classmethods, #4102 by @DMRobertson - Improve mypy plugin's ability to detect required fields, #4086 by @richardxia
- Support fields of type
Type[]in schema, #4051 by @aminalaee - Add
defaultvalue in JSON Schema whenconst=True, #4031 by @aminalaee - Adds reserved word check to signature generation logic, #4011 by @strue36
- Fix Json strategy failure for the complex nested field, #4005 by @sergiosim
- Add JSON-compatible float constraint
allow_inf_nan, #3994 by @tiangolo - Remove undefined behaviour when
env_prefixhad characters in common withenv_nested_delimiter, #3975 by @arsenron - Support generics model with
create_model, #3945 by @hot123s - allow submodels to overwrite extra field info, #3934 by @PrettyWood
- Document and test structural pattern matching (PEP 636) on
BaseModel, #3920 by @irgolic - Fix incorrect deserialization of python timedelta object to ISO 8601 for negative time deltas. Minus was serialized in incorrect place ("P-1DT23H59M59.888735S" instead of correct "-P1DT23H59M59.888735S"), #3899 by @07pepa
- Fix validation of discriminated union fields with an alias when passing a model instance, #3846 by @chornsby
- Add a CockroachDsn type to validate CockroachDB connection strings. The type
supports the following schemes:
cockroachdb,cockroachdb+psycopg2andcockroachdb+asyncpg, #3839 by @blubber - Fix MyPy plugin to not override pre-existing
__init__method in models, #3824 by @patrick91 - Fix mypy version checking, #3783 by @KotlinIsland
- support overwriting dunder attributes of
BaseModelinstances, #3777 by @PrettyWood - Added
ConstrainedDateandcondate, #3740 by @hottwaj - Support
kw_onlyin dataclasses, #3670 by @detachhead - Add comparison method for
Colorclass, #3646 by @aminalaee - Drop support for python3.6, associated cleanup, #3605 by @samuelcolvin
- created new function
to_lower_camel()for "non pascal case" camel case, #3463 by @schlerp - Add checks to
defaultanddefault_factoryarguments in Mypy plugin, #3430 by @klaa97 - fix mangling of
inspect.signatureforBaseModel, #3413 by @fix-inspect-signature - Adds the
SecretFieldabstract class so that all the current and future secret fields likeSecretStrandSecretByteswill derive from it, #3409 by @expobrain - Support multi hosts validation in
PostgresDsn, #3337 by @rglsk - Fix parsing of very small numeric timedelta values, #3315 by @samuelcolvin
- Update
SecretsSettingsSourceto respectconfig.case_sensitive, #3273 by @JeanArhancet - Add MongoDB network data source name (DSN) schema, #3229 by @snosratiershad
- Add support for multiple dotenv files, #3222 by @rekyungmin
- Raise an explicit
ConfigErrorwhen multiple fields are incorrectly set for a single validator, #3215 by @SunsetOrange - Allow ellipsis on
Fields insideAnnotatedforTypedDictsrequired, #3133 by @ezegomez - Catch overflow errors in
int_validator, #3112 by @ojii - Adds a
__rich_repr__method toRepresentationclass which enables pretty printing with Rich, #3099 by @willmcgugan - Add percent encoding in
AnyUrland descendent types, #3061 by @FaresAhmedb validate_argumentsdecorator now supportsalias, #3019 by @MAD-py- Avoid
__dict__and__weakref__attributes inAnyUrland IP address fields, #2890 by @nuno-andre - Add ability to use
Finalin a field type annotation, #2766 by @uriyyo - Update requirement to
typing_extensions>=4.1.0to guaranteedataclass_transformis available, #4424 by @commonism - Add Explosion and AWS to main sponsors, #4413 by @samuelcolvin
- Update documentation for
copy_on_model_validationto reflect recent changes, #4369 by @samuelcolvin - Runtime warning if
__slots__is passed tocreate_model,__slots__is then ignored, #4432 by @samuelcolvin - Add type hints to
BaseSettings.Configto avoid mypy errors, also correct mypy version compatibility notice in docs, #4450 by @samuelcolvin
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.9.0...v1.10.0
- Python
Published by samuelcolvin over 3 years ago
pydantic - v1.10.0b1 (2022-08-24)
- Runtime warning if
__slots__is passed tocreate_model,__slots__is then ignored, #4432 by @samuelcolvin
Full Changelog https://github.com/pydantic/pydantic/compare/v1.10.0a2...v1.10.0b1
- Python
Published by samuelcolvin almost 4 years ago
pydantic - v1.10.0a2 (2022-08-24)
Docs for this pre-release are available here
- Update requirement to
typing_extensions>=4.1.0to guaranteedataclass_transformis available, #4424 by @commonism - Add Explosion and AWS to main sponsors, #4413 by @samuelcolvin
- Update documentation for
copy_on_model_validationto reflect recent changes, #4369 by @samuelcolvin
Full Changelog https://github.com/pydantic/pydantic/compare/v1.10.0a1...v1.10.0a2
- Python
Published by samuelcolvin almost 4 years ago
pydantic - v1.10.0a1 (2022-08-22)
Docs for this pre-release are available here!
- Refactor the whole pydantic
dataclassdecorator to really act like its standard lib equivalent. It hence keeps__eq__,__hash__, ... and makes comparison with its non-validated version possible. It also fixes usage offrozendataclasses in fields and usage ofdefault_factoryin nested dataclasses. The support ofConfig.extrahas been added. Finally, config customization directly via adictis now possible, #2557 by @PrettyWood BREAKING CHANGES:- The
compiledboolean (whether pydantic is compiled with cython) has been moved frommain.pytoversion.py - Now that
Config.extrais supported,dataclassignores by default extra arguments (likeBaseModel)
- The
- Fix PEP487
__set_name__protocol inBaseModelfor PrivateAttrs, #4407 by @tlambert03 - Rename
mastertomain, #4405 by @hramezani - Fix
StrictStrdoes not raiseValidationErrorwhenmax_lengthis present inField, #4388 by @hramezani - Make
SecretStrandSecretByteshashable, #4387 by @chbndrhnns - Fix
StrictBytesdoes not raiseValidationErrorwhenmax_lengthis present inField, #4380 by @JeanArhancet - Add support for bare
type, #4375 by @hramezani - Support Python 3.11, including binaries for 3.11 in PyPI, #4374 by @samuelcolvin
- Add support for
re.Pattern, #4366 by @hramezani - Fix
__post_init_post_parse__is incorrectly passed keyword arguments when no__post_init__is defined, #4361 by @hramezani - Fix implicitly importing
ForwardRefandCallablefrompydantic.typinginstead oftypingand also exposeMappingIntStrAny, #4358 by @aminalaee - remove
Anytypes from thedataclassdecorator so it can be used with thedisallow_any_exprmypy option, #4356 by @DetachHead - moved repo to
pydantic/pydantic, #4348 by @yezz123 - fix "extra fields not permitted" error when dataclass with
Extra.forbidis validated multiple times, #4343 by @detachhead - Add Python 3.9 and 3.10 examples to docs, #4339 by @Bobronium
- Discriminated union models now use
oneOfinstead ofanyOfwhen generating OpenAPI schema definitions, #4335 by @MaxwellPayne - Allow type checkers to infer inner type of
Jsontype.Json[list[str]]will be now inferred aslist[str],Json[Any]should be used instead of plainJson. Runtime behaviour is not changed, #4332 by @Bobronium - Allow empty string aliases by using a
alias is not Nonecheck, rather thanbool(alias), #4253 by @sergeytsaplin - Update
ForwardRefs inField.outer_type_, #4249 by @JacobHayes - The use of
__dataclass_transform__has been replaced bytyping_extensions.dataclass_transform, which is the preferred way to mark pydantic models as a dataclass under PEP 681, #4241 by @multimeric - Use parent model's
Configwhen validating nestedNamedTuplefields, #4219 by @synek - Update
BaseModel.constructto work with aliased Fields, #4192 by @kylebamos - Catch certain raised errors in
smart_deepcopyand revert todeepcopyif so, #4184 by @coneybeare - Add
Config.anystr_upperandto_upperkwarg to constr and conbytes, #4165 by @satheler - Fix JSON schema for
setandfrozensetwhen they include default values, #4155 by @aminalaee - Teach the mypy plugin that methods decorated by
@validatorare classmethods, #4102 by @DMRobertson - Improve mypy plugin's ability to detect required fields, #4086 by @richardxia
- Support fields of type
Type[]in schema, #4051 by @aminalaee - Add
defaultvalue in JSON Schema whenconst=True, #4031 by @aminalaee - Adds reserved word check to signature generation logic, #4011 by @strue36
- Fix Json strategy failure for the complex nested field, #4005 by @sergiosim
- Add JSON-compatible float constraint
allow_inf_nan, #3994 by @tiangolo - Remove undefined behaviour when
env_prefixhad characters in common withenv_nested_delimiter, #3975 by @arsenron - Support generics model with
create_model, #3945 by @hot123s - allow submodels to overwrite extra field info, #3934 by @PrettyWood
- Document and test structural pattern matching (PEP 636) on
BaseModel, #3920 by @irgolic - Fix incorrect deserialization of python timedelta object to ISO 8601 for negative time deltas. Minus was serialized in incorrect place ("P-1DT23H59M59.888735S" instead of correct "-P1DT23H59M59.888735S"), #3899 by @07pepa
- Fix validation of discriminated union fields with an alias when passing a model instance, #3846 by @chornsby
- Add a CockroachDsn type to validate CockroachDB connection strings. The type
supports the following schemes:
cockroachdb,cockroachdb+psycopg2andcockroachdb+asyncpg, #3839 by @blubber - Fix MyPy plugin to not override pre-existing
__init__method in models, #3824 by @patrick91 - Fix mypy version checking, #3783 by @KotlinIsland
- support overwriting dunder attributes of
BaseModelinstances, #3777 by @PrettyWood - Added
ConstrainedDateandcondate, #3740 by @hottwaj - Support
kw_onlyin dataclasses, #3670 by @detachhead - Add comparison method for
Colorclass, #3646 by @aminalaee - Drop support for python3.6, associated cleanup, #3605 by @samuelcolvin
- created new function
to_lower_camel()for "non pascal case" camel case, #3463 by @schlerp - Add checks to
defaultanddefault_factoryarguments in Mypy plugin, #3430 by @klaa97 - fix mangling of
inspect.signatureforBaseModel, #3413 by @fix-inspect-signature - Adds the
SecretFieldabstract class so that all the current and future secret fields likeSecretStrandSecretByteswill derive from it, #3409 by @expobrain - Support multi hosts validation in
PostgresDsn, #3337 by @rglsk - Fix parsing of very small numeric timedelta values, #3315 by @samuelcolvin
- Update
SecretsSettingsSourceto respectconfig.case_sensitive, #3273 by @JeanArhancet - Add MongoDB network data source name (DSN) schema, #3229 by @snosratiershad
- Add support for multiple dotenv files, #3222 by @rekyungmin
- Raise an explicit
ConfigErrorwhen multiple fields are incorrectly set for a single validator, #3215 by @SunsetOrange - Allow ellipsis on
Fields insideAnnotatedforTypedDictsrequired, #3133 by @ezegomez - Catch overflow errors in
int_validator, #3112 by @ojii - Adds a
__rich_repr__method toRepresentationclass which enables pretty printing with Rich, #3099 by @willmcgugan - Add percent encoding in
AnyUrland descendent types, #3061 by @FaresAhmedb validate_argumentsdecorator now supportsalias, #3019 by @MAD-py- Avoid
__dict__and__weakref__attributes inAnyUrland IP address fields, #2890 by @nuno-andre - Add ability to use
Finalin a field type annotation, #2766 by @uriyyo
Full Changelog: https://github.com/pydantic/pydantic/compare/v1.9.0...v1.10a1
- Python
Published by samuelcolvin almost 4 years ago
pydantic - v1.9.2 (2022-08-11)
Revert Breaking Change: v1.9.1 introduced a breaking change where model fields were
deep copied by default, this release reverts the default behaviour to match v1.9.0 and before,
while also allow deep-copy behaviour via copy_on_model_validation = 'deep'. See #4092 for more information.
- Allow for shallow copies of model fields,
Config.copy_on_model_validationis now a str which must be'none','deep', or'shallow'corresponding to not copying, deep copy & shallow copy; default'shallow', #4093 by @timkpaine
- Python
Published by samuelcolvin almost 4 years ago
pydantic - v1.9.1 (2022-05-19)
Thank you to pydantic's sponsors: @tiangolo, @stellargraph, @JonasKs, @grillazz, @Mazyod, @kevinalh, @chdsbd, @povilasb, @povilasb, @jina-ai, @mainframeindustries, @robusta-dev, @SendCloud, @rszamszur, @jodal, @hardbyte, @corleyma, @daddycocoaman, @Rehket, @jokull, @reillysiemens, @westonsteimel, @primer-io, @koxudaxi, @browniebroke, @stradivari96, @adriangb, @kamalgill, @jqueguiner, @dev-zero, @datarootsio, @RedCarpetUp for their kind support.
- Limit the size of
generics._generic_types_cacheandgenerics._assigned_parametersto avoid unlimited increase in memory usage, #4083 by @samuelcolvin - Add Jupyverse and FPS as Jupyter projects using pydantic, #4082 by @davidbrochart
- Speedup
__isinstancecheck__on pydantic models when the type is not a model, may also avoid memory "leaks", #4081 by @samuelcolvin - Fix in-place modification of
FieldInfothat caused problems with PEP 593 type aliases, #4067 by @adriangb - Add support for autocomplete in VS Code via
__dataclass_transform__when usingpydantic.dataclasses.dataclass, #4006 by @giuliano-oliveira - Remove benchmarks from codebase and docs, #3973 by @samuelcolvin
- Typing checking with pyright in CI, improve docs on vscode/pylance/pyright, #3972 by @samuelcolvin
- Fix nested Python dataclass schema regression, #3819 by @himbeles
- Update documentation about lazy evaluation of sources for Settings, #3806 by @garyd203
- Prevent subclasses of bytes being converted to bytes, #3706 by @samuelcolvin
- Fixed "error checking inheritance of" when using PEP585 and PEP604 type hints, #3681 by @aleksul
- Allow self referencing
ClassVars in models, #3679 by @samuelcolvin - Fix issue with self-referencing dataclass, #3675 by @uriyyo
- Include non-standard port numbers in rendered URLs, #3652 by @dolfinus
Config.copy_on_model_validationdoes a deep copy and not a shallow one, #3641 by @PrettyWood- fix: clarify that discriminated unions do not support singletons, #3636 by @tommilligan
- Add
read_text(encoding='utf-8')forsetup.py, #3625 by @hswong3i - Fix JSON Schema generation for Discriminated Unions within lists, #3608 by @samuelcolvin
- Python
Published by samuelcolvin about 4 years ago
pydantic - v1.9.0 (2021-12-31)
Thank you to pydantic's sponsors: @sthagen, @timdrijvers, @toinbis, @koxudaxi, @ginomempin, @primer-io, @and-semakin, @westonsteimel, @reillysiemens, @es3n1n, @jokull, @JonasKs, @Rehket, @corleyma, @daddycocoaman, @hardbyte, @datarootsio, @jodal, @aminalaee, @rafsaf, @jqueguiner, @chdsbd, @kevinalh, @Mazyod, @grillazz, @JonasKs, @simw, @leynier, @xfenix for their kind support.
Highlights
- add python 3.10 support, #2885 by @PrettyWood
- Discriminated unions, #619 by @PrettyWood
Config.smart_unionfor better union logic, #2092 by @PrettyWood- Binaries for Macos M1 CPUs, #3498 by @samuelcolvin
- Complex types can be set via nested environment variables, e.g.
foo___bar, #3159 by @Air-Mark - add a dark mode to pydantic documentation, #2913 by @gbdlin
- Add support for autocomplete in VS Code via
__dataclass_transform__, #2721 by @tiangolo - Add "exclude" as a field parameter so that it can be configured using model config, #660 by @daviskirk
v1.9.0 (2021-12-31) Changes
- Apply
update_forward_refstoConfig.json_encodesprevent name clashes in types defined via strings, #3583 by @samuelcolvin - Extend pydantic's mypy plugin to support mypy versions
0.910,0.920,0.921&0.930, #3573 & #3594 by @PrettyWood, @christianbundy, @samuelcolvin
v1.9.0a2 (2021-12-24) Changes
- support generic models with discriminated union, #3551 by @PrettyWood
- keep old behaviour of
json()by default, #3542 by @PrettyWood - Removed typing-only
__root__attribute fromBaseModel, #3540 by @layday - Build Python 3.10 wheels, #3539 by @mbachry
- Fix display of
extrafields with model__repr__, #3234 by @cocolman - models copied via
Config.copy_on_model_validationalways have all fields, #3201 by @PrettyWood - nested ORM from nested dictionaries, #3182 by @PrettyWood
- fix link to discriminated union section by @PrettyWood
v1.9.0a1 (2021-12-18) Changes
- Add support for
Decimal-specific validation configurations inField(), additionally to usingcondecimal(), to allow better support from editors and tooling, #3507 by @tiangolo - Add
arm64binaries suitable for MacOS with an M1 CPU to PyPI, #3498 by @samuelcolvin - Fix issue where
Nonewas considered invalid when using aUniontype containingAnyorobject, #3444 by @tharradine - When generating field schema, pass optional
fieldargument (of typepydantic.fields.ModelField) to__modify_schema__()if present, #3434 by @jasujm - Fix issue when pydantic fail to parse
typing.ClassVarstring type annotation, #3401 by @uriyyo - Mention Python >= 3.9.2 as an alternative to
typing_extensions.TypedDict, #3374 by @BvB93 - Changed the validator method name in the Custom Errors example
to more accurately describe what the validator is doing; changed from
name_must_contain_spacetovalue_must_equal_bar, #3327 by @michaelrios28 - Add
AmqpDsnclass, #3254 by @kludex - Always use
Enumvalue as default in generated JSON schema, #3190 by @joaommartins - Add support for Mypy 0.920, #3175 by @christianbundy
validate_argumentsnow supportsextracustomization (used to always beExtra.forbid), #3161 by @PrettyWood- Complex types can be set by nested environment variables, #3159 by @Air-Mark
- Fix mypy plugin to collect fields based on
pydantic.utils.is_valid_fieldso that it ignores untyped private variables, #3146 by @hi-ogawa - fix
validate_argumentsissue withConfig.validate_all, #3135 by @PrettyWood - avoid dict coercion when using dict subclasses as field type, #3122 by @PrettyWood
- add support for
objecttype, #3062 by @PrettyWood - Updates pydantic dataclasses to keep
_specialproperties on parent classes, #3043 by @zulrang - Add a
TypedDictclass for error objects, #3038 by @matthewhughes934 - Fix support for using a subclass of an annotation as a default, #3018 by @JacobHayes
- make
create_model_from_typeddictmypy compliant, #3008 by @PrettyWood - Make multiple inheritance work when using
PrivateAttr, #2989 by @hmvp - Parse environment variables as JSON, if they have a
Uniontype with a complex subfield, #2936 by @cbartz - Prevent
StrictStrpermittingEnumvalues where the enum inherits fromstr, #2929 by @samuelcolvin - Make
SecretsSettingsSourceparse values being assigned to fields of complex types when sourced from a secrets file, just as when sourced from environment variables, #2917 by @davidmreed - add a dark mode to pydantic documentation, #2913 by @gbdlin
- Make
pydantic-mypyplugin compatible withpyproject.tomlconfiguration, consistent withmypychanges. See the doc for more information, #2908 by @jrwalk - add python 3.10 support, #2885 by @PrettyWood
- Correctly parse generic models with
Json[T], #2860 by @geekingfrog - Update contrib docs re: python version to use for building docs, #2856 by @paxcodes
- Clarify documentation about pydantic's support for custom validation and strict type checking, despite pydantic being primarily a parsing library, #2855 by @paxcodes
- Fix schema generation for
Dequefields, #2810 by @sergejkozin - fix an edge case when mixing constraints and
Literal, #2794 by @PrettyWood - Fix postponed annotation resolution for
NamedTupleandTypedDictwhen they're used directly as the type of fields within Pydantic models, #2760 by @jameysharp - Fix bug when
mypyplugin fails onconstructmethod call forBaseSettingsderived classes, #2753 by @uriyyo - Add function overloading for a
pydantic.create_modelfunction, #2748 by @uriyyo - Fix mypy plugin issue with self field declaration, #2743 by @uriyyo
- The colon at the end of the line "The fields which were supplied when user was initialised:" suggests that the code following it is related. Changed it to a period, #2733 by @krisaoe
- Renamed variable
schematoschema_to avoid shadowing of global variable name, #2724 by @shahriyarr - Add support for autocomplete in VS Code via
__dataclass_transform__, #2721 by @tiangolo - add missing type annotations in
BaseConfigand handlemax_length = 0, #2719 by @PrettyWood - Change
orm_modechecking to allow recursive ORM mode parsing with dicts, #2718 by @nuno-andre - Add episode 313 of the Talk Python To Me podcast, where Michael Kennedy and Samuel Colvin discuss pydantic, to the docs, #2712 by @RatulMaharaj
- fix JSON schema generation when a field is of type
NamedTupleand has a default value, #2707 by @PrettyWood Enumfields now properly support extra kwargs in schema generation, #2697 by @sammchardy- Make serialization of referenced pydantic models possible, #2650 by @PrettyWood
- Add
uniqueItemsoption toConstrainedList, #2618 by @nuno-andre - Try to evaluate forward refs automatically at model creation, #2588 by @uriyyo
- Switch docs preview and coverage display to use smokeshow, #2580 by @samuelcolvin
- Add
__version__attribute to pydantic module, #2572 by @paxcodes - Add
postgresql+asyncpg,postgresql+pg8000,postgresql+psycopg2,postgresql+psycopg2cffi,postgresql+py-postgresqlandpostgresql+pygresqlschemes forPostgresDsn, #2567 by @postgres-asyncpg - Enable the Hypothesis plugin to generate a constrained decimal when the
decimal_placesargument is specified, #2524 by @cwe5590 - Allow
collections.abc.Callableto be used as type in python 3.9, #2519 by @daviskirk - Documentation update how to custom compile pydantic when using pip install, small change in
setup.pyto allow for custom CFLAGS when compiling, #2517 by @peterroelants - remove side effect of
default_factoryto run it only once even ifConfig.validate_allis set, #2515 by @PrettyWood - Add lookahead to ip regexes for
AnyUrlhosts. This allows urls with DNS labels looking like IPs to validate as they are perfectly valid host names, #2512 by @sbv-csis - Set
minItemsandmaxItemsin generated JSON schema for fixed-length tuples, #2497 by @PrettyWood - Add
strictargument toconbytes, #2489 by @koxudaxi - Support user defined generic field types in generic models, #2465 by @daviskirk
- Add an example and a short explanation of subclassing
GetterDictto docs, #2463 by @nuno-andre - add
KafkaDsntype,HttpUrlnow has default port 80 for http and 443 for https, #2447 by @MihanixA - Add
PastDateandFutureDatetypes, #2425 by @Kludex - Support generating schema for
Genericfields with subtypes, #2375 by @maximberg - fix(encoder): serialize
NameEmailto str, #2341 by @alecgerona - add
Config.smart_unionto prevent coercion inUnionif possible, see the doc for more information, #2092 by @PrettyWood - Add ability to use
typing.Counteras a model field type, #2060 by @uriyyo - Add parameterised subclasses to
__bases__when constructing new parameterised classes, so thatA <: B => A[int] <: B[int], #2007 by @diabolo-dan - Create
FileUrltype that allows URLs that conform to RFC 8089. Addhost_requiredparameter, which isTrueby default (AnyUrland subclasses),FalseinRedisDsn,FileUrl, #1983 by @vgerak - add
confrozenset(), analogous toconset()andconlist(), #1897 by @PrettyWood - stop calling parent class
root_validatorif overridden, #1895 by @PrettyWood - Add
repr(defaults toTrue) parameter toField, to hide it from the default representation of theBaseModel, #1831 by @fnep - Accept empty query/fragment URL parts, #1807 by @xavier
- Python
Published by samuelcolvin over 4 years ago
pydantic - v1.9.0a2 (2021-12-24)
- support generic models with discriminated union, #3551 by @PrettyWood
- keep old behaviour of
json()by default, #3542 by @PrettyWood - Removed typing-only
__root__attribute fromBaseModel, #3540 by @layday - Build Python 3.10 wheels, #3539 by @mbachry
- Fix display of
extrafields with model__repr__, #3234 by @cocolman - models copied via
Config.copy_on_model_validationalways have all fields, #3201 by @PrettyWood - nested ORM from nested dictionaries, #3182 by @PrettyWood
- fix link to discriminated union section by @PrettyWood
Full Changelog: https://github.com/samuelcolvin/pydantic/compare/v1.9.0a1...v1.9.0a2
Discussion and feedback: #3538
- Python
Published by samuelcolvin over 4 years ago
pydantic - v1.9.0a1 (2021-12-18)
See Changelog.
Thank you to pydantic's sponsors: @timdrijvers, @toinbis, @koxudaxi, @ginomempin, @primer-io, @and-semakin, @westonsteimel, @reillysiemens, @es3n1n, @jokull, @JonasKs, @Rehket, @corleyma, @daddycocoaman, @hardbyte, @datarootsio, @jodal, @aminalaee, @rafsaf, @jqueguiner, @chdsbd, @kevinalh, @Mazyod, @grillazz, @JonasKs for their kind support.
Highlights
- add python 3.10 support, #2885 by @PrettyWood
- Discriminated unions, #619 by @PrettyWood
Config.smart_unionfor better union logic, #2092 by @PrettyWood- Binaries for Macos M1 CPUs, #3498 by @samuelcolvin
- Complex types can be set via nested environment variables, e.g.
foo___bar, #3159 by @Air-Mark - add a dark mode to pydantic documentation, #2913 by @gbdlin
- Add support for autocomplete in VS Code via
__dataclass_transform__, #2721 by @tiangolo
Changes
- Add support for
Decimal-specific validation configurations inField(), additionally to usingcondecimal(), to allow better support from editors and tooling, #3507 by @tiangolo - Add
arm64binaries suitable for MacOS with an M1 CPU to PyPI, #3498 by @samuelcolvin - Fix issue where
Nonewas considered invalid when using aUniontype containingAnyorobject, #3444 by @tharradine - When generating field schema, pass optional
fieldargument (of typepydantic.fields.ModelField) to__modify_schema__()if present, #3434 by @jasujm - Fix issue when pydantic fail to parse
typing.ClassVarstring type annotation, #3401 by @uriyyo - Mention Python >= 3.9.2 as an alternative to
typing_extensions.TypedDict, #3374 by @BvB93 - Changed the validator method name in the Custom Errors example
to more accurately describe what the validator is doing; changed from
name_must_contain_spacetovalue_must_equal_bar, #3327 by @michaelrios28 - Add
AmqpDsnclass, #3254 by @kludex - Always use
Enumvalue as default in generated JSON schema, #3190 by @joaommartins - Add support for Mypy 0.920, #3175 by @christianbundy
validate_argumentsnow supportsextracustomization (used to always beExtra.forbid), #3161 by @PrettyWood- Complex types can be set by nested environment variables, #3159 by @Air-Mark
- Fix mypy plugin to collect fields based on
pydantic.utils.is_valid_fieldso that it ignores untyped private variables, #3146 by @hi-ogawa - fix
validate_argumentsissue withConfig.validate_all, #3135 by @PrettyWood - avoid dict coercion when using dict subclasses as field type, #3122 by @PrettyWood
- add support for
objecttype, #3062 by @PrettyWood - Updates pydantic dataclasses to keep
_specialproperties on parent classes, #3043 by @zulrang - Add a
TypedDictclass for error objects, #3038 by @matthewhughes934 - Fix support for using a subclass of an annotation as a default, #3018 by @JacobHayes
- make
create_model_from_typeddictmypy compliant, #3008 by @PrettyWood - Make multiple inheritance work when using
PrivateAttr, #2989 by @hmvp - Parse environment variables as JSON, if they have a
Uniontype with a complex subfield, #2936 by @cbartz - Prevent
StrictStrpermittingEnumvalues where the enum inherits fromstr, #2929 by @samuelcolvin - Make
SecretsSettingsSourceparse values being assigned to fields of complex types when sourced from a secrets file, just as when sourced from environment variables, #2917 by @davidmreed - add a dark mode to pydantic documentation, #2913 by @gbdlin
- Make
pydantic-mypyplugin compatible withpyproject.tomlconfiguration, consistent withmypychanges. See the doc for more information, #2908 by @jrwalk - add python 3.10 support, #2885 by @PrettyWood
- Correctly parse generic models with
Json[T], #2860 by @geekingfrog - Update contrib docs re: python version to use for building docs, #2856 by @paxcodes
- Clarify documentation about pydantic's support for custom validation and strict type checking, despite pydantic being primarily a parsing library, #2855 by @paxcodes
- Fix schema generation for
Dequefields, #2810 by @sergejkozin - fix an edge case when mixing constraints and
Literal, #2794 by @PrettyWood - Fix postponed annotation resolution for
NamedTupleandTypedDictwhen they're used directly as the type of fields within Pydantic models, #2760 by @jameysharp - Fix bug when
mypyplugin fails onconstructmethod call forBaseSettingsderived classes, #2753 by @uriyyo - Add function overloading for a
pydantic.create_modelfunction, #2748 by @uriyyo - Fix mypy plugin issue with self field declaration, #2743 by @uriyyo
- The colon at the end of the line "The fields which were supplied when user was initialised:" suggests that the code following it is related. Changed it to a period, #2733 by @krisaoe
- Renamed variable
schematoschema_to avoid shadowing of global variable name, #2724 by @shahriyarr - Add support for autocomplete in VS Code via
__dataclass_transform__, #2721 by @tiangolo - add missing type annotations in
BaseConfigand handlemax_length = 0, #2719 by @PrettyWood - Change
orm_modechecking to allow recursive ORM mode parsing with dicts, #2718 by @nuno-andre - Add episode 313 of the Talk Python To Me podcast, where Michael Kennedy and Samuel Colvin discuss pydantic, to the docs, #2712 by @RatulMaharaj
- fix JSON schema generation when a field is of type
NamedTupleand has a default value, #2707 by @PrettyWood Enumfields now properly support extra kwargs in schema generation, #2697 by @sammchardy- Make serialization of referenced pydantic models possible, #2650 by @PrettyWood
- Add
uniqueItemsoption toConstrainedList, #2618 by @nuno-andre - Try to evaluate forward refs automatically at model creation, #2588 by @uriyyo
- Switch docs preview and coverage display to use smokeshow, #2580 by @samuelcolvin
- Add
__version__attribute to pydantic module, #2572 by @paxcodes - Add
postgresql+asyncpg,postgresql+pg8000,postgresql+psycopg2,postgresql+psycopg2cffi,postgresql+py-postgresqlandpostgresql+pygresqlschemes forPostgresDsn, #2567 by @postgres-asyncpg - Enable the Hypothesis plugin to generate a constrained decimal when the
decimal_placesargument is specified, #2524 by @cwe5590 - Allow
collections.abc.Callableto be used as type in python 3.9, #2519 by @daviskirk - Documentation update how to custom compile pydantic when using pip install, small change in
setup.pyto allow for custom CFLAGS when compiling, #2517 by @peterroelants - remove side effect of
default_factoryto run it only once even ifConfig.validate_allis set, #2515 by @PrettyWood - Add lookahead to ip regexes for
AnyUrlhosts. This allows urls with DNS labels looking like IPs to validate as they are perfectly valid host names, #2512 by @sbv-csis - Set
minItemsandmaxItemsin generated JSON schema for fixed-length tuples, #2497 by @PrettyWood - Add
strictargument toconbytes, #2489 by @koxudaxi - Support user defined generic field types in generic models, #2465 by @daviskirk
- Add an example and a short explanation of subclassing
GetterDictto docs, #2463 by @nuno-andre - add
KafkaDsntype,HttpUrlnow has default port 80 for http and 443 for https, #2447 by @MihanixA - Add
PastDateandFutureDatetypes, #2425 by @Kludex - Support generating schema for
Genericfields with subtypes, #2375 by @maximberg - fix(encoder): serialize
NameEmailto str, #2341 by @alecgerona - add
Config.smart_unionto prevent coercion inUnionif possible, see the doc for more information, #2092 by @PrettyWood - Add ability to use
typing.Counteras a model field type, #2060 by @uriyyo - Add parameterised subclasses to
__bases__when constructing new parameterised classes, so thatA <: B => A[int] <: B[int], #2007 by @diabolo-dan - Create
FileUrltype that allows URLs that conform to RFC 8089. Addhost_requiredparameter, which isTrueby default (AnyUrland subclasses),FalseinRedisDsn,FileUrl, #1983 by @vgerak - add
confrozenset(), analogous toconset()andconlist(), #1897 by @PrettyWood - stop calling parent class
root_validatorif overridden, #1895 by @PrettyWood - Add
repr(defaults toTrue) parameter toField, to hide it from the default representation of theBaseModel, #1831 by @fnep - Accept empty query/fragment URL parts, #1807 by @xavier
- Add "exclude" as a field parameter so that it can be configured using model config instead of purely at
.dict/.jsonexport time, #660 by @daviskirk
Full List of changes: https://github.com/samuelcolvin/pydantic/compare/v1.8.2...v1.9.0a1
- Python
Published by samuelcolvin over 4 years ago
pydantic - v1.8.2 (2021-05-11)
See Changelog.
Warning
A security vulnerability, level "moderate" is fixed in v1.8.2. Please upgrade ASAP. See security advisory CVE-2021-29510.
Changes
- Security fix: Fix
dateanddatetimeparsing so passing either'infinity'orfloat('inf')(or their negative values) does not cause an infinite loop, see security advisory CVE-2021-29510 - fix schema generation with Enum by generating a valid name, #2575 by @PrettyWood
- fix JSON schema generation with a
Literalof an enum member, #2536 by @PrettyWood - Fix bug with configurations declarations that are passed as keyword arguments during class creation, #2532 by @uriyyo
- Allow passing
json_encodersin class kwargs, #2521 by @layday - support arbitrary types with custom
__eq__, #2483 by @PrettyWood - support
Annotatedinvalidate_argumentsand in generic models with python 3.9, #2483 by @PrettyWood
- Python
Published by samuelcolvin about 5 years ago
pydantic - v1.7.4 (2021-05-11)
Security fix: Fix date and datetime parsing so passing either 'infinity' or float('inf') (or their negative values) does not cause an infinite loop, see security advisory CVE-2021-29510.
- Python
Published by samuelcolvin about 5 years ago
pydantic - v1.6.2 (2021-05-11)
Security fix: Fix date and datetime parsing so passing either 'infinity' or float('inf') (or their negative values) does not cause an infinite loop, see security advisory CVE-2021-29510.
- Python
Published by samuelcolvin about 5 years ago
pydantic - v1.8.1 (2021-03-03)
See Changelog.
Bug fixes for regressions and new features in v1.8
- allow elements of
Config.fieldto update elements of aField, #2461 by @samuelcolvin - fix validation with a
BaseModelfield and a custom root type, #2449 by @PrettyWood - expose
Patternencoder tofastapi, #2444 by @PrettyWood - enable the Hypothesis plugin to generate a constrained float when the
multiple_ofargument is specified, #2442 by @tobi-lipede-oodle - Avoid
RecursionErrorwhen using some types likeEnumorLiteralwith generic models, #2436 by @PrettyWood - do not overwrite declared
__hash__in subclasses of a model, #2422 by @PrettyWood - fix
mypycomplaints onPathandUUIDrelated custom types, #2418 by @PrettyWood - Support properly variable length tuples of compound types, #2416 by @PrettyWood
- Python
Published by samuelcolvin about 5 years ago