← Back to issue list

feat(deps)!: switch to pydantic 2

View original Github issue

Metadata

Project
charmcraft
Number
#1777
Type
pull request
State
merged
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Breaking PR #1777 (commit 70078b03) migrated charmcraft to pydantic 2, absorbing the #1776 unused-code cleanup; merged into main via #1817 (394e6e55) after #1815 fixed YAML default-parts.

Resolution: closed resolved

Reason: PR #1777 was approved and merged as commit 70078b03 ("feat(deps)!: switch to pydantic 2"), rewriting models to pydantic 2 APIs (field_validator, model_validator, HttpUrl) and including #1776's cleanup (027696be). Follow-up #1815 fixed a regression and #1817 (394e6e55) merged the pydantic 2 branch into main.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Includes the entirety of #1776

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Breaking PR #1777 (commit 70078b03) migrated charmcraft to pydantic 2, absorbing the #1776 unused-code cleanup; merged into main via #1817 (394e6e55) after #1815 fixed YAML default-parts.
stealth/space-bunny-alpha — closed resolved Merged the Pydantic 2 migration in canonical/charmcraft#1777, incorporating unused-code cleanup from #1776; approved by two reviewers.
qwen/qwen3.6-35b-a3b — — Merged pydantic 2 upgrade, incorporating #1776. Approved by two reviewers, the update modified 81 files with a net reduction of over 15,000 lines, completing the major version migration.
qwen3.6-35b-a3b-mtp-q6 — — Merged the breaking dependency update to pydantic 2, incorporating all changes from #1776. The maintainer applied this major version upgrade to align the codebase with the new API.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#1776 (confidence 95%)

    'chore: remove unused code' (027696be) was included wholesale in #1777 per its description.

  • Likely Fixed By: canonical/charmcraft#1817 (confidence 85%)

    PR 'chore: merge pydantic 2 support to main', commit 394e6e55, brought the #1777 work onto main.

  • Related To: canonical/charmcraft#1815 (confidence 80%)

    Commit 2a0eb973 fixed YAML default-parts regression caused by the migration, preceding the main merge.

Related issues

Issue Project State Summary Similarity
#1768 Migrate to Pydantic 2 charmcraft closed Migrated Charmcraft to Pydantic 2 via merged PR #1777 (70078b03), with the feature branch merged to main in #1817 (394e6e55).
77%
#1971 feat(linter): add PYDEPS linter charmcraft closed Closed unmerged and superseded by charmcraft#2250, which merged the PYDEPS linter in commit 8877d1b1 and resolved #1890.
73%
#401 build!: update to pydantic 2 craft-application merged Merged PR #401 as commit c2f0978a, migrating craft-application to Pydantic 2 across 23 files; craft-grammar#34 was required for the tests.
73%
#451 build(deps): bump pydantic to v2 craft-providers merged Merged PR #451 upgraded craft-providers to Pydantic v2 for 2.0; current project metadata requires pydantic~=2.4.
72%
#1812 pydantic 2 version not always including charm source charmcraft closed Fixed by merged PR #1815 (commit 2a0eb973), restoring default parts for bases charms after the Pydantic 2 migration so source files are packaged.
72%
#404 feat: multiple pydantic 2 fixes and papercuts craft-application merged Merged PR #404 delivered multiple Pydantic 2 fixes: better error conversion, platform mappings, public regex validation, YAML-string output, and per-part validation.
71%
#2155 build(deps): update dependency pydantic to v2.10.6 (main) charmcraft closed Pydantic 2.10.6 update closed unmerged; a later toolchain and Pydantic update merged in canonical/charmcraft#2310 via commit e635550d.
71%
#103 feat: upgrade to pydantic 2.x craft-archives merged Merged PR #103 as commit b69f44a, upgrading craft-archives to Pydantic 2.x after three approvals; residual review feedback was moved to #118.
71%
#2799 build(deps): update bugfixes (main) charmcraft merged Renovate PR merged as commit ed45fab5: bumped astral-sh/ruff-pre-commit v0.15.20 to v0.15.22 and PyYAML 6.0.1/6.0.2 to 6.0.3 in charmcraft (uv.lock, spread test requirements, pre-commit config).
71%
#2310 build(deps): update rust toolchain and pydantic charmcraft merged Merged PR #2310 as commit e635550d, updating the Rust toolchain and Pydantic to fix Charmcraft 3.5.0 builds affected by a Pydantic/typing-extensions incompatibility.
71%