Skip to content

Commit

Permalink
Prepare for v2.2.0 (#7157)
Browse files Browse the repository at this point in the history
Co-authored-by: Serge Matveenko <lig@pydantic.dev>
  • Loading branch information
dmontagu and lig committed Aug 17, 2023
1 parent 61737ea commit d5a4221
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 18 deletions.
64 changes: 64 additions & 0 deletions HISTORY.md
@@ -1,3 +1,67 @@
## v2.2.0 (2023-08-17)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.2.0)

* Split "pipx install" setup command into two commands on the documentation site by @nomadmtb in [#6869](https://github.com/pydantic/pydantic/pull/6869)
* Deprecate `Field.include` by @hramezani in [#6852](https://github.com/pydantic/pydantic/pull/6852)
* Fix typo in default factory error msg by @hramezani in [#6880](https://github.com/pydantic/pydantic/pull/6880)
* Simplify handling of typing.Annotated in GenerateSchema by @dmontagu in [#6887](https://github.com/pydantic/pydantic/pull/6887)
* Re-enable fastapi tests in CI by @dmontagu in [#6883](https://github.com/pydantic/pydantic/pull/6883)
* Make it harder to hit collisions with json schema defrefs by @dmontagu in [#6566](https://github.com/pydantic/pydantic/pull/6566)
* Cleaner error for invalid input to `Path` fields by @samuelcolvin in [#6903](https://github.com/pydantic/pydantic/pull/6903)
* :memo: support Coordinate Type by @yezz123 in [#6906](https://github.com/pydantic/pydantic/pull/6906)
* Fix `ForwardRef` wrapper for py 3.10.0 (shim until bpo-45166) by @randomir in [#6919](https://github.com/pydantic/pydantic/pull/6919)
* Fix misbehavior related to copying of RootModel by @dmontagu in [#6918](https://github.com/pydantic/pydantic/pull/6918)
* Fix issue with recursion error caused by ParamSpec by @dmontagu in [#6923](https://github.com/pydantic/pydantic/pull/6923)
* Add section about Constrained classes to the Migration Guide by @Kludex in [#6924](https://github.com/pydantic/pydantic/pull/6924)
* Use `main` branch for badge links by @Viicos in [#6925](https://github.com/pydantic/pydantic/pull/6925)
* Add test for v1/v2 Annotated discrepancy by @carlbordum in [#6926](https://github.com/pydantic/pydantic/pull/6926)
* Make the v1 mypy plugin work with both v1 and v2 by @dmontagu in [#6921](https://github.com/pydantic/pydantic/pull/6921)
* Fix issue where generic models couldn't be parametrized with BaseModel by @dmontagu in [#6933](https://github.com/pydantic/pydantic/pull/6933)
* Remove xfail for discriminated union with alias by @dmontagu in [#6938](https://github.com/pydantic/pydantic/pull/6938)
* add field_serializer to computed_field by @andresliszt in [#6965](https://github.com/pydantic/pydantic/pull/6965)
* Use union_schema with Type[Union[...]] by @JeanArhancet in [#6952](https://github.com/pydantic/pydantic/pull/6952)
* Fix inherited typeddict attributes / config by @adriangb in [#6981](https://github.com/pydantic/pydantic/pull/6981)
* fix dataclass annotated before validator called twice by @davidhewitt in [#6998](https://github.com/pydantic/pydantic/pull/6998)
* Update test-fastapi deselected tests by @hramezani in [#7014](https://github.com/pydantic/pydantic/pull/7014)
* Fix validator doc format by @hramezani in [#7015](https://github.com/pydantic/pydantic/pull/7015)
* Fix typo in docstring of model_json_schema by @AdamVinch-Federated in [#7032](https://github.com/pydantic/pydantic/pull/7032)
* remove unused "type ignores" with pyright by @samuelcolvin in [#7026](https://github.com/pydantic/pydantic/pull/7026)
* Add benchmark representing FastAPI startup time by @adriangb in [#7030](https://github.com/pydantic/pydantic/pull/7030)
* Fix json_encoders for Enum subclasses by @adriangb in [#7029](https://github.com/pydantic/pydantic/pull/7029)
* Update docstring of `ser_json_bytes` regarding base64 encoding by @Viicos in [#7052](https://github.com/pydantic/pydantic/pull/7052)
* Allow `@validate_call` to work on async methods by @adriangb in [#7046](https://github.com/pydantic/pydantic/pull/7046)
* Fix: mypy error with `Settings` and `SettingsConfigDict` by @JeanArhancet in [#7002](https://github.com/pydantic/pydantic/pull/7002)
* Fix some typos (repeated words and it's/its) by @eumiro in [#7063](https://github.com/pydantic/pydantic/pull/7063)
* Fix the typo in docstring by @harunyasar in [#7062](https://github.com/pydantic/pydantic/pull/7062)
* Docs: Fix broken URL in the pydantic-settings package recommendation by @swetjen in [#6995](https://github.com/pydantic/pydantic/pull/6995)
* Handle constraints being applied to schemas that don't accept it by @adriangb in [#6951](https://github.com/pydantic/pydantic/pull/6951)
* Replace almost_equal_floats with math.isclose by @eumiro in [#7082](https://github.com/pydantic/pydantic/pull/7082)
* bump pydantic-core to 2.5.0 by @davidhewitt in [#7077](https://github.com/pydantic/pydantic/pull/7077)
* Add `short_version` and use it in links by @hramezani in [#7115](https://github.com/pydantic/pydantic/pull/7115)
* 📝 Add usage link to `RootModel` by @Kludex in [#7113](https://github.com/pydantic/pydantic/pull/7113)
* Revert "Fix default port for mongosrv DSNs (#6827)" by @Kludex in [#7116](https://github.com/pydantic/pydantic/pull/7116)
* Clarify validate_default and _Unset handling in usage docs and migration guide by @benbenbang in [#6950](https://github.com/pydantic/pydantic/pull/6950)
* Tweak documentation of `Field.exclude` by @Viicos in [#7086](https://github.com/pydantic/pydantic/pull/7086)
* Do not require `validate_assignment` to use `Field.frozen` by @Viicos in [#7103](https://github.com/pydantic/pydantic/pull/7103)
* tweaks to `_core_utils` by @samuelcolvin in [#7040](https://github.com/pydantic/pydantic/pull/7040)
* Make DefaultDict working with set by @hramezani in [#7126](https://github.com/pydantic/pydantic/pull/7126)
* Don't always require typing.Generic as a base for partially parametrized models by @dmontagu in [#7119](https://github.com/pydantic/pydantic/pull/7119)
* Fix issue with JSON schema incorrectly using parent class core schema by @dmontagu in [#7020](https://github.com/pydantic/pydantic/pull/7020)
* Fix xfailed test related to TypedDict and alias_generator by @dmontagu in [#6940](https://github.com/pydantic/pydantic/pull/6940)
* Improve error message for NameEmail by @dmontagu in [#6939](https://github.com/pydantic/pydantic/pull/6939)
* Fix generic computed fields by @dmontagu in [#6988](https://github.com/pydantic/pydantic/pull/6988)
* Reflect namedtuple default values during validation by @dmontagu in [#7144](https://github.com/pydantic/pydantic/pull/7144)
* Update dependencies, fix pydantic-core usage, fix CI issues by @dmontagu in [#7150](https://github.com/pydantic/pydantic/pull/7150)
* Add mypy 1.5.0 by @hramezani in [#7118](https://github.com/pydantic/pydantic/pull/7118)
* Handle non-json native enum values by @adriangb in [#7056](https://github.com/pydantic/pydantic/pull/7056)
* document `round_trip` in Json type documentation by @jc-louis in [#7137](https://github.com/pydantic/pydantic/pull/7137)
* Relax signature checks to better support builtins and C extension functions as validators by @adriangb in [#7101](https://github.com/pydantic/pydantic/pull/7101)
* add union_mode='left_to_right' by @davidhewitt in [#7151](https://github.com/pydantic/pydantic/pull/7151)
* Include an error message hint for inherited ordering by @yvalencia91 in [#7124](https://github.com/pydantic/pydantic/pull/7124)
* Fix one docs link and resolve some warnings for two others by @dmontagu in [#7153](https://github.com/pydantic/pydantic/pull/7153)
* Include Field extra keys name in warning by @hramezani in [#7136](https://github.com/pydantic/pydantic/pull/7136)

## v2.1.1 (2023-07-25)

[GitHub release](https://github.com/pydantic/pydantic/releases/tag/v2.1.1)
Expand Down
2 changes: 1 addition & 1 deletion pydantic/config.py
Expand Up @@ -28,7 +28,7 @@


class ConfigDict(TypedDict, total=False):
"""Usage docs: https://docs.pydantic.dev/2.0/usage/model_config/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/model_config/
A TypedDict for configuring Pydantic behaviour.
"""
Expand Down
2 changes: 1 addition & 1 deletion pydantic/dataclasses.py
Expand Up @@ -107,7 +107,7 @@ def dataclass(
kw_only: bool = False,
slots: bool = False,
) -> Callable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/dataclasses/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/dataclasses/
A decorator used to create a Pydantic-enhanced dataclass, similar to the standard Python `dataclass`,
but with added validation.
Expand Down
8 changes: 4 additions & 4 deletions pydantic/fields.py
Expand Up @@ -574,7 +574,7 @@ def __repr_args__(self) -> ReprArgs:

@dataclasses.dataclass(**_internal_dataclass.slots_true)
class AliasPath:
"""usage docs: https://docs.pydantic.dev/2.0/usage/fields#aliaspath-and-aliaschoices
"""Usage docs: https://docs.pydantic.dev/2.2/usage/fields#aliaspath-and-aliaschoices
A data class used by `validation_alias` as a convenience to create aliases.
Expand All @@ -598,7 +598,7 @@ def convert_to_aliases(self) -> list[str | int]:

@dataclasses.dataclass(**_internal_dataclass.slots_true)
class AliasChoices:
"""usage docs: https://docs.pydantic.dev/2.0/usage/fields#aliaspath-and-aliaschoices
"""Usage docs: https://docs.pydantic.dev/2.2/usage/fields#aliaspath-and-aliaschoices
A data class used by `validation_alias` as a convenience to create aliases.
Expand Down Expand Up @@ -697,7 +697,7 @@ def Field( # noqa: C901
union_mode: Literal['smart', 'left_to_right'] = _Unset,
**extra: Unpack[_EmptyKwargs],
) -> Any:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/fields
"""Usage docs: https://docs.pydantic.dev/2.2/usage/fields
Create a field for objects that can be configured.
Expand Down Expand Up @@ -1001,7 +1001,7 @@ def computed_field(
repr: bool = True,
return_type: Any = PydanticUndefined,
) -> PropertyT | typing.Callable[[PropertyT], PropertyT]:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/computed_fields/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/computed_fields/
Decorator to include `property` and `cached_property` when serializing models.
Expand Down
10 changes: 5 additions & 5 deletions pydantic/functional_validators.py
Expand Up @@ -32,7 +32,7 @@

@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)
class AfterValidator:
'''usage docs: https://docs.pydantic.dev/2.0/usage/validators/#annotated-validators
'''Usage docs: https://docs.pydantic.dev/2.2/usage/validators/#annotated-validators
A metadata class that indicates that a validation should be applied **after** the inner validation logic.
Expand Down Expand Up @@ -87,7 +87,7 @@ def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchema

@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)
class BeforeValidator:
"""usage docs: https://docs.pydantic.dev/2.0/usage/validators/#annotated-validators
"""Usage docs: https://docs.pydantic.dev/2.2/usage/validators/#annotated-validators
A metadata class that indicates that a validation should be applied **before** the inner validation logic.
Expand Down Expand Up @@ -129,7 +129,7 @@ def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchema

@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)
class PlainValidator:
"""usage docs: https://docs.pydantic.dev/2.0/usage/validators/#annotated-validators
"""Usage docs: https://docs.pydantic.dev/2.2/usage/validators/#annotated-validators
A metadata class that indicates that a validation should be applied **instead** of the inner validation logic.
Expand Down Expand Up @@ -164,7 +164,7 @@ def __get_pydantic_core_schema__(self, source_type: Any, handler: _GetCoreSchema

@dataclasses.dataclass(frozen=True, **_internal_dataclass.slots_true)
class WrapValidator:
"""usage docs: https://docs.pydantic.dev/2.0/usage/validators/#annotated-validators
"""Usage docs: https://docs.pydantic.dev/2.2/usage/validators/#annotated-validators
A metadata class that indicates that a validation should be applied **around** the inner validation logic.
Expand Down Expand Up @@ -287,7 +287,7 @@ def field_validator(
mode: FieldValidatorModes = 'after',
check_fields: bool | None = None,
) -> Callable[[Any], Any]:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/validators/#field-validators
"""Usage docs: https://docs.pydantic.dev/2.2/usage/validators/#field-validators
Decorate methods on the class indicating that they should be used to validate fields.
Expand Down
6 changes: 3 additions & 3 deletions pydantic/main.py
Expand Up @@ -59,7 +59,7 @@


class BaseModel(metaclass=_model_construction.ModelMetaclass):
"""usage docs: https://docs.pydantic.dev/2.0/usage/models/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/models/
A base class for creating Pydantic models.
Expand Down Expand Up @@ -278,7 +278,7 @@ def model_dump(
round_trip: bool = False,
warnings: bool = True,
) -> dict[str, Any]:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/serialization/#modelmodel_dump
"""Usage docs: https://docs.pydantic.dev/2.2/usage/serialization/#modelmodel_dump
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Expand Down Expand Up @@ -324,7 +324,7 @@ def model_dump_json(
round_trip: bool = False,
warnings: bool = True,
) -> str:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/serialization/#modelmodel_dump_json
"""Usage docs: https://docs.pydantic.dev/2.2/usage/serialization/#modelmodel_dump_json
Generates a JSON representation of the model using Pydantic's `to_json` method.
Expand Down
2 changes: 1 addition & 1 deletion pydantic/root_model.py
Expand Up @@ -25,7 +25,7 @@


class RootModel(BaseModel, typing.Generic[RootModelRootType]):
"""usage docs: https://docs.pydantic.dev/2.1/usage/models/#rootmodel-and-custom-root-types
"""Usage docs: https://docs.pydantic.dev/2.2/usage/models/#rootmodel-and-custom-root-types
A Pydantic `BaseModel` for the root object of the model.
Expand Down
2 changes: 1 addition & 1 deletion pydantic/type_adapter.py
Expand Up @@ -98,7 +98,7 @@ def _getattr_no_parents(obj: Any, attribute: str) -> Any:


class TypeAdapter(Generic[T]):
"""usage docs: https://docs.pydantic.dev/2.0/usage/type_adapter/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/type_adapter/
Type adapters provide a flexible way to perform validation and serialization based on a Python type.
Expand Down
2 changes: 1 addition & 1 deletion pydantic/validate_call.py
Expand Up @@ -31,7 +31,7 @@ def validate_call(
config: ConfigDict | None = None,
validate_return: bool = False,
) -> AnyCallableT | Callable[[AnyCallableT], AnyCallableT]:
"""Usage docs: https://docs.pydantic.dev/dev-v2/usage/validation_decorator/
"""Usage docs: https://docs.pydantic.dev/2.2/usage/validation_decorator/
Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value.
Expand Down
2 changes: 1 addition & 1 deletion pydantic/version.py
Expand Up @@ -3,7 +3,7 @@

__all__ = 'VERSION', 'version_info'

VERSION = '2.1.1'
VERSION = '2.2.0'
"""The version of Pydantic."""


Expand Down

0 comments on commit d5a4221

Please sign in to comment.