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

Bump cattrs from 23.1.2 to 23.2.3 #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 13, 2023

Bumps cattrs from 23.1.2 to 23.2.3.

Release notes

Sourced from cattrs's releases.

v23.2.3

  • Fix a regression when unstructuring dictionary values typed as Any. (#453 #462)
  • Fix a regression when unstructuring unspecialized generic classes. (#465 #466)
  • Optimize function source code caching. (#445 #464)
  • Generate unique files only in case of linecache enabled. (#445 #441)

v23.2.2

  • Fix a regression when unstructuring Any | None. (#453)

v23.2.1

23.2.1 (2023-11-18)

  • Fix unnecessary typing_extensions import on Python 3.11. (#446 #447)

For the v23.2.0 release notes, see here.

v23.2.0

23.2.0 (2023-11-17)

Welcome to cattrs 23.2.0! Thanks to all our wonderful contributors, this release happens to have the largest changelog so far.

Here are some of the noteworthy additions, see below for the entire changelog.

More Powerful Unions in preconf

Courtesy of the union passthrough strategy, the following class (and others like it, this is just a complex example) will work out-of-the-box on any preconf converter:

@define
class MyClass:
    my_field: str | Literal[1] | MyOtherClass

The strategy has been preapplied to all preconf converters, but it can be manually applied to any converter.

Default Disambiguation via Literals

When structuring a union of attrs classes, cattrs will default to the default union strategy.

This strategy works by finding required unique fields in the given classes. It has been enhanced with support for matching on fields annotated as Literals.

from typing import Literal
</tr></table> 

... (truncated)

Changelog

Sourced from cattrs's changelog.

23.2.3 (2023-11-30)

  • Fix a regression when unstructuring dictionary values typed as Any. (#453 #462)
  • Fix a regression when unstructuring unspecialized generic classes. (#465 #466)
  • Optimize function source code caching. (#445 #464)
  • Generate unique files only in case of linecache enabled. (#445 #441)

23.2.2 (2023-11-21)

  • Fix a regression when unstructuring Any | None. (#453 #454)

23.2.1 (2023-11-18)

  • Fix unnecessary typing_extensions import on Python 3.11. (#446 #447)

23.2.0 (2023-11-17)

  • Potentially breaking: skip attrs fields marked as init=False by default. This change is potentially breaking for unstructuring. See here for instructions on how to restore the old behavior. (#40 #395)
  • Potentially breaking: {py:func}cattrs.gen.make_dict_structure_fn and {py:func}cattrs.gen.typeddicts.make_dict_structure_fn will use the values for the detailed_validation and forbid_extra_keys parameters 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 values directly. (#410 #411)
  • Potentially breaking: The default union structuring strategy will also use fields annotated as typing.Literal to help guide structuring. See here for instructions on how to restore the old behavior. (#391)
  • Python 3.12 is now supported. Python 3.7 is no longer supported; use older releases there. (#424)
  • Implement the union passthrough strategy, enabling much richer union handling for preconfigured converters. Learn more here.
  • Introduce the use_class_methods strategy. Learn more here. (#405)
  • The omit parameter of {py:func}cattrs.override is now of type bool | None (from bool). None is the new default and means to apply default cattrs handling to the attribute, which is to omit the attribute if it's marked as init=False, and keep it otherwise.
  • Converters can now be initialized with custom fallback hook factories for un/structuring. (#331 #441)
  • Add support for date to preconfigured converters. (#420)
  • Add support for datetime.dates to the PyYAML preconfigured converter. (#393)
  • Fix {py:func}format_exception() <cattrs.v.format_exception> parameter working for recursive calls to {py:func}transform_error <cattrs.transform_error>. (#389)
  • attrs aliases are now supported, although aliased fields still map to their attribute name instead of their alias by default when un/structuring. (#322 #391)
  • Fix TypedDicts with periods in their field names.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Dec 13, 2023
Bumps [cattrs](https://github.com/python-attrs/cattrs) from 23.1.2 to 23.2.3.
- [Release notes](https://github.com/python-attrs/cattrs/releases)
- [Changelog](https://github.com/python-attrs/cattrs/blob/main/HISTORY.md)
- [Commits](python-attrs/cattrs@v23.1.2...v23.2.3)

---
updated-dependencies:
- dependency-name: cattrs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/pip/cattrs-23.2.3 branch from 74161d5 to b690f51 Compare January 3, 2024 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants