chore!: migrate to pydantic 2
Metadata
Current evaluation
Merged after two approvals and passing CI. Migrates the codebase to Pydantic 2, resolving issue #4941. The author rebased and force-pushed clean commits prior to a rebase-merge.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox run -m lint`?
- [x] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`)
-----
Migrate to Pydantic 2.
Fixes #4941
(CRAFT-3159)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after two approvals and passing CI. Migrates the codebase to Pydantic 2, resolving issue #4941. The author rebased and force-pushed clean commits prior to a rebase-merge. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Migrated the codebase to Pydantic 2, resolving issue #4941. Commits were cleaned up and rebase-merged by the maintainer. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after commit cleanup. Successfully migrated the codebase to Pydantic 2, resolving issue #4941 and CRAFT-3159. All lint and test checks passed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #36 chore!: update to pydantic 2 | craft-grammar | merged | Merged the Pydantic 2 migration across five files. Approved by two reviewers and passed CI. The maintainer manually verified the author's Canonical employment to override an automated CLA check failure before finalizing the merge. | |
| #771 chore: lift-and-shift update to pydantic 2 | craft-parts | merged | Merged after two approvals and passing CI. The update migrates the codebase to Pydantic 2 using bump-pydantic and manual fixes. It touched 38 files (+207/-127 lines) as the initial phase of the broader dependency upgrade. | |
| #1817 chore: merge pydantic 2 support to main | charmcraft | merged | Merged pydantic 2 support into the main branch after approval from two reviewers. The update modifies 52 files, adding 2860 lines and removing 714, completing the dependency upgrade. | |
| #33 chore!: update to Pydantic 2 | craft-grammar | merged | Merged update to Pydantic 2. Resolves issue #32 by addressing breaking changes in grammar validation error messages. Approved by two reviewers, passed CI checks, and modified five files (+40/-41 lines). | |
| #408 chore!: merge pydantic 2 feature branch to main | craft-application | merged | Merged the pydantic 2 feature branch into main, upgrading the codebase and resolving typing issues. Approved by two reviewers and passing CI checks, the merge introduces breaking changes required for the pydantic 2 dependency update. | |
| #663 chore!: migrate to pydantic 2 | rockcraft | merged | Merged after approval by four reviewers, migrating the codebase to Pydantic 2. The update drops the Rockcraft Platform model, applies necessary cleanups, and resolves issue #657 across 27 files. | |
| #778 chore: pydantic 2 related cleanup | craft-parts | merged | Merged a Pydantic 2 compatibility cleanup. Approved by two reviewers and passed CI. Modified seven files with 28 additions and 26 deletions. Required PR #775. | |
| #207 chore(deps): drop Pydantic dependency | craft-cli | merged | Merged changes remove the unused Pydantic dependency, resolving issue #201. Approved by two reviewers, passed CI checks, and reduced code by three lines across three files without impacting the 94.76% test coverage. | |
| #112 chore(deps): update to pydantic 2 & bump-pydantic | craft-archives | closed | The dependency update to Pydantic 2 was closed without merging. Lacking reviewer feedback, CI validation, and sustained activity, the pull request was abandoned. | |
| #60 Migrate to pydantic 2 | imagecraft | merged | Merged after approval. The codebase was migrated to Pydantic V2 with updated craft libraries. Changes span 27 files (+278/-340 lines) and maintain 98% test coverage, resolving FR-8917. |