scdlbot
scdlbot copied to clipboard
Bump cattrs from 24.1.3 to 25.1.1
Bumps cattrs from 24.1.3 to 25.1.1.
Release notes
Sourced from cattrs's releases.
v25.1.1
- Fixed
AttributeError: no attribute '__parameters__'while structuring attrs classes that inherit from parametrized generic aliases fromcollections.abc. (#654 #655)v25.1.0
- Potentially breaking: The converters raise
StructureHandlerNotFoundErrormore 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.Selfis now supported in attrs classes, dataclasses, TypedDicts and the dict NamedTuple factories. Seetyping.Selffor details. (#299 #627)- PEP 695 type aliases can now be used with
BaseConverter.register_structure_hookandBaseConverter.register_unstructure_hook. Previously, they required the use ofBaseConverter.register_structure_hook_func(which is still supported). (#647)- Expose
cattrs.cols.mapping_unstructure_factorythroughcattrs.cols.- Some
defaultdictsare now supported by default, andcattrs.cols.is_defaultdictandcattrs.cols.defaultdict_structure_factoryare exposed throughcattrs.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)
Converter.copyandBaseConverter.copyare correctly annotated as returningSelf. (#644)- Many preconf converters (bson, stdlib JSON, cbor2, msgpack, msgspec, orjson, ujson) skip unstructuring
intandstrenums, leaving them to the underlying libraries to handle with greater efficiency. (#598)- The msgspec JSON preconf converter 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
ClassValidationError. (#615 #616)cattrs.strategies.include_subclassesnow properly works with generic parent classes. (#649)- Replace
cattrs.gen.MappingStructureFnwithcattrs.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_overridesfromCallabletoMapping[type, UnstructureHook](#594).- Adopt the Contributor Covenant Code of Conduct (just like attrs).
Changelog
Sourced from cattrs's changelog.
25.1.1 (2025-06-04)
- Fixed
AttributeError: no attribute '__parameters__'while structuring attrs classes that inherit from parametrized generic aliases fromcollections.abc. (#654 #655)25.1.0 (2025-05-31)
- Potentially breaking: The converters raise {class}
StructureHandlerNotFoundErrormore 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.Selfis now supported in attrs classes, dataclasses, TypedDicts and the dict NamedTuple factories. Seetyping.Selffor details. (#299 #627)- PEP 695 type aliases can now be used with {meth}
BaseConverter.register_structure_hookand {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_factorythrough {mod}cattrs.cols.- Some
defaultdictsare now supported by default, and {func}cattrs.cols.is_defaultdictand {func}cattrs.cols.defaultdict_structure_factoryare 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.copyand {meth}BaseConverter.copyare correctly annotated as returningSelf. (#644)- Many preconf converters (bson, stdlib JSON, cbor2, msgpack, msgspec, orjson, ujson) skip unstructuring
intandstrenums, 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_subclassesnow properly works with generic parent classes. (#649)- Replace
cattrs.gen.MappingStructureFnwith {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_overridesfromCallabletoMapping[type, UnstructureHook](#594).- Adopt the Contributor Covenant Code of Conduct (just like attrs).
Commits
9894095v25.1.17c67730Fix structuring of attrs class that inherit from typing/collections.abc gener...0bb472aSmall changelog tweak9122f10v25.1.0ea4c311Support generic parents in include_subclasses strategy (#650)c95a0a5configure_tagged_union: support type aliases (#649)58c7ba6register_un/structure_hook: support type aliases (#647)0b6586aConverters:copy()returns Self (#644)0c36adcFix reliance on unspecified behavior in test_disambiguators.py (#642)d8f17b7Merge branch '24.1'- Additional commits viewable in compare view
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 rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency -
@dependabot ignore this major versionwill 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 versionwill 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 dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)