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.
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.
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)
Allow timestamp 0 in fields.DateTime (:issue:2133).
Thanks :user:flydzen for reporting.
3.21.1 (2024-03-04)
Bug fixes:
Fix error message when field is declared as a class and not an instance (:issue:2245).
Thanks :user:travnick for reporting.
3.21.0 (2024-02-26)
Bug fixes:
Fix validation of URL fields to allow missing user field,
per NWG RFC 3986 (:issue:2232). Thanks :user:ddennerline3 for reporting
and :user:deckar01 for the PR.
Other changes:
Backwards-incompatible: __version__, __parsed_version__, and __version_info__
attributes are deprecated (:issue:2227). Use feature detection or
importlib.metadata.version("marshmallow") instead.
3.20.2 (2024-01-09)
Bug fixes:
Fix Nested field type hint for lambda Schema types (:pr:2164).
Thanks :user:somethingnew2-0 for the PR.
Other changes:
Officially support Python 3.12 (:pr:2188).
Thanks :user:hugovk for the PR.
Fixed a case when omit_default didn't work for Enum with basic types mixed in (#204)
Fixed RecursionError when annotated SerializationStrategy was used as a field serialization strategy (#219)
v3.12
Changes
Added support for associating multiple tags with a single variant by returning a list of tags from variant_tagger_fn (#184)
Added support for locally defined types (#180, #182, #189)
Added support for ForwardRef in JSON Schema generation (#187)
Fixed serialization of IntFlag when omit_default is enabled (#188)
Improved type annotations for serialization_strategy config option
v3.11
Changes
Added "codecs" feature to separate data models from serialization and work with top-level lists, dataclasses without mixins etc. (#108, #69), see updated documentation
Added new allow_deserialization_not_by_alias config option to allow deserialization by both alias and field name, see documentation (Fatal1ty/mashumaro#175)
Fixed UnserializableDataError for generic serializable types and generic serialization strategies with postponed evaluation of annotations (#177)
Fixed regression when ValueError was not thrown if invalid value type was passed to from_* method
We are pleased to announce the release of pandas 2.2.2.
This release includes some new features, bug fixes, and performance improvements. We recommend that all users upgrade to this version.
See the full whatsnew for a list of all the changes.
Pandas 2.2.2 supports Python 3.9 and higher.
The release will be available on the defaults and conda-forge channels:
Thanks to all the contributors who made this release possible.
Pandas 2.2.1
We are pleased to announce the release of pandas 2.2.1.
This release includes some new features, bug fixes, and performance improvements. We recommend that all users upgrade to this version.
See the full whatsnew for a list of all the changes.
Pandas 2.2.1 supports Python 3.9 and higher.
The release will be available on the defaults and conda-forge channels:
Thanks to all the contributors who made this release possible.
Pandas 2.2.0
We are pleased to announce the release of pandas 2.2.0.
This release includes some new features, bug fixes, and performance improvements. We recommend that all users upgrade to this version.
See the full whatsnew for a list of all the changes.
Pandas 2.2.0 supports Python 3.9 and higher.
The release will be available on the defaults and conda-forge channels:
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 ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the benchmark group with 8 updates in the /benchmark directory:
23.1.2
23.2.3
3.20.1
3.21.2
3.10
3.13
3.8.0
3.9.0
2.1.1
2.2.2
2.4.2
2.7.2
2.26
2.31
0.12.3
0.17.1
Updates
cattrs
from 23.1.2 to 23.2.3Release notes
Sourced from cattrs's releases.
... (truncated)
Changelog
Sourced from cattrs's changelog.
... (truncated)
Commits
5dc43b3
v23.2.33f63212
Flesh out history48cb3d0
Fix unstructuring underspecified generics (#466)88d4758
Optimize linecaching (#464)5b1fa6a
Fix dict value unstructuring (#462)b47f446
Avoid linecache unique file generation in case of linecache disabled (#461)bed932c
v23.2.2281f324
Fix regression (#454)c098cd8
v23.2.125d15d6
Import typing_extensions.TypeAlias only on python < 3.11 (#447)Updates
marshmallow
from 3.20.1 to 3.21.2Changelog
Sourced from marshmallow's changelog.
Commits
511b8c5
Bump version and update changelog03f56a4
Merge pull request #2264 from marshmallow-code/allow_timestamp_058fbbcd
Encapsulate timestamp boolean check in utils6e72beb
DateTime field: reject timestamp True/False845f573
DateTime field: allow timestamp 0183c411
Merge pull request #2263 from marshmallow-code/pre-commit-ci-update-config2d6e5c2
Use format specifiers instead of percent formata2ee924
[pre-commit.ci] pre-commit autoupdate38dc356
[pre-commit.ci] pre-commit autoupdateccc8c72
Bump sphinx from 7.3.6 to 7.3.7Updates
mashumaro
from 3.10 to 3.13Release notes
Sourced from mashumaro's releases.
Commits
bffc024
Bump version28c1521
Merge branch 'update-github-actions'a1845fa
Revert "Try to use Python 3.13 on Windows"e5abdda
Try to fix ignore_errors optionac64553
Fix duplicated sectione8c92a5
Set ignore_errors to ignore SyntaxError on old Python versions12612a0
Try to use Python 3.13 on Windowsc6c4181
Update actions1791aab
Merge pull request #220 from Fatal1ty/fix-field-annotated-strategyb00f834
Fix RecursionError on annotated serialization strategy for a dataclass fieldUpdates
matplotlib
from 3.8.0 to 3.9.0Release notes
Sourced from matplotlib's releases.
... (truncated)
Commits
be56634
REL: v3.9.0846ce8a
DOC: Finish documentation for 3.9.08604f67
Merge pull request #28206 from meeseeksmachine/auto-backport-of-pr-28205-on-v...196c8db
TST: Followup corrections to #28205d8f3016
Backport PR #28205: TST: Fix tests with older versions of ipython4db5ac9
Merge pull request #28203 from QuLogic/auto-backport-of-pr-28164-on-v3.9.xef1a2db
Merge pull request #28204 from meeseeksmachine/auto-backport-of-pr-28195-on-v...e4384b8
Merge pull request #28191 from QuLogic/no-dev-theme3b65546
Backport PR #28195: TST: Prepare for pytest 91b526c3
Backport PR #28164: CI: Ensure code coverage is always uploadedUpdates
pandas
from 2.1.1 to 2.2.2Release notes
Sourced from pandas's releases.
... (truncated)
Commits
d9cdd2e
RLS: 2.2.298aeac9
Backport PR #58209: CI: Pin blosc to fix pytables (#58211)5466f15
Backport PR #58202: DOC/TST: Document numpy 2.0 support and add tests… (#58208)45b0b32
Backport PR #58203 on branch 2.2.x (DOC: Add release date/contributors for 2....c7ec566
Backport PR #58087 on branch 2.2.x (BLD: Build wheels using numpy 2.0rc1) (#5...691fc88
Backport PR #58181 on branch 2.2.x (CI: correct error msg in test_view_index)...a947587
Backport PR #58138 on branch 2.2.x (BLD: Fix nightlies not building) (#58140)b56842d
Backport PR #58100 on branch 2.2.x (MNT: fix compatibility with beautifulsoup...0f83d50
Revert "BLD: Pin numpy on 2.2.x" (#58093)e9b81ee
Backport PR #58126: BLD: Build wheels with numpy 2.0rc1 (#58127)Updates
pydantic
from 2.4.2 to 2.7.2Release notes
Sourced from pydantic's releases.
... (truncated)
Changelog
Sourced from pydantic's changelog.
... (truncated)
Commits
70ac7a0
fix version08d6ed2
Merge branch '2.7' of https://github.com/pydantic/pydantic into 2.742f544a
fix versiona20da21
2.7.2 prep (#9515)f42ae9b
Logfire annoucement (#9362)451f780
Replace__spec__.parent
with__package__
(#9331)2612947
2.7.1 release prep (#9307)2b8efa2
Move TODO regarding pickling to markdown (#9288)73d1049
adds test case for unexpected discriminated union behavior (#9236)c33b925
Change CI to usemacos-13
for Python 3.8 and 3.9 (#9305)Updates
typedload
from 2.26 to 2.31Updates
pyserde
from 0.12.3 to 0.17.1Release notes
Sourced from pyserde's releases.
... (truncated)
Commits
ad0aa3e
Merge pull request #533 from yukinarit/fix-completion-for-lsp912feda
Add test for code completionfb95327
Use Type[T] instead of type[T] in@serde
858d658
Merge pull request #531 from yukinarit/remove-@dataclass-from-docs
ebb9892
Remove@dataclass
from documentationcfb4b60
Merge pull request #530 from yukinarit/dependabot/pip/msgpack-types-tw-0.3ee56969
Merge pull request #529 from yukinarit/dependabot/pip/coverage-eq-7.5.2cd48be5
Update msgpack-types requirement from ^0.2 to ^0.3513aecb
Update coverage requirement from ==7.5.1 to ==7.5.2fb284ef
Merge pull request #527 from yukinarit/update-contributorsDependabot 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