Skip to content

chore: align mypy config and type stubs in pyproject.toml - #1072

Merged
Lash-L merged 1 commit into
Python-roborock:mainfrom
allenporter:chore-align-mypy-config
Nov 22, 2026
Merged

Lash-L merged 1 commit into
Python-roborock:mainfrom
allenporter:chore-align-mypy-config

Conversation

@allenporter

@allenporter allenporter commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Reviewing recent coding-agent and code-review trajectories showed that running uv run mypy roborock tests (as documented in AGENTS.md) failed out of the box in nearly every session because mypy.ini shadowed pyproject.toml overrides, stub packages were only installed inside pre-commit, and pre-commit pinned an older mypy (v1.7.1) than uv.lock (v1.19.1). That mismatch caused contributors and agents to burn extra turns and tokens troubleshooting unrelated mypy errors 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

  • Consolidate mypy.ini into [tool.mypy] in pyproject.toml so [[tool.mypy.overrides]] (such as roborock.map.proto.*) are no longer silently shadowed by mypy.ini.
  • Add types-PyYAML, types-paho-mqtt, and types-protobuf to [dependency-groups] dev and align .pre-commit-config.yaml (mirrors-mypy v1.19.1, scoping the cli.py exclusion to ^roborock/cli\.py$) so uv run mypy roborock tests and uv run pre-commit run --all-files check the exact same rules and stubs.
  • Resolve minor mypy 1.19.1 type annotations uncovered once local uv run mypy and pre-commit match.

Test Plan

  • uv run mypy roborock tests (Python 3.11 & --python-version 3.14)
  • uv run pre-commit run --all-files
  • uv run pytest

Copilot AI balanced review requested due to automatic review settings November 22, 2026 01:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@allenporter
allenporter requested a review from Lash-L November 22, 2026 01:55
@Lash-L
Lash-L merged commit 8551bd8 into Python-roborock:main Nov 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants