← Back to issue list

chore(lint): get around a Pydantic 2.10.x type bug

View original Github issue

Metadata

Project
craft-application
Number
#566
Type
pull request
State
merged
Author
tigarmo
Labels
Created
Updated
Closed

Current evaluation

Merged a linting workaround to suppress spurious type-checking errors in mypy and pyright regarding Pydantic 2.10.x's field.default_factory(). The upstream bug will not be fixed, but the suppression approach was approved and merged.

Suggested action:

No scores available.

Issue body

Both mypy and pyright complain that the "field.default_factory()" call has too few arguments, even though its type is typing.Callable[[], Any]. It should be fixed soon, and in the meantime we can ignore the spurious error. Ref: https://github.com/pydantic/pydantic/issues/10945 - [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `tox`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged a linting workaround to suppress spurious type-checking errors in mypy and pyright regarding Pydantic 2.10.x's field.default_factory(). The upstream bug will not be fixed, but the suppression approach was approved and merged.
qwen3.6-35b-a3b-mtp-q6 Merged a temporary lint workaround to suppress false positives from mypy and pyright regarding Pydantic 2.10.x's default_factory type signature. The change ignores the spurious error while awaiting an upstream fix.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#238 chore(lint): get around pydantic 2.10.x bugs craft-store merged 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.
78%
#4406 chore: ignore types snapcraft merged Merged to resolve pyright 1.1.332 type errors by ignoring specific types, unblocking issue #4087. The change updates two files. A follow-up task to remove pkg_resources was created as issue #4407.
70%