Commit 920571e
committed
chore(mypy): add docs/_ext to mypy_path + exclude docs/ for CI parity
tests/docs imports the widget framework as ``from widgets ...`` (the same
way docs/conf.py loads it, via a sys.path insertion). Under mypy strict
that raises "Cannot find implementation or library stub for module named
'widgets'". Listing ``docs/_ext`` under ``mypy_path`` alone -- rather
than adding it to ``files`` -- avoids the reciprocal "source file found
twice under different module names" error that would fire if mypy
discovered the package via both its parent path and as a top-level
module.
``exclude = ["^docs/"]`` is also required so that the CI invocation
``uv run mypy .`` -- which traverses every path under the current
directory -- doesn't rediscover files in ``docs/_ext/widgets/`` under
their ``docs._ext.`` prefix and error with the same "found twice"
message. The widgets package is still fully type-checked via the
``mypy_path`` entry; the exclude only affects discovery-by-traversal.
Both settings are needed from the moment the widgets package was
introduced (17a406a); the ``mypy .`` failure was only surfaced by CI
after tests/docs landed.1 parent 6b46a51 commit 920571e
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
118 | 126 | | |
119 | 127 | | |
120 | 128 | | |
| |||
0 commit comments