Skip to content

Commit cce3935

Browse files
timtreisclaude
andcommitted
Fix docs build: suppress upstream type-hint warnings, restore -W
Suppress sphinx-autodoc-typehints warnings from upstream libraries: - ColorType forward reference from matplotlib.figure.Figure - Guarded iris import from xarray.core.dataarray - Guarded folium import from geopandas.geodataframe These are optional deps of upstream packages, not our issue. Restores -W (warnings as errors) to match the scverse template. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fc2909a commit cce3935

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@
142142
pygments_style = "default"
143143
katex_prerender = shutil.which(katex.NODEJS_BINARY) is not None
144144

145+
suppress_warnings = [
146+
# matplotlib.figure.Figure references ColorType which isn't importable in the docs env
147+
"sphinx_autodoc_typehints.forward_reference",
148+
# xarray (iris) and geopandas (folium) have guarded TYPE_CHECKING imports for optional deps
149+
"sphinx_autodoc_typehints.guarded_import",
150+
]
151+
145152
# Ignore warnings.
146153
nitpicky = False # TODO: solve upstream.
147154

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ dependency-groups = [ "dev" ]
8282
dependency-groups = [ "doc" ]
8383

8484
[tool.hatch.envs.docs.scripts]
85-
build = "sphinx-build -M html docs docs/_build {args}"
85+
build = "sphinx-build -M html docs docs/_build -W {args}"
8686
open = "python -m webbrowser -t docs/_build/html/index.html"
8787
clean = "git clean -fdX -- {args:docs}"
8888

0 commit comments

Comments
 (0)