Path to this page:
Subject: CVS commit: pkgsrc/devel/py-pydantic
From: Adam Ciarcinski
Date: 2022-10-25 11:15:04
Message id: 20221025091504.C64AAFA90@cvs.NetBSD.org
Log Message:
py-pydantic: updated to 1.10.2
v1.10.2 (2022-09-05)
* **Revert Change:** Revert percent encoding of URL parts which was originally \
added in
* Prevent long (length > `4_300`) strings/bytes as input to int fields, see
[CVE-2020-10735](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735),
* fix: dataclass wrapper was not always called,
* Use `tomllib` on Python 3.11 when parsing `mypy` configuration,
* Basic fix of `GenericModel` cache to detect order of arguments in `Union` models,
* Fix mypy plugin when using bare types like `list` and `dict` as `default_factory`,
v1.10.1 (2022-08-31)
* Add `__hash__` method to `pydancic.color.Color` class,
v1.10.0 (2022-08-30)
* Refactor the whole _pydantic_ `dataclass` decorator 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 of `frozen` dataclasses in fields and usage of \
`default_factory` in nested dataclasses.
The support of `Config.extra` has been added.
Finally, config customization directly via a `dict` is now possible,
<br/><br/>
**BREAKING CHANGES:**
- The `compiled` boolean (whether _pydantic_ is compiled with cython) has been \
moved from `main.py` to `version.py`
- Now that `Config.extra` is supported, `dataclass` ignores by default extra \
arguments (like `BaseModel`)
* Fix PEP487 `__set_name__` protocol in `BaseModel` for PrivateAttrs,
* Allow for custom parsing of environment variables via `parse_env_var` in `Config`,
* Rename `master` to `main`,
* Fix `StrictStr` does not raise `ValidationError` when `max_length` is present \
in `Field`,
* Make `SecretStr` and `SecretBytes` hashable,
* Fix `StrictBytes` does not raise `ValidationError` when `max_length` is \
present in `Field`,
* Add support for bare `type`,
* Support Python 3.11, including binaries for 3.11 in PyPI,
* Add support for `re.Pattern`,
* Fix `__post_init_post_parse__` is incorrectly passed keyword arguments when no \
`__post_init__` is defined,
* Fix implicitly importing `ForwardRef` and `Callable` from `pydantic.typing` \
instead of `typing` and also expose `MappingIntStrAny`,
* remove `Any` types from the `dataclass` decorator so it can be used with the \
`disallow_any_expr` mypy option,
* moved repo to `pydantic/pydantic`,
* fix "extra fields not permitted" error when dataclass with \
`Extra.forbid` is validated multiple times,
* Add Python 3.9 and 3.10 examples to docs,
* Discriminated union models now use `oneOf` instead of `anyOf` when generating \
OpenAPI schema definitions,
* Allow type checkers to infer inner type of `Json` type. `Json[list[str]]` will \
be now inferred as `list[str]`,
`Json[Any]` should be used instead of plain `Json`.
Runtime behaviour is not changed,
* Allow empty string aliases by using a `alias is not None` check, rather than \
`bool(alias)`,
* Update `ForwardRef`s in `Field.outer_type_`,
* The use of `__dataclass_transform__` has been replaced by \
`typing_extensions.dataclass_transform`, which is the preferred way to mark \
pydantic models as a dataclass under [PEP \
681](https://peps.python.org/pep-0681/),
* Use parent model's `Config` when validating nested `NamedTuple` fields,
* Update `BaseModel.construct` to work with aliased Fields,
* Catch certain raised errors in `smart_deepcopy` and revert to `deepcopy` if so,
* Add `Config.anystr_upper` and `to_upper` kwarg to constr and conbytes,
* Fix JSON schema for `set` and `frozenset` when they include default values,
* Teach the mypy plugin that methods decorated by `@validator` are classmethods,
* Improve mypy plugin's ability to detect required fields,
* Support fields of type `Type[]` in schema,
* Add `default` value in JSON Schema when `const=True`,
* Adds reserved word check to signature generation logic,
* Fix Json strategy failure for the complex nested field,
* Add JSON-compatible float constraint `allow_inf_nan`,
* Remove undefined behaviour when `env_prefix` had characters in common with \
`env_nested_delimiter`,
* Support generics model with `create_model`,
* allow submodels to overwrite extra field info,
* Document and test structural pattern matching ([PEP \
636](https://peps.python.org/pep-0636/)) on `BaseModel`,
* 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"),
* Fix validation of discriminated union fields with an alias when passing a \
model instance,
* Add a CockroachDsn type to validate CockroachDB connection strings. The type
supports the following schemes: `cockroachdb`, `cockroachdb+psycopg2` and \
`cockroachdb+asyncpg`,
* Fix MyPy plugin to not override pre-existing `__init__` method in models,
* Fix mypy version checking,
* support overwriting dunder attributes of `BaseModel` instances,
* Added `ConstrainedDate` and `condate`,
* Support `kw_only` in dataclasses,
* Add comparison method for `Color` class,
* Drop support for python3.6, associated cleanup,
* created new function `to_lower_camel()` for "non pascal case" camel case,
* Add checks to `default` and `default_factory` arguments in Mypy plugin,
* fix mangling of `inspect.signature` for `BaseModel`,
* Adds the `SecretField` abstract class so that all the current and future \
secret fields like `SecretStr` and `SecretBytes` will derive from it,
* Support multi hosts validation in `PostgresDsn`,
* Fix parsing of very small numeric timedelta values,
* Update `SecretsSettingsSource` to respect `config.case_sensitive`,
* Add MongoDB network data source name (DSN) schema,
* Add support for multiple dotenv files,
* Raise an explicit `ConfigError` when multiple fields are incorrectly set for a \
single validator,
* Allow ellipsis on `Field`s inside `Annotated` for `TypedDicts` required,
* Catch overflow errors in `int_validator`,
* Adds a `__rich_repr__` method to `Representation` class which enables pretty \
printing with [Rich](https://github.com/willmcgugan/rich),
* Add percent encoding in `AnyUrl` and descendent types,
* `validate_arguments` decorator now supports `alias`,
* Avoid `__dict__` and `__weakref__` attributes in `AnyUrl` and IP address fields,
* Add ability to use `Final` in a field type annotation,
* Update requirement to `typing_extensions>=4.1.0` to guarantee \
`dataclass_transform` is available,
* Add Explosion and AWS to main sponsors,
* Update documentation for `copy_on_model_validation` to reflect recent changes,
* Runtime warning if `__slots__` is passed to `create_model`, `__slots__` is \
then ignored,
* Add type hints to `BaseSettings.Config` to avoid mypy errors, also correct \
mypy version compatibility notice in docs
Files: