chore(deps): update cattrs to 24.1.0 #33
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==23.2.3
->==24.1.0
Release Notes
python-attrs/cattrs (cattrs)
v24.1.0
Compare Source
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)
(#486)
cattrs.gen.make_dict_structure_fn
will use the value for theprefer_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)
BaseConverter.get_structure_hook
and {meth}BaseConverter.get_unstructure_hook
methods.(#432 #472)
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)
cattrs.cols
module for better collection customizations.(#504 #540)
cattrs.cols.is_mapping
predicate function to also cover virtual subclasses ofabc.Mapping
.This enables map classes from libraries such as immutables or sortedcontainers to structure out-of-the-box.
(#555 #556)
preconf converter <cattrs.preconf.msgspec>
.Only JSON is supported for now, with other formats supported by msgspec to come later.
(#481)
(#472)
(#426 #477)
(#452)
TypeVar
s with defaults.(#512)
typing.NamedTuple
).(#425 #491)
(#425 #549)
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)
make_converter
factories are now correctly typed.(#481)
orjson preconf converter <cattrs.preconf.orjson.OrjsonConverter>
now passes through dates and datetimes to orjson while unstructuring, greatly improving speed.(#463)
cattrs.gen
generators now attach metadata to the generated functions, making them introspectable.(#472)
cattrs.gen
now handle recursive classes better.(#540)
forbid_extra_keys
is set.(#533 #534)
Annotated
andNotRequired
in TypedDicts.(#450)
typing_extensions.Literal
is now automatically structured, just liketyping.Literal
.(#460 #467)
typing_extensions.Any
is now supported and handled liketyping.Any
.(#488 #490)
Optional
types can now be consistently customized usingregister_structure_hook
andregister_unstructure_hook
.(#529 #530)
(#496)
(#452)
(#472)
(#473)
include_subclasses
andtagged_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.
This PR was generated by Mend Renovate. View the repository job log.