Repository navigation
chore: align mypy config and type stubs in pyproject.toml - #1072
Merged
Merged
Conversation
Lash-L
approved these changes
Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Reviewing recent coding-agent and code-review trajectories showed that running
uv run mypy roborock tests(as documented inAGENTS.md) failed out of the box in nearly every session becausemypy.inishadowedpyproject.tomloverrides, stub packages were only installed insidepre-commit, andpre-commitpinned an oldermypy(v1.7.1) thanuv.lock(v1.19.1). That mismatch caused contributors and agents to burn extra turns and tokens troubleshooting unrelatedmypyerrors on every PR review and bugfix. Aligning both paths makes local type-checking pass on the first run and improves token and iteration efficiency.Summary
mypy.iniinto[tool.mypy]inpyproject.tomlso[[tool.mypy.overrides]](such asroborock.map.proto.*) are no longer silently shadowed bymypy.ini.types-PyYAML,types-paho-mqtt, andtypes-protobufto[dependency-groups] devand align.pre-commit-config.yaml(mirrors-mypyv1.19.1, scoping thecli.pyexclusion to^roborock/cli\.py$) souv run mypy roborock testsanduv run pre-commit run --all-filescheck the exact same rules and stubs.mypy 1.19.1type annotations uncovered once localuv run mypyandpre-commitmatch.Test Plan
uv run mypy roborock tests(Python 3.11 &--python-version 3.14)uv run pre-commit run --all-filesuv run pytest