Skip to content

Lower the pydantic minimum version to 2.0.2 - #40

Merged
Gal-Gilor merged 1 commit into
mainfrom
chore/pydantic-2.0-minimum
Oct 18, 2026
Merged

Gal-Gilor merged 1 commit into
mainfrom
chore/pydantic-2.0-minimum

Conversation

@Gal-Gilor

@Gal-Gilor Gal-Gilor commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • pyproject.toml: the requirement is now pydantic>=2.0.2 (was >=2.14.1).
  • uv.lock: regenerated with uv 0.13.1. Only the requires-dist specifier changes; the locked development version stays at pydantic 2.14.1.
  • .github/workflows/lint-test-build.yaml: added the "Test with the lowest supported pydantic" step from the issue as the last step of the build job, pinned to pydantic==2.0.2. It comes after the wheel import check so the build and wheel checks still run first, and it installs the package from source (.), not from the built wheel.
  • CHANGELOG.md, 0.3.0 "Changed": the minimum pydantic version is now 2.0.2, and the upper bound is removed.

Why 2.0.2 instead of the issue's 2.0: pydantic 2.0 pins pydantic-core 2.0.1 and pydantic 2.0.1 pins pydantic-core 2.0.2, and neither core release has cp312 wheels. Installing them on Python 3.12 means building pydantic-core from source with Rust. Locally, uv pip install . "pydantic==2.0" pytest on 3.12 took about 74s to compile pydantic-core 2.0.1, and the same install with --only-binary :all: fails because no usable wheel exists. pydantic 2.0.2 pins pydantic-core 2.1.2, which has cp312 wheels.

Testing

  • uv run ruff check --no-fix . and uv run ruff format --check .: pass.
  • uv run pytest -q: 99 passed.
  • uv build followed by the build job's wheel import check: pass.
  • uv lock and then uv sync --locked with uv 0.13.1: pass.
  • The new CI step on Python 3.12.3, run locally with an empty uv cache: uv venv, then uv pip install . "pydantic==2.0.2" pytest, then python -m pytest gives 99 passed. Running the install again with --only-binary pydantic-core also works (0.5s, pydantic 2.0.2 and pydantic-core 2.1.2 from wheels), so nothing is built from source.
  • On pydantic 2.0, assigning to a frozen field still raises ValidationError (frozen_instance), so the frozen-model tests hold.

Require pydantic>=2.0.2, regenerate uv.lock and test the package against
pydantic 2.0.2 in the build job. pydantic 2.0 and 2.0.1 pin pydantic-core
versions without Python 3.12 wheels, so 2.0.2 is the lowest release that
installs on 3.12 without a Rust build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015guwcb2VbULqaendfa6d3k
@Gal-Gilor
Gal-Gilor force-pushed the chore/pydantic-2.0-minimum branch from 58f1dad to 15ccfdf Compare October 18, 2026 17:39
@Gal-Gilor
Gal-Gilor merged commit d65e6d3 into main Oct 18, 2026
5 checks passed
@Gal-Gilor
Gal-Gilor deleted the chore/pydantic-2.0-minimum branch October 18, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants