Skip to content

Commit be1a01f

Browse files
committed
DOCS: docs should fail on warning
1 parent ce29648 commit be1a01f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/conf.py

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import sphinx
2121

2222
from datetime import datetime
23+
import warnings
2324

2425
# If your extensions are in another directory, add it here. If the directory
2526
# is relative to the documentation root, use os.path.abspath to make it
@@ -30,6 +31,11 @@
3031
# General configuration
3132
# ---------------------
3233

34+
# Unless we catch the warning explicitly somewhere, a warning should cause the
35+
# docs build to fail. This is especially useful for getting rid of deprecated
36+
# usage in the gallery.
37+
warnings.filterwarnings('error', append=True)
38+
3339
# Strip backslahes in function's signature
3440
# To be removed when numpydoc > 0.9.x
3541
strip_signature_backslash = True
@@ -108,6 +114,11 @@ def _check_dependencies():
108114

109115
autosummary_generate = True
110116

117+
# we should ignore warnings coming from importing deprecated modules for
118+
# autodoc purposes, as this will disappear automatically when they are removed
119+
warnings.filterwarnings('ignore', message='.*module was deprecated.*',
120+
category=MatplotlibDeprecationWarning)
121+
111122
autodoc_docstring_signature = True
112123
autodoc_default_options = {'members': None, 'undoc-members': None}
113124

@@ -155,6 +166,7 @@ def _check_dependencies():
155166
'thumbnail_size': (320, 224),
156167
'compress_images': ('thumbnails', 'images'),
157168
'matplotlib_animations': True,
169+
'abort_on_example_error': True,
158170
}
159171

160172
plot_gallery = 'True'

0 commit comments

Comments
 (0)