update to the latest mypy bringin the code base to the new requirements
Metadata
Current evaluation
Fixed and closed after updating the codebase to meet mypy 0.620 requirements. All listed type errors for incompatible returns, optional values, and assignments were resolved.
Suggested action: —
No scores available.
Issue body
The latest mypy, 0.620, fixes many of the required ignores we have, but comes with a few additional checks, particularly the use of None when returning a specific type,
napcraft/extractors/_metadata.py:83: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:92: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:101: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:110: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:119: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:128: error: Incompatible return value type (got "Optional[str]", expected "str")
snapcraft/extractors/_metadata.py:137: error: Incompatible return value type (got "Optional[List[str]]", expected "List[str]")
snapcraft/internal/steps.py:26: error: Incompatible types in assignment (expression has type "None", variable has type "int")
snapcraft/internal/steps.py:41: error: Incompatible return value type (got "None", expected "Step")
snapcraft/internal/steps.py:47: error: Incompatible return value type (got "None", expected "Step")
snapcraft/internal/dirs.py:41: error: Value of type variable "AnyStr" of "join" cannot be "Optional[str]"
snapcraft/internal/dirs.py:42: error: Value of type variable "AnyStr" of "join" cannot be "Optional[str]"
snapcraft/internal/dirs.py:43: error: Value of type variable "AnyStr" of "join" cannot be "Optional[str]"
snapcraft/internal/dirs.py:44: error: Value of type variable "AnyStr" of "join" cannot be "Optional[str]"
snapcraft/config.py:80: error: Incompatible types in assignment (expression has type "None", variable has type "str")
snapcraft/config.py:107: error: Incompatible return value type (got "None", expected "str")
snapcraft/config.py:184: error: Incompatible return value type (got "None", expected "str")
snapcraft/project/_project_options.py:247: error: Incompatible types in assignment (expression has type "None", variable has type "str")
snapcraft/project/_project_options.py:252: error: Incompatible types in assignment (expression has type "Optional[str]", variable has type "str")
snapcraft/internal/elf.py:184: error: Incompatible return value type (got "None", expected "str")
snapcraft/internal/elf.py:223: error: Incompatible types in assignment (expression has type "None", variable has type "Tuple[str, str, str]")
snapcraft/_store.py:165: error: Item "None" of "Optional[StoreClient]" has no attribute "login"
snapcraft/_store.py:180: error: Item "None" of "Optional[StoreClient]" has no attribute "login"
snapcraft/storeapi/_store_client.py:127: error: Incompatible return value type (got "Dict[str, Union[List[str], str, None]]", expected "Dict[str, Union[List[str], str]]")
snapcraft/extractors/setuppy.py:50: error: Item "None" of "Optional[Loader]" has no attribute "exec_module"
snapcraft/extractors/setuppy.py:59: error: Argument "description" to "ExtractedMetadata" has incompatible type "Optional[str]"; expected "str"
snapcraft/extractors/setuppy.py:59: error: Argument "version" to "ExtractedMetadata" has incompatible type "Optional[str]"; expected "str"
snapcraft/extractors/appstream.py:45: error: Item "None" of "Optional[str]" has no attribute "strip"
snapcraft/extractors/appstream.py:51: error: Item "None" of "Optional[str]" has no attribute "strip"
snapcraft/extractors/appstream.py:56: error: Argument "icon" to "ExtractedMetadata" has incompatible type "Union[str, Any, None]"; expected "str"
snapcraft/extractors/appstream.py:70: error: Incompatible return value type (got "None", expected "str")
snapcraft/extractors/appstream.py:83: error: Incompatible return value type (got "None", expected "str")
snapcraft/project/_project.py:37: error: Incompatible types in assignment (expression has type "None", variable has type "ProjectInfo")
snapcraft/internal/build_providers/_multipass/_multipass.py:38: error: Return type of "_mount_snaps_directory" incompatible with supertype "Provider"
snapcraft/internal/build_providers/_multipass/_multipass.py:51: error: Incompatible types in assignment (expression has type "None", variable has type "InstanceInfo")
snapcraft/plugins/python.py:252: error: Incompatible return value type (got "None", expected "str")
snapcraft/internal/project_loader/grammar/_statement.py:62: error: Incompatible types in assignment (expression has type "None", variable has type "Set[str]")
snapcraft/internal/project_loader/grammar/_statement.py:63: error: Incompatible types in assignment (expression has type "None", variable has type "Set[str]")
snapcraft/internal/project_loader/grammar/_try.py:57: error: Argument "call_stack" to "__init__" of "Statement" has incompatible type "Optional[List[Any]]"; expected "List[Any]"
snapcraft/internal/project_loader/grammar/_to.py:65: error: Argument "call_stack" to "__init__" of "Statement" has incompatible type "Optional[List[Any]]"; expected "List[Any]"
snapcraft/internal/project_loader/grammar/_to.py:109: error: Item "None" of "Optional[Match[str]]" has no attribute "group"
snapcraft/internal/project_loader/grammar/_on.py:72: error: Argument "call_stack" to "__init__" of "Statement" has incompatible type "Optional[List[Any]]"; expected "List[Any]"
snapcraft/internal/project_loader/grammar/_on.py:118: error: Item "None" of "Optional[Match[str]]" has no attribute "group"
snapcraft/internal/project_loader/grammar/_compound.py:46: error: Argument "call_stack" to "__init__" of "Statement" has incompatible type "Optional[List[Any]]"; expected "List[Any]"
snapcraft/internal/project_loader/grammar/_processor.py:91: error: Incompatible types in assignment (expression has type "None", variable has type "Statement")
snapcraft/internal/project_loader/grammar/_processor.py:98: error: Argument 2 to "_handle_else" has incompatible type "None"; expected "List[Union[str, Dict[str, Any]]]"
snapcraft/internal/project_loader/grammar/_processor.py:136: error: Item "None" of "Optional[Match[str]]" has no attribute "groups"
snapcraft/internal/project_loader/grammar/_processor.py:140: error: Argument "body" to "OnStatement" has incompatible type "None"; expected "List[Union[str, Dict[str, Any]]]"
snapcraft/internal/project_loader/grammar/_processor.py:143: error: Argument "body" to "ToStatement" has incompatible type "None"; expected "List[Union[str, Dict[str, Any]]]"
snapcraft/internal/pluginhandler/__init__.py:292: error: Incompatible return value type (got "None", expected "OutdatedReport")
snapcraft/internal/pluginhandler/__init__.py:339: error: Incompatible return value type (got "None", expected "DirtyReport")
snapcraft/internal/build_providers/_qemu/_qemu_driver.py:70: error: Incompatible types in assignment (expression has type "None", variable has type "Popen")
snapcraft/internal/build_providers/_qemu/_qemu_driver.py:119: error: Argument 1 to "_popen" has incompatible type "List[Optional[str]]"; expected "List[str]"
snapcraft/internal/build_providers/_qemu/_qemu_driver.py:143: error: Argument "exit_code" to "ProviderStopError" has incompatible type "None"; expected "int"
snapcraft/cli/_options.py:59: error: Item "None" of "Optional[Context]" has no attribute "params"
snapcraft/internal/meta/_snap_packaging.py:242: error: Incompatible return value type (got "None", expected "str")
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed and closed after updating the codebase to meet mypy 0.620 requirements. All listed type errors for incompatible returns, optional values, and assignments were resolved. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
65
Confidence:
90
Support Request:
5
|
close stale | Request to update mypy to 0.620 and fix resulting type-checking errors across the codebase. Open and inactive for ~8 years with no maintainer response or labels. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
98
Complexity:
45
Confidence:
95
Support Request:
5
|
close stale | Request to update codebase to fix mypy 0.620 type errors. Issue is over 8 years old, inactive, and references obsolete tooling. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
100
Complexity:
45
Confidence:
95
Support Request:
5
|
close stale | Request to update the codebase to pass mypy 0.620 type checks. The issue has been inactive for over 8 years with no maintainer response or labels. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
98
Complexity:
25
Confidence:
90
Support Request:
5
|
close stale | Requires fixing type mismatches to comply with mypy 0.620. Multiple files return Optional types or None where strict types are expected. The request remains unaddressed and stale with zero comments or assignments. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2996 requirements: uprev mypy to 0.770 | snapcraft | merged | Merged a dependency update bumping mypy to version 0.770. The change modified a single file with one addition and one deletion, successfully integrating the version upgrade. | |
| #2689 build(deps): update dependency mypy to v2 (main) - autoclosed | charmcraft | closed | Renovate PR updating mypy to v2 was autoclosed after static type checking failed due to incompatible assignments and missing attributes in the codebase. The dependency update was abandoned pending code fixes. | |
| #2820 uprev mypy to 0.740! (and address remaining errors) | snapcraft | merged | Merged after approval. The update upgraded mypy to 0.740, resolved remaining type errors, added optional type hints to reports and functions, and applied a temporary type ignore for ProjectInfo. CI checks passed. |