- Update to 25.3.0:
* Potentially breaking: Abstract sets are now structured into frozensets.
* Python 3.14 is now supported and part of the test matrix.
* Fix unstructuring NewTypes with the {class}BaseConverter.
* Make some Hypothesis tests more robust.
* {func}cattrs.strategies.include_subclasses now works with generic parent
classes and the tagged union strategy.
* Potentially breaking: Sequences are now structured into tuples.
* Add a use_alias parameter to cattrs.Converter.
* The union passthrough strategy now by default accepts ints for unions
that contain floats but not ints, when configured to be able to handle
both ints and floats. This more closely matches the current typing
behavior.
* Fix unstructuring of generic classes with stringified annotations.
* The default disambiguation hook factory is now only enabled for
converters with unstructure_strat=AS_DICT (the default).
* Switch to uv and just in lieu of PDM, tox and Make.
* Fixed AttributeError: no attribute '__parameters__' while structuring
attrs classes that inherit from parametrized generic aliases from
collections.abc.
* Potentially breaking: The converters raise StructureHandlerNotFoundError
more eagerly (on hook creation, instead of on hook use). This helps
surfacing problems with missing hooks sooner.
* typing.Self is now supported in attrs classes, dataclasses, TypedDicts
and the dict NamedTuple factories. See typing.Self for details.
* PEP 695 type aliases can now be used with
BaseConverter.register_structure_hook and
BaseConverter.register_unstructure_hook. Previously, they required the
use of BaseConverter.register_structure_hook_func.
* Some defaultdicts are now supported by default, and
OBS-URL: https://build.opensuse.org/request/show/1318119
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cattrs?expand=0&rev=8
* Potentially breaking: Abstract sets are now structured into frozensets.
* Python 3.14 is now supported and part of the test matrix.
* Fix unstructuring NewTypes with the {class}BaseConverter.
* Make some Hypothesis tests more robust.
* {func}cattrs.strategies.include_subclasses now works with generic parent
classes and the tagged union strategy.
* Potentially breaking: Sequences are now structured into tuples.
* Add a use_alias parameter to cattrs.Converter.
* The union passthrough strategy now by default accepts ints for unions
that contain floats but not ints, when configured to be able to handle
both ints and floats. This more closely matches the current typing
behavior.
* Fix unstructuring of generic classes with stringified annotations.
* The default disambiguation hook factory is now only enabled for
converters with unstructure_strat=AS_DICT (the default).
* Switch to uv and just in lieu of PDM, tox and Make.
* Fixed AttributeError: no attribute '__parameters__' while structuring
attrs classes that inherit from parametrized generic aliases from
collections.abc.
* Potentially breaking: The converters raise StructureHandlerNotFoundError
more eagerly (on hook creation, instead of on hook use). This helps
surfacing problems with missing hooks sooner.
* typing.Self is now supported in attrs classes, dataclasses, TypedDicts
and the dict NamedTuple factories. See typing.Self for details.
* PEP 695 type aliases can now be used with
BaseConverter.register_structure_hook and
BaseConverter.register_unstructure_hook. Previously, they required the
use of BaseConverter.register_structure_hook_func.
* Some defaultdicts are now supported by default, and
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cattrs?expand=0&rev=15
- update to 24.1.2:
* Fix {meth}`BaseConverter.register_structure_hook` and
{meth}`BaseConverter.register_unstructure_hook` type hints.
* Fix {meth}`BaseConverter.register_structure_hook_factory` and
{meth}`BaseConverter.register_unstructure_hook_factory` type
hints.
* **Potentially breaking**: Unstructuring hooks for
`typing.Any` are consistent now: values are unstructured
using their runtime type.
* Introduce {meth}`BaseConverter.get_structure_hook` and
{meth}`BaseConverter.get_unstructure_hook` methods.
* Enhance the {func}`cattrs.cols.is_mapping` predicate function
to also cover virtual subclasses of `abc.Mapping`.
* Introduce the _msgspec_ {mod}`preconf converter
<cattrs.preconf.msgspec>`.
* Add support for PEP 695 type aliases.
* Add support for PEP 696 `TypeVar`s with defaults.
* Add support for named tuples with type metadata
(`typing.NamedTuple`).
* Add support for optionally un/unstructuring named tuples
using dictionaries.
* PEP 695 generics are now tested.
* Imports are now sorted using Ruff.
* Tests are run with the pytest-xdist plugin by default.
* Rework the introductory parts of the documentation,
introducing the Basics section.
* The documentation has been significantly reworked.
* The docs now use the Inter font.
* Make type annotations for `include_subclasses` and
`tagged_union` strategies more lenient.
OBS-URL: https://build.opensuse.org/request/show/1218887
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-cattrs?expand=0&rev=5
* Fix {meth}`BaseConverter.register_structure_hook` and
{meth}`BaseConverter.register_unstructure_hook` type hints.
* Fix {meth}`BaseConverter.register_structure_hook_factory` and
{meth}`BaseConverter.register_unstructure_hook_factory` type
hints.
* **Potentially breaking**: Unstructuring hooks for
`typing.Any` are consistent now: values are unstructured
using their runtime type.
* Introduce {meth}`BaseConverter.get_structure_hook` and
{meth}`BaseConverter.get_unstructure_hook` methods.
* Enhance the {func}`cattrs.cols.is_mapping` predicate function
to also cover virtual subclasses of `abc.Mapping`.
* Introduce the _msgspec_ {mod}`preconf converter
<cattrs.preconf.msgspec>`.
* Add support for PEP 695 type aliases.
* Add support for PEP 696 `TypeVar`s with defaults.
* Add support for named tuples with type metadata
(`typing.NamedTuple`).
* Add support for optionally un/unstructuring named tuples
using dictionaries.
* PEP 695 generics are now tested.
* Imports are now sorted using Ruff.
* Tests are run with the pytest-xdist plugin by default.
* Rework the introductory parts of the documentation,
introducing the Basics section.
* The documentation has been significantly reworked.
* The docs now use the Inter font.
* Make type annotations for `include_subclasses` and
`tagged_union` strategies more lenient.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cattrs?expand=0&rev=9