← Back to issue list

update to the latest mypy bringin the code base to the new requirements

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1781893
Type
issue
State
closed
Author
~sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Closed as stale after mypy was dropped from Snapcraft; no changes for mypy 0.620 were made.

Resolution: closed stale

Reason: Maintainer mr-cal closed the item as stale on 2026-07-23, explicitly noting that Snapcraft had dropped mypy. No resolving PR or commit was identified.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed stale Closed as stale after mypy was dropped from Snapcraft; no changes for mypy 0.620 were made.
stealth/space-bunny-alpha — closed stale Closed as stale after nearly eight years; maintainer @~mr-cal said Snapcraft had dropped mypy, so the planned 0.620 migration was no longer pursued.
stealth/space-bunny-alpha — closed resolved Resolved mypy 0.620 incompatibilities with typing fixes, then bumped development mypy to 0.740 in commit 258ad6a85.
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.

Update history

Date Change
created

Related issues

Issue Project State Summary Similarity
#525 Update mypy for craft-parts craft-parts closed Closed stale without a linked fix; later PR #604 (2d882b31) loosened the mypy pin but paused updates until Python 3.7 support was dropped.
71%
#1585 build(deps): update dependency mypy to v2 (main) craft-parts closed Closed unmerged after inactivity; mypy was later dropped in merged PR #1706 (commit 770e2130).
71%