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

Mark pydantic_settings.BaseSettings as having default copy semantics #8793

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

Iipin
Copy link
Contributor

@Iipin Iipin commented Nov 20, 2023

Summary

In 2.0, Pydantic has moved the BaseSettings class to a separate package called pydantic-settings (https://docs.pydantic.dev/2.4/migration/#basesettings-has-moved-to-pydantic-settings), which results in a false positive on RUF012 (mutable-class-default). A simple fix for that would be adding pydantic_settings.BaseSettings base to the has_default_copy_semantics helper, which I've done in this PR.

Related issue: #5308

Test Plan

cargo test

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@charliermarsh charliermarsh enabled auto-merge (squash) November 20, 2023 19:27
@charliermarsh charliermarsh enabled auto-merge (squash) November 20, 2023 19:27
@charliermarsh charliermarsh added the bug Something isn't working label Nov 20, 2023
@charliermarsh charliermarsh merged commit e306359 into astral-sh:main Nov 20, 2023
16 checks passed
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants