Skip to content

Commit 1eadd02

Browse files
committed
re-add docs to pyright, add targeted ignores
1 parent 71bebe8 commit 1eadd02

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# pyright: reportMissingImports=false
12
# Configuration file for the Sphinx documentation builder.
23
#
34
# For the full list of built-in configuration values, see the documentation:
@@ -125,12 +126,12 @@ def _patched_sort_members(
125126
if required_keys:
126127
self.add_line("", sourcename)
127128
self.add_line(":Required Keys:", sourcename)
128-
self.document_keys(required_keys, types, docstrings)
129+
self.document_keys(required_keys, types, docstrings) # pyright: ignore[reportUnknownMemberType]
129130
self.add_line("", sourcename)
130131
if optional_keys:
131132
self.add_line("", sourcename)
132133
self.add_line(":Optional Keys:", sourcename)
133-
self.document_keys(optional_keys, types, docstrings)
134+
self.document_keys(optional_keys, types, docstrings) # pyright: ignore[reportUnknownMemberType]
134135
self.add_line("", sourcename)
135136

136137
return []
@@ -169,7 +170,7 @@ def _inject_type_submodules(_app: Sphinx, docname: str, source: list[str]) -> No
169170

170171

171172
def setup(app: Sphinx) -> None:
172-
app.connect("source-read", _inject_type_submodules)
173+
app.connect("source-read", _inject_type_submodules) # pyright: ignore[reportUnknownMemberType]
173174

174175

175176
# Intersphinx mapping

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ exclude = [
138138
"_dev",
139139
".venv",
140140
".git",
141-
"docs",
142141
]
143142

144143
reportImplicitOverride = true
@@ -198,6 +197,12 @@ module = "black.files.*"
198197
ignore_errors = true
199198
ignore_missing_imports = true
200199

200+
# Sphinx packages are only installed in the docs dependency group,
201+
# not in the dev group used by CI linters.
202+
[[tool.mypy.overrides]]
203+
module = ["sphinx.*", "sphinx_toolbox.*"]
204+
ignore_missing_imports = true
205+
201206

202207
[tool.ruff]
203208
line-length = 120

0 commit comments

Comments
 (0)