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

Minor refactoring -- no behavioral changes #8236

Merged
merged 5 commits into from Nov 27, 2023
Merged

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Nov 27, 2023

Change Summary

  1. Convert some classmethods to staticmethods on the FieldInfo class, as we aren't subclassing FieldInfo. See motivation for this refactor here: Update to pyright==1.1.335 #8075
  2. Cleaning up ClassVar mypy support (var naming, docstrings, grammar)
  3. Move shared signature generation logic to the _signature.py file in the _internal folder. Also removed unnecessary wrapper functions for the model and dataclass signature generation.

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

Selected Reviewer: @samuelcolvin

@sydney-runkle sydney-runkle added the relnotes-ignore Omit this PR from the release notes. label Nov 27, 2023
Copy link

cloudflare-pages bot commented Nov 27, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b29e74f
Status: ✅  Deploy successful!
Preview URL: https://19524f92.pydantic-docs2.pages.dev
Branch Preview URL: https://slight-refactoring.pydantic-docs2.pages.dev

View logs

Copy link

codspeed-hq bot commented Nov 27, 2023

CodSpeed Performance Report

Merging #8236 will not alter performance

Comparing slight-refactoring (b29e74f) with main (22e6444)

Summary

✅ 10 untouched benchmarks

@sydney-runkle
Copy link
Member Author

Please review

Copy link
Member

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

Looks good to me!

pydantic/_internal/_model_construction.py Outdated Show resolved Hide resolved
@sydney-runkle sydney-runkle enabled auto-merge (squash) November 27, 2023 19:11
@sydney-runkle sydney-runkle merged commit 202d379 into main Nov 27, 2023
55 checks passed
@sydney-runkle sydney-runkle deleted the slight-refactoring branch November 27, 2023 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review relnotes-ignore Omit this PR from the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants