← Back to issue list

Make type checkers aware of type annotations

View original Github issue

Metadata

Project
craft-cli
Number
#35
Type
pull request
State
merged
Author
jugmac00
Labels
Created
Updated
Closed

Current evaluation

Merged to add a py.typed file to craft-cli, enabling static type checkers like mypy to recognize its type annotations. Approved and passed CI.

Suggested action:

No scores available.

Issue body

See https://jugmac00.github.io/blog/bite-my-shiny-type-annotated-library/ - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? No, this is not necessary as I am an employee of Canonical. **Background** We intend to use this package for a Launchpad project. Our `mypy` check failed as `craft-cli` does not include a `py.typed` file. Also see https://jugmac00.github.io/blog/bite-my-shiny-type-annotated-library/

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged to add a py.typed file to craft-cli, enabling static type checkers like mypy to recognize its type annotations. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 Merged a pull request adding a py.typed file to craft-cli. This resolves mypy check failures by exposing existing type annotations to type checkers. The change was integrated without a CLA since the author is a Canonical employee.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#107 build: add py.typed craft-archives merged Merged to add a py.typed marker file, signaling PEP 561 compliance for static type checking. Approved by two reviewers, passed CI, and introduced no code changes.
76%
#350 linters: set disallow_untyped_defs in mypy craft-parts merged Merged after approval and passing CI. Enables mypy disallow_untyped_defs, enforcing type annotations across 55 files in craft_parts. Author updated tests and addressed reviewer feedback prior to merge.
71%
#1747 static tests: enable type checking by use of mypy snapcraft merged Merged after two approvals and passing CI. Enabled mypy type checking for static tests by resolving initial type errors and removing dead storeapi compat code. Integrated into runtests.sh static, deferring unit package init typing as a TODO.
70%