Skip to content

Add a check_pydantic_core_version() function #11324

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 3 commits into from
Jan 24, 2025
Merged

Add a check_pydantic_core_version() function #11324

merged 3 commits into from
Jan 24, 2025

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Jan 23, 2025

Ensuring the correct pydantic-core version is installed.

Closes #11323.

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

Ensuring the correct `pydantic-core` version is installed.
@github-actions github-actions bot added the relnotes-packaging Used for dependency changes. label Jan 23, 2025
Copy link

cloudflare-workers-and-pages bot commented Jan 23, 2025

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d632ea
Status: ✅  Deploy successful!
Preview URL: https://6859aff4.pydantic-docs.pages.dev
Branch Preview URL: https://check-pc-version.pydantic-docs.pages.dev

View logs

Copy link

codspeed-hq bot commented Jan 23, 2025

CodSpeed Performance Report

Merging #11324 will not alter performance

Comparing check-pc-version (6d632ea) with main (221275f)

Summary

✅ 45 untouched benchmarks

Copy link
Contributor

github-actions bot commented Jan 23, 2025

Coverage report

Click to see where and how coverage changed

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

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

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

We need a comment on pyproject.toml saying "you need to update this in xxx if you change it here."

@@ -63,6 +65,12 @@ def version_info() -> str:
return '\n'.join('{:>30} {}'.format(k + ':', str(v).replace('\n', ' ')) for k, v in info.items())


def check_pydantic_core_version() -> bool:
"""Check that the installed `pydantic-core` dependency is compatible."""
# Keep this in sync with the version constraint in the `pyproject.toml` dependencies:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we automate this?

Copy link
Member Author

@Viicos Viicos Jan 24, 2025

Choose a reason for hiding this comment

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

Probably overkill imo, considering the added test fails if this function was not updated after a pydantic-core version bump

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, let's merge.

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

LGTM, though I'd prefer an automated update...

@Viicos Viicos merged commit ea3f18d into main Jan 24, 2025
55 checks passed
@Viicos Viicos deleted the check-pc-version branch January 24, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes-packaging Used for dependency changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add check_pydantic_core_version()
3 participants