refactor: make pydantic models more idiomatic
Metadata
Current evaluation
Refactors pydantic models to be more idiomatic. All CI checks passing. No reviewers assigned or comments yet.
Suggested action: close stale
Reason: The issue this PR addresses (#118) was filed 817 days ago, and its summary explicitly states that the pydantic 2 upgrade (#103) and follow-up commits (e.g., #122) have already addressed the core concerns. This PR is therefore redundant with work already merged into the codebase.
Impact:
20
Quick Win:
13.0
Staleness:
30
Complexity:
35
Confidence:
75
Issue body
Fixes #118
---
- [ ] I've followed the [contribution guidelines](https://github.com/canonical/craft-archives/blob/main/CONTRIBUTING.md).
- [ ] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [ ] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
20
Quick Win:
13.0
Staleness:
30
Complexity:
35
Confidence:
75
|
close stale | Refactors pydantic models to be more idiomatic. All CI checks passing. No reviewers assigned or comments yet. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| created |
Related work
-
Duplicate Of:
craft-archives#103
(confidence 80%)
Issue #118 summary states the pydantic 2 upgrade (#103) has largely addressed the core concerns this PR targets.
-
Duplicate Of:
craft-archives#122
(confidence 75%)
Follow-up PR #122 (chore: eliminate pydantic warnings) further addressed the pydantic modernization concerns.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1117 refactor: move some pydantic models and metafiles | charmcraft | merged | Merged a refactoring change that relocated Pydantic models and metafiles to resolve circular imports. Approved by one reviewer, the update modified 29 files (+667/-520 lines) and closed CRAFT-1746. | |
| #118 Make Pydantic models more idiomatic | craft-archives | open | Task to modernize pydantic models for idiomatic pydantic 2 usage and better JSON schema generation. Filed by maintainer 817 days ago; pydantic 2 upgrade (#103) and follow-up commits have largely addressed the core concerns. No labels or maintainer response beyond Jira bot sync. | |
| #776 feat: add pydantic models for all sources | craft-parts | merged | Merged to add Pydantic models for all sources, enabling JSON schema generation for parts. Approved by two reviewers, depends on #775, and updates 16 files with a net reduction of 103 lines. | |
| #4 models: create grammar-aware pydantic models (CRAFT-856) | craft-grammar | merged | Merged. Introduces grammar-aware Pydantic models (GrammarStr, GrammarStrList, GrammarSingleEntryDictList) for lifecycle part build-environment attributes. Approved by one reviewer, passed CI, and modified 10 files. | |
| #774 feat!: rework part models for pydantic 2 | craft-parts | closed | Closed without merging. The draft PR to rework part models for Pydantic 2 received no reviews and was abandoned, likely superseded by smaller incremental PRs as noted by the author. | |
| #41 Models should be upgraded to pydantic | craft-archives | closed | Upgraded models to pydantic. Resolved via merged pull request #57. |