chore(lint): get around pydantic 2.10.x bugs
Metadata
Current evaluation
Merged in #238 as commit d1eb379, adding lint and test workarounds for Pydantic 2.10.x false positives and pydantic_core URL-comparison breakage.
Resolution: closed resolved
Reason: PR #238 was approved and merged as commit d1eb379. It worked around the upstream Pydantic 2.10.x bugs documented in pydantic/pydantic#10950.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox`?
Silent error, that was introduced with pydantic 2.10 release until it's fixed.
For reference: https://github.com/pydantic/pydantic/issues/10950
https://github.com/canonical/craft-application/pull/566
There was also a change in `pydantic_core`, which made `Url` incomparable with `AnyHttpUrl`. Somehow in my local environment it only failed when tests were run through `tox`, not directly. From test logs:
```
FAILURE: check https://canonical.com/ == https://canonical.com/
test_registered_name_model.py:99 in test_unmarshal() -> check.equal(actual.website, pydantic.networks.HttpUrl(json_dict.get("website")))
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in #238 as commit d1eb379, adding lint and test workarounds for Pydantic 2.10.x false positives and pydantic_core URL-comparison breakage. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #238 with lint workarounds for Pydantic 2.10.x false positives and pydantic_core URL-comparison failures; linked pydantic/pydantic#10950 and canonical/craft-application#566. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a workaround for pydantic 2.10.x bugs causing silent errors and Url comparison failures. Resolves compatibility issues in pydantic 2.10 and pydantic_core, approved by reviewers, and passed all CI checks. |
Update history
No update history recorded yet.
Related work
-
Caused By:
pydantic#10950
(confidence 99%)
Upstream Pydantic issue cited as the cause of the lint false positives.
-
Related To:
canonical/craft-application#566
(confidence 95%)
Parallel craft-application change cited for the same Pydantic compatibility workarounds.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #566 chore(lint): get around a Pydantic 2.10.x type bug | craft-application | merged | Merged #566, adding a targeted type-ignore for a false-positive Pydantic 2.10.x default_factory error; change landed in commit 5a05290a. | |
| #122 chore: eliminate pydantic warnings | craft-archives | merged | Merged PR #122 eliminated Pydantic warnings, landing as commit 00b9b3b after approval by two reviewers. | |
| #33 chore!: update to Pydantic 2 | craft-grammar | merged | Merged as commit 5e225fb via PR #33, updating craft-grammar to Pydantic 2 and revising grammar validation errors; fixes #32. | |
| #778 chore: pydantic 2 related cleanup | craft-parts | merged | Merged Pydantic 2 cleanup across seven files in commit 68d61fa0, following prerequisite plugin-model restructuring in #775. | |
| #112 chore(deps): update to pydantic 2 & bump-pydantic | craft-archives | closed | Closed unmerged; its Pydantic 2 migration was superseded by #103 (b69f44a) and merged into main through #123. | |
| #181 chore(lint): add new typing dependencies and fix pyright issues | craft-cli | merged | PR #181 merged into main as commit d34fdd6 (Sep 2023): added typing stub dependencies and fixed the resulting Pyright errors, a 1-file, +6/-1 lint/tooling change. | |
| #116 chore(deps): update dependency pydantic to v2 | craft-store | closed | Renovate's pydantic v2 bump PR was closed unmerged by @lengau (2023-10-22, "Pydantic 2 will need some significant changes"); the real migration landed later in merged PR #193 (commit 026b78d). | |
| #28 chore(deps): update dependency pydantic to v2 - autoclosed | craft-grammar | closed | Renovate's Pydantic 2 bump was closed unmerged and superseded by dedicated migration PR #33, which landed in commit 5e225fb. | |
| #612 chore: cleanup pydantic warnings | craft-providers | merged | Merged PR #612 as commit c106d34, cleaning up Pydantic warnings with a minimal two-file configuration change. | |
| #1817 chore: merge pydantic 2 support to main | charmcraft | merged | Pydantic 2 support was merged into main by PR #1817 (commit 394e6e55), completing the migration begun in #1777 across 52 files. |