Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update cattrs to 24.1.0 #33

Merged
merged 1 commit into from
Sep 8, 2024
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Sep 8, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
cattrs (changelog) ==23.2.3 -> ==24.1.0 age adoption passing confidence

Release Notes

python-attrs/cattrs (cattrs)

v24.1.0

Compare Source

  • Potentially breaking: Unstructuring hooks for typing.Any are consistent now: values are unstructured using their runtime type.
    Previously this behavior was underspecified and inconsistent, but followed this rule in the majority of cases.
    Reverting old behavior is very dependent on the actual case; ask on the issue tracker if in doubt.
    (#​473)
  • Minor change: Heterogeneous tuples are now unstructured into tuples instead of lists by default; this is significantly faster and widely supported by serialization libraries.
    (#​486)
  • Minor change: {py:func}cattrs.gen.make_dict_structure_fn will use the value for the prefer_attrib_converters parameter from the given converter by default now.
    If you're using this function directly, the old behavior can be restored by passing in the desired values explicitly.
    (#​527 #​528)
  • Introduce {meth}BaseConverter.get_structure_hook and {meth}BaseConverter.get_unstructure_hook methods.
    (#​432 #​472)
  • {meth}BaseConverter.register_structure_hook, {meth}BaseConverter.register_unstructure_hook,
    {meth}BaseConverter.register_unstructure_hook_factory and {meth}BaseConverter.register_structure_hook_factory
    can now be used as decorators and have gained new features.
    See here and here for more details.
    (#​487)
  • Introduce and document the {mod}cattrs.cols module for better collection customizations.
    (#​504 #​540)
  • Enhance the {func}cattrs.cols.is_mapping predicate function to also cover virtual subclasses of abc.Mapping.
    This enables map classes from libraries such as immutables or sortedcontainers to structure out-of-the-box.
    (#​555 #​556)
  • Introduce the msgspec {mod}preconf converter <cattrs.preconf.msgspec>.
    Only JSON is supported for now, with other formats supported by msgspec to come later.
    (#​481)
  • The default union handler now properly takes renamed fields into account.
    (#​472)
  • The default union handler now also handles dataclasses.
    (#​426 #​477)
  • Add support for PEP 695 type aliases.
    (#​452)
  • Add support for PEP 696 TypeVars with defaults.
    (#​512)
  • Add support for named tuples with type metadata (typing.NamedTuple).
    (#​425 #​491)
  • Add support for optionally un/unstructuring named tuples using dictionaries.
    (#​425 #​549)
  • The include_subclasses strategy now fetches the member hooks from the converter (making use of converter defaults) if overrides are not provided, instead of generating new hooks with no overrides.
    (#​429 #​472)
  • The preconf make_converter factories are now correctly typed.
    (#​481)
  • The {class}orjson preconf converter <cattrs.preconf.orjson.OrjsonConverter> now passes through dates and datetimes to orjson while unstructuring, greatly improving speed.
    (#​463)
  • {mod}cattrs.gen generators now attach metadata to the generated functions, making them introspectable.
    (#​472)
  • Structure hook factories in {mod}cattrs.gen now handle recursive classes better.
    (#​540)
  • The tagged union strategy now leaves the tags in the payload unless forbid_extra_keys is set.
    (#​533 #​534)
  • More robust support for Annotated and NotRequired in TypedDicts.
    (#​450)
  • typing_extensions.Literal is now automatically structured, just like typing.Literal.
    (#​460 #​467)
  • typing_extensions.Any is now supported and handled like typing.Any.
    (#​488 #​490)
  • Optional types can now be consistently customized using register_structure_hook and register_unstructure_hook.
    (#​529 #​530)
  • The BaseConverter now properly generates detailed validation errors for mappings.
    (#​496)
  • PEP 695 generics are now tested.
    (#​452)
  • 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.
    (#​472)
  • The documentation has been significantly reworked.
    (#​473)
  • The docs now use the Inter font.
  • Make type annotations for include_subclasses and tagged_union strategies more lenient.
    (#​431)

Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), 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.

@renovate renovate bot added the type/major label Sep 8, 2024
@nickclyde nickclyde merged commit 31a675f into main Sep 8, 2024
2 checks passed
@nickclyde nickclyde deleted the renovate/cattrs-24.x branch September 8, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant