Chore(deps): bump pydantic, update Configuration.model_dump signature #465
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.
Description
Note
tldr: Pydantic
BaseModel.model_dump
function signature in 2.11 is not back compatible with 2.10. This PR sets the Pydantic lower bound version to 2.11 and bumps the upper bound to 2.12.Background - why do we need this PR?
The reason we need this PR is because we override the
model_dump
method in theConfiguration
class. Pydantic 2.11 introduces a newfallback
argument and also changes the type ofby_alias
tobool | None
frombool
. These were introduced in the PRs pydantic/pydantic#11398 and pydantic/pydantic#11468 respectively.If we do not update the function signature mypy tells us that we have overridden the function in a way that is incompatible with the base class, if we do update the signature it is no longer compatible with Pydantic 2.10. I have updated the signature so we can continue to use newer versions of Pydantic.
Overview - what changed?
Updated
pyproject.toml
andConfiguration.model_dump
.Breaking changes
This will cause the same backwards compatibility issue in CAREamics as Pydantic, but it should not break existing code.
Please ensure your PR meets the following requirements: