What is the problem or limitation you are having?
There is no type checking in the project. Type errors are caught only at runtime or during review. Previous discussion (#665) concluded that mypy was too slow and annotations weren't an inherent good. ty changes the equation — it checks all of src/briefcase/ in ~0.16s.
See Type checking with ty (discussion) for background.
Describe the solution you'd like
Gradually introduce ty type checking, module by module, without disrupting existing workflows.
Current state:
- 597 diagnostics on
src/briefcase/ with ty 0.0.18
- Many are
unresolved-attribute from dynamic attribute access on BaseConfig/AppConfig
- ~60% of files already have
from __future__ import annotations
- Newer code (channels, integrations, debuggers) already uses Protocols and annotations
Roadmap:
Describe alternatives you've considered
- mypy: too slow for pre-commit/CI integration, heavier configuration burden
- pyright: faster than mypy but still heavier than ty; not part of the existing Astral toolchain
- Do nothing: viable, but misses real catches (e.g. functions with implicit
None returns typed as -> bool)
Additional context
Principles agreed on in the discussion:
- ty adapts to the codebase, not the other way around
- Non-blocking until a module is explicitly opted in
- Pin ty version, upgrade deliberately
- Dynamic attributes are intentional. Platform modules may stay excluded or warn-only long-term
What is the problem or limitation you are having?
There is no type checking in the project. Type errors are caught only at runtime or during review. Previous discussion (#665) concluded that mypy was too slow and annotations weren't an inherent good. ty changes the equation — it checks all of
src/briefcase/in ~0.16s.See Type checking with ty (discussion) for background.
Describe the solution you'd like
Gradually introduce ty type checking, module by module, without disrupting existing workflows.
Current state:
src/briefcase/with ty 0.0.18unresolved-attributefrom dynamic attribute access onBaseConfig/AppConfigfrom __future__ import annotationsRoadmap:
toxenv +pyproject.tomlconfig, pinned version)tyseeBaseCommandattributes on platform mixins #2734channels/,integrations/base.py)Describe alternatives you've considered
Nonereturns typed as-> bool)Additional context
Principles agreed on in the discussion: