Skip to content

Commit ab0e576

Browse files
committed
Update doc/conf.py to avoid warnings with (future) sphinx 1.8.
- sphinx 1.8 activates math by default; don't use mathmpl in that case (to avoid a duplicate-role warning) (mathmpl may be later deprecated once we depend on sphinx 1.8 for the doc build) sphinx-doc/sphinx#4975 - sphinx 1.8 introduced autodoc_default_options to replace autodoc_default_flags sphinx-doc/sphinx#5315 - sphinx 1.6 deprecated app.info in favor of a logging API, but we don't really need either anyways http://www.sphinx-doc.org/en/master/changes.html#id52
1 parent 7b5ff33 commit ab0e576

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/conf.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@
3737
'IPython.sphinxext.ipython_directive',
3838
'numpydoc', # Needs to be loaded *after* autodoc.
3939
'sphinx_gallery.gen_gallery',
40-
'matplotlib.sphinxext.mathmpl',
4140
'matplotlib.sphinxext.plot_directive',
4241
'sphinxext.custom_roles',
4342
'sphinxext.github',
4443
'sphinxext.math_symbol_table',
4544
'sphinxext.mock_gui_toolkits',
4645
'sphinxext.skip_deprecated',
4746
]
47+
if sphinx.version_info < (1, 8):
48+
extensions.append('matplotlib.sphinxext.mathmpl')
4849

4950
exclude_patterns = ['api/api_changes/*', 'users/whats_new/*']
5051

@@ -84,7 +85,10 @@ def _check_deps():
8485
autosummary_generate = True
8586

8687
autodoc_docstring_signature = True
87-
autodoc_default_flags = ['members', 'undoc-members']
88+
if sphinx.version_info < (1, 8):
89+
autodoc_default_flags = ['members', 'undoc-members']
90+
else:
91+
autodoc_default_options = {'members': '', 'undoc-members': ''}
8892

8993
intersphinx_mapping = {
9094
'python': ('https://docs.python.org/3', None),

doc/sphinxext/github.py

-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
7575
prb = inliner.problematic(rawtext, rawtext, msg)
7676
return [prb], [msg]
7777
app = inliner.document.settings.env.app
78-
#app.info('issue %r' % text)
7978
if 'pull' in name.lower():
8079
category = 'pull'
8180
elif 'issue' in name.lower():
@@ -105,7 +104,6 @@ def ghuser_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
105104
:param content: The directive content for customization.
106105
"""
107106
app = inliner.document.settings.env.app
108-
#app.info('user link %r' % text)
109107
ref = 'https://www.github.com/' + text
110108
node = nodes.reference(rawtext, text, refuri=ref, **options)
111109
return [node], []
@@ -126,7 +124,6 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
126124
:param content: The directive content for customization.
127125
"""
128126
app = inliner.document.settings.env.app
129-
#app.info('user link %r' % text)
130127
try:
131128
base = app.config.github_project_url
132129
if not base:
@@ -146,7 +143,6 @@ def setup(app):
146143
147144
:param app: Sphinx application context.
148145
"""
149-
app.info('Initializing GitHub plugin')
150146
app.add_role('ghissue', ghissue_role)
151147
app.add_role('ghpull', ghissue_role)
152148
app.add_role('ghuser', ghuser_role)

0 commit comments

Comments
 (0)