./devel/py-pydantic, Data validation and settings management using python type hints

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 2.7.0, Package name: py311-pydantic-2.7.0, Maintainer: pkgsrc-users

Data validation and settings management using Python type hints.

Fast and extensible, *pydantic* plays nicely with your
linters/IDE/brain. Define how data should be in pure, canonical
Python 3.6+; validate it with *pydantic*.


Master sites:

Filesize: 693.759 KB

Version history: (Expand)


CVS history: (Expand)


   2024-04-18 14:26:55 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-pydantic: updated to 2.7.0

v2.7.0 (2024-04-11)

Packaging

* Reorganize `pyproject.toml` sections
* Bump `pydantic-core` to `v2.18.1`
* Adopt `jiter` `v0.2.0`

New Features

* Extract attribute docstrings from `FieldInfo.description`
* Add a `with_config` decorator to comply with typing spec
* Allow an optional separator splitting the value and unit of the result of \ 
`ByteSize.human_readable`
* Add generic `Secret` base type
* Make use of `Sphinx` inventories for cross references in docs
* Add environment variable to disable plugins
* Add support for `deprecated` fields
* Allow `field_serializer('*')`
* Handle a case when `model_config` is defined as a model property
* Update `create_model()` to support `typing.Annotated` as input
* Add `ClickhouseDsn` support
* Add support for `re.Pattern[str]` to `pattern` field
* Support for `serialize_as_any` runtime setting
* Add support for `typing.Self`
* Ability to pass `context` to serialization
* Add feedback widget to docs with flarelytics integration
* Support for parsing partial JSON strings in Python

**Finalized in v2.7.0, rather than v2.7.0b1:**
* Add support for field level number to str coercion option
* Update `warnings` parameter for serialization utilities to allow raising a warning

Changes

* Correct docs, logic for `model_construct` behavior with `extra`
* Improve error message for improper `RootModel` subclasses
* Use `PEP570` syntax
* Add `enum` and `type` to the JSON schema for single item literals
* Deprecate `update_json_schema` internal function
* Serialize duration to hour minute second, instead of just seconds
* Trimming str before parsing to int and float

Performance

* `enum` validator improvements
* Move `enum` validation and serialization to Rust
* Improve schema generation for nested dataclasses
* Fast path for ASCII python string creation in JSON
* SIMD integer and string JSON parsing on `aarch64`(**Note:** SIMD on x86 will \ 
be implemented in a future release)
* Support JSON `Cow<str>` from `jiter`
* MAJOR performance improvement: update to PyO3 0.21 final
* cache Python strings

Fixes

* Fix strict parsing for some `Sequence`s
* Add a check on the existence of `__qualname__`
* Handle `__pydantic_extra__` annotation being a string or inherited
* Fix json validation for `NameEmail`
* Fix type-safety of attribute access in `BaseModel`
* Fix bug with `mypy` plugin and `no_strict_optional = True`
* Fix `ByteSize` error `type` change
* Fix inheriting annotations in dataclasses
* Fix regression in core schema generation for indirect definition references
* Fix unsupported types bug with plain validator
* Reverting problematic fix from 2.6 release, fixing schema building bug
* fixes `__pydantic_config__` ignored for TypeDict
* Fix test failures with `pytest v8.0.0` due to `pytest.warns()` starting to \ 
work inside `pytest.raises()`
* Use `is_valid_field` from 1.x for `mypy` plugin
* Better-support `mypy` strict equality flag
* model_json_schema export with Annotated types misses 'required' parameters
* Fix default inclusion in `FieldInfo.__repr_args__`
* Fix resolution of forward refs in dataclass base classes that are not present \ 
in the subclass module namespace
* Fix `BaseModel` type annotations to be resolvable by `typing.get_type_hints`
* Fix: allow empty string aliases with `AliasGenerator`
* Fix test along with `date` -> `datetime` timezone assumption fix
* Fix deprecation warning with usage of `ast.Str`
* Add missing `deprecated` decorators
* Fix serialization of `NameEmail` if name includes an email address
* Add information about class in error message of schema generation
* Make `TypeAdapter`'s typing compatible with special forms
* Fix issue with config behavior being baked into the ref schema for `enum`s
* More helpful error re wrong `model_json_schema` usage
* Fix nested discriminated union schema gen, pt 2
* Fix schema build for nested dataclasses / TypedDicts with discriminators
* Remove unnecessary logic for definitions schema gen with discriminated unions
* Fix handling of optionals in `mypy` plugin
* Fix `PlainSerializer` usage with std type constructor
* Remove unnecessary warning for config in plugin
* Fix default value serializing
* Fix extra fields check in `Model.__getattr__()`
* Fix `ClassVar` forward ref inherited from parent class
* fix sequence like validator with strict `True`
* Improve warning message when a field name shadows a field in a parent model
* Do not warn about shadowed fields if they are not redefined in a child class
* Fix discriminated union bug with unsubstituted type var
* Support serialization of `deque` when passed to `Sequence[blah blah blah]`
* Init private attributes from super-types in `model_post_init`
* fix `model_construct` with `validation_alias`
* Ensure json-schema generator handles `Literal` `null` types
* **Fixed in v2.7.0**: Fix allow extra generic
   2024-03-17 13:53:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.6.4

v2.6.4 (2024-03-08)

Fixes

* Fix usage of `AliasGenerator` with `computed_field` decorator
* Fix nested discriminated union schema gen, pt 2
* Fix bug with no_strict_optional=True caused by API deferral
   2024-02-28 09:15:30 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.6.3

v2.6.3 (2024-02-27)

Packaging

* Update `pydantic-settings` version in the docs

