Skip to content

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 18, 2025

Coming soon: The Renovate bot (GitHub App) will be renamed to Mend. PRs from Renovate will soon appear from 'Mend'. Learn more here.

This PR contains the following updates:

Package Change Age Confidence
cattrs (changelog) ==24.1.3 -> ==25.2.0 age confidence

Release Notes

python-attrs/cattrs (cattrs)

v25.2.0

Compare Source

  • Potentially breaking: Sequences are now structured into tuples.
    This allows hashability, better immutability and is more consistent with the collections.abc.Sequence type.
    See Migrations for steps to restore legacy behavior.
    (#​663)
  • Add a use_alias parameter to {class}cattrs.Converter.
    {func}cattrs.gen.make_dict_unstructure_fn_from_attrs, {func}cattrs.gen.make_dict_unstructure_fn,
    {func}cattrs.gen.make_dict_structure_fn_from_attrs, {func}cattrs.gen.make_dict_structure_fn
    and {func}cattrs.gen.typeddicts.make_dict_structure_fn will use the value for the use_alias parameter from the given converter by default now.
    If you're using these functions directly, the old behavior can be restored by passing in the desired value directly.
    (#​596 #​660)
  • 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.
    (#​656 #​668)
  • Fix unstructuring of generic classes with stringified annotations.
    (#​661 #​662
  • For {class}cattrs.errors.StructureHandlerNotFoundError and {class}cattrs.errors.ForbiddenExtraKeysError
    correctly set {attr}BaseException.args in super() and hence make them pickable.
    (#​666)
  • The default disambiguation hook factory is now only enabled for converters with unstructure_strat=AS_DICT (the default).
    Since the strategy doesn't support tuples, it is skipped for unstructure_strat=AS_TUPLE converters.
    (#​673)
  • Switch to uv and just in lieu of PDM, tox and Make.
    See the Contributing section for new workflow instructions.
    (#​671)

v25.1.1

Compare Source

  • Fixed AttributeError: no attribute '__parameters__' while structuring attrs classes that inherit from parametrized generic aliases from collections.abc.
    (#​654 #​655)

v25.1.0

Compare Source

  • Potentially breaking: The converters raise {class}StructureHandlerNotFoundError more eagerly (on hook creation, instead of on hook use).
    This helps surfacing problems with missing hooks sooner.
    See Migrations for steps to restore legacy behavior.
    (#​577)
  • Add a Migrations page, with instructions on migrating changed behavior for each version.
    (#​577)
  • typing.Self is now supported in attrs classes, dataclasses, TypedDicts and the dict NamedTuple factories.
    See typing.Self for details.
    (#​299 #​627)
  • PEP 695 type aliases can now be used with {meth}BaseConverter.register_structure_hook and {meth}BaseConverter.register_unstructure_hook.
    Previously, they required the use of {meth}BaseConverter.register_structure_hook_func (which is still supported).
    (#​647)
  • Expose {func}cattrs.cols.mapping_unstructure_factory through {mod}cattrs.cols.
  • Some defaultdicts are now supported by default, and
    {func}cattrs.cols.is_defaultdict and {func}cattrs.cols.defaultdict_structure_factory are exposed through {mod}cattrs.cols.
    (#​519 #​588)
  • Generic PEP 695 type aliases are now supported.
    (#​611 #​618)
  • The tagged union strategy now also supports type aliases of unions.
    (#​649)
  • {meth}Converter.copy and {meth}BaseConverter.copy are correctly annotated as returning Self.
    (#​644)
  • Many preconf converters (bson, stdlib JSON, cbor2, msgpack, msgspec, orjson, ujson) skip unstructuring int and str enums,
    leaving them to the underlying libraries to handle with greater efficiency.
    (#​598)
  • The {class}msgspec JSON preconf converter <cattrs.preconf.msgspec.MsgspecJsonConverter> now handles dataclasses with private attributes more efficiently.
    (#​624)
  • Literals containing enums are now unstructured properly, and their unstructuring is greatly optimized in the bson, stdlib JSON, cbor2, msgpack, msgspec, orjson and ujson preconf converters.
    (#​598)
  • Preconf converters now handle dictionaries with literal keys properly.
    (#​599)
  • Structuring TypedDicts from invalid inputs now properly raises a {class}ClassValidationError.
    (#​615 #​616)
  • {func}cattrs.strategies.include_subclasses now properly works with generic parent classes.
    (#​649)
  • Replace cattrs.gen.MappingStructureFn with {class}cattrs.SimpleStructureHook.
  • Python 3.13 is now supported.
    (#​543 #​547)
  • Python 3.8 is no longer supported, as it is end-of-life. Use previous versions on this Python version.
    (#​591)
  • Change type of Converter.__init__.unstruct_collection_overrides from Callable to Mapping[type, UnstructureHook]
    (#​594).
  • Adopt the Contributor Covenant Code of Conduct (just like attrs).

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants