Skip to content

Change type of Any when synthesizing BaseSettings.__init__ signature in the mypy plugin #11497

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

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Feb 27, 2025

Fixes #11313 (a previous fix was issued in pydantic-settings, but caused a regression. Here is a more robust fix).

Change Summary

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Feb 27, 2025
Copy link

cloudflare-workers-and-pages bot commented Feb 27, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4cafa69
Status: ✅  Deploy successful!
Preview URL: https://eba60abb.pydantic-docs.pages.dev
Branch Preview URL: https://mypy-explicit-any-settings.pydantic-docs.pages.dev

View logs

@Viicos
Copy link
Member Author

Viicos commented Feb 27, 2025

@dmontagu, I'm wondering if this could be used also more broadly, to solve this issue, where we only documented a workaround.

Copy link

codspeed-hq bot commented Feb 27, 2025

CodSpeed Performance Report

Merging #11497 will not alter performance

Comparing mypy-explicit-any-settings (4cafa69) with main (acb0f10)

Summary

✅ 46 untouched benchmarks

@Viicos Viicos force-pushed the mypy-explicit-any-settings branch from 5429b09 to 4cafa69 Compare February 27, 2025 10:51
Copy link
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  pydantic
  mypy.py 1166
Project Total  

This report was generated by python-coverage-comment-action

@Viicos Viicos merged commit 98348d0 into main Feb 28, 2025
58 checks passed
@Viicos Viicos deleted the mypy-explicit-any-settings branch February 28, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-fix Used for bugfixes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mypy "Explicit "Any" is not allowed" error when extending "BaseSettings"
2 participants