Fixes

* Fix discriminated union schema gen bug
   2024-02-25 23:55:41 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.6.2

v2.6.2 (2024-02-23)

Packaging

Upgrade to pydantic-core 2.16.3

Fixes

'YYYY-MM-DD' date string coerced to datetime shouldn't infer timezone
   2024-02-05 22:20:28 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 2.6.1

v2.6.1 (2024-02-05)

Packaging

* Upgrade to `pydantic-core` 2.16.2

Fixes

* Fix bug with `mypy` plugin and `no_strict_optional = True`
* Fix `ByteSize` error `type` change
* Fix inheriting `Field` annotations in dataclasses
* Fix regression in core schema generation for indirect definition references
* Fix unsupported types bug with `PlainValidator`
* Reverting problematic fix from 2.6 release, fixing schema building bug
* Fix warning for tuple of wrong size in `Union`
* Fix `computed_field` JSON serializer `exclude_none` behavior
   2024-01-31 01:03:49 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-pydantic: updated to 2.6.0

v2.6.0 (2024-01-23)

The code released in v2.6.0 is practically identical to that of v2.6.0b1.

What's Changed

Packaging

* Check for `email-validator` version >= 2.0
* Upgrade `ruff`` target version to Python 3.8
* Update to `pydantic-extra-types==2.4.1`
* Update to `pyright==1.1.345`
* Update pydantic-core from 2.14.6 to 2.16.1, significant changes from these \ 
updates are described below, full changelog \ 
[here](https://github.com/pydantic/pydantic-core/compare/v2.14.6...v2.16.1)

New Features

* Add `NatsDsn`
* Add `ConfigDict.ser_json_inf_nan`
* Add `types.OnErrorOmit`
* Support `AliasGenerator` usage
* Add Pydantic People Page to docs
* Support `yyyy-MM-DD` datetime parsing
* Added bits conversions to the `ByteSize`
* Enable json schema creation with type `ByteSize`
* Add `eval_type_backport` to handle union operator and builtin generic \ 
subscripting in older Pythons
* Add support for `dataclass` fields `init`
* Implement pickling for `ValidationError`
* Add unified tuple validator that can handle "variadic" tuples via PEP-646

Changes

* Drop Python3.7 support
* Drop Python 3.7, and PyPy 3.7 and 3.8
* Use positional-only `self` in `BaseModel` constructor, so no field name can \ 
ever conflict with it
* Make `@validate_call` return a function instead of a custom descriptor - fixes \ 
binding issue with inheritance and adds `self/cls` argument to validation errors
* Exclude `BaseModel` docstring from JSON schema description
* Introducing `classproperty` decorator for `model_computed_fields`
* Explicitly raise an error if field names clashes with types
* Use stricter serializer for unions of simple types

Performance

* Add Codspeed profiling Actions workflow
* Improve `int` extraction
* Improve performance of recursion guard
* `dataclass` serialization speedups
* Avoid `HashMap` creation when looking up small JSON objects in `LazyIndexMaps`
* use hashbrown to speedup python string caching
* Replace `Peak` with more efficient `Peek`

Fixes

* Move `getattr` warning in deprecated `BaseConfig`
* Only hash `model_fields`, not whole `__dict__`
* Fix mishandling of unions while freezing types in the `mypy` plugin
* Fix `mypy` error on untyped `ClassVar`
* Only compare pydantic fields in `BaseModel.__eq__` instead of whole `__dict__`
* Update `strict` docstring in `model_validate` method.
* Fix overload position of `computed_field`
* Fix custom type type casting used in multiple attributes
* Fix issue not allowing `validate_call` decorator to be dynamically assigned to \ 
a class method
* Fix issue `unittest.mock` deprecation warnings
* Added tests for the case `JsonValue` contains subclassed primitive values
* Fix `mypy` error on free before validator (classmethod)
* Fix `to_snake` conversion
* Fix type annotation of `ModelMetaclass.__prepare__`
* Disallow `config` specification when initializing a `TypeAdapter` when the \ 
annotated type has config already
* Fix a naming issue with JSON schema for generics parametrized by recursive \ 
type aliases
* Fix type annotation in pydantic people script
* Add support for field `alias` in `dataclass` signature
* Fix bug with schema generation with `Field(...)` in a forward ref
* Fix ordering of keys in `__dict__` with `model_construct` call
* Fix module `path_type` creation when globals does not contain `__name__`
* Fix for namespace issue with dataclasses with `from __future__ import annotations`
* Fix: make function validator types positional-only
* Fix usage of `@deprecated`
* Add more support for private attributes in `model_construct` call
* Use a stack for the types namespace
* Fix schema-building bug with `TypeAliasType` for types with refs
* Support `pydantic.Field(repr=False)` in dataclasses
* Override `dataclass_transform` behavior for `RootModel`
* Refactor signature generation for simplicity
* Fix ordering bug of PlainValidator annotation
* Fix `exclude_none` for json serialization of `computed_field`s
* Support yyyy-MM-DD string for datetimes
* Tweak ordering of definitions in generated schemas
   2023-06-09 11:39:32 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 1.10.9

v1.10.9 (2023-06-07)
* Fix trailing zeros not ignored in Decimal validation,
* Fix mypy plugin for v1.4.0,
* Add future and past date hypothesis strategies,
* Discourage usage of Cython 3 with Pydantic 1.x
   2023-05-29 20:00:36 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-pydantic: updated to 1.10.8

v1.10.8 (2023-05-23)

* Fix a bug in `Literal` usage with `typing-extension==4.6.0`
* Update email-validator dependency to >=2.0.0post2
* update `AnyClassMethod` for changes