Skip to content

Enable mypy strict mode with per-module exemptions - #667

Merged
Pierre-Sassoulas merged 9 commits into
mainfrom
mypy-strict
Sep 29, 2026
Merged

Pierre-Sassoulas merged 9 commits into
mainfrom
mypy-strict

Conversation

@Pierre-Sassoulas

Copy link
Copy Markdown
Member

Added typing on the simple one: pytestqt.utils, pytestqt.exceptions, test_qtest_proxies, test_qtbot_pep8_aliases, test_screenshot, test_wait_until, test_logging

Still not typed:

  • plugin, qt_compat, qtbot, logging, modeltest, wait_signal.
  • conftest, test_basics, test_exceptions, test_modeltest, test_wait_signal.

Pierre-Sassoulas and others added 9 commits September 29, 2026 16:24
Turn on ``strict = True`` so new code must be fully typed, and list the
modules that do not pass yet in per-module overrides. Each list should
shrink as annotations are added, until ``py.typed`` can drop ``partial``.

Also fix the few errors that ``disallow_incomplete_defs``,
``warn_return_any`` and ``no_implicit_reexport`` found, and set
``mypy_path = src`` so single files resolve ``pytestqt``.

Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the Counter helper to module level so tests can use it as a type.

Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The annotations replace the ':type pytester:' docstring lines.

Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The traceback in CapturedException is now Optional, matching what
sys.excepthook actually receives.

Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reuse CapturedException for its parameters with Unpack instead of
spelling the signature out inline.

Refs #595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Pierre-Sassoulas
Pierre-Sassoulas merged commit ae6dfb6 into main Sep 29, 2026
65 checks passed
@Pierre-Sassoulas
Pierre-Sassoulas deleted the mypy-strict branch September 29, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants