Skip to content

feat: upgrade to pydantic v2 compatibility#3

Merged
dannyshaw merged 3 commits into
mainfrom
danny/pydantic-v2-compat
Mar 2, 2026
Merged

feat: upgrade to pydantic v2 compatibility#3
dannyshaw merged 3 commits into
mainfrom
danny/pydantic-v2-compat

Conversation

@dannyshaw
Copy link
Copy Markdown
Contributor

Summary

  • Replace @validate_arguments with @validate_call (renamed in pydantic v2) across 7 API files
  • Replace Field(const=True) with Field(default=...) in 2 model files (const removed in v2)
  • Bump pydantic requirement from >=1.10.5, <2 to >=2

Other v1 patterns (.dict(), .parse_obj(), class Config, @validator) still work in pydantic v2 via its built-in compatibility layer with deprecation warnings. A full migration to v2 native APIs can be done separately.

Why

The main Edrolo project needs claude-agent-sdk which depends on mcp which requires pydantic>=2. This <2 upper bound on pywonde was the blocker.

Test plan

  • Verify pywonde imports successfully with pydantic v2
  • Verify Wonde API integration still works in staging
  • Run existing tests with pydantic v2 installed

🤖 Generated with Claude Code

- Replace validate_arguments with validate_call (renamed in pydantic v2)
- Replace Field(const=True) with Field(default=...) (const removed in v2)
- Bump pydantic requirement from >=1.10.5,<2 to >=2

Other v1 patterns (.dict(), .parse_obj(), class Config, @validator) still
work in pydantic v2 via its built-in compatibility layer.
Python 3.7 and 3.8 are EOL and unavailable on ubuntu-latest (24.04),
causing CI failures. Pydantic v2 requires >=3.8 anyway.

Also add fail-fast: false so one matrix failure doesn't cancel the rest.
CI installs from requirements.txt, not pyproject.toml. The old
pydantic<2 constraint was still there, causing validate_call import
failures.
@dannyshaw dannyshaw merged commit 4ee616d into main Mar 2, 2026
8 checks passed
@dannyshaw dannyshaw deleted the danny/pydantic-v2-compat branch March 2, 2026 07:07
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