From f87e9f46daf42ad78626e3fa5342eeacc7f19d8e Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 24 Aug 2018 11:13:19 +0200 Subject: [PATCH] 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) https://github.com/sphinx-doc/sphinx/pull/4975 - sphinx 1.8 introduced autodoc_default_options to replace autodoc_default_flags https://github.com/sphinx-doc/sphinx/pull/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 --- doc/conf.py | 8 ++++++-- doc/sphinxext/github.py | 4 ---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 5b2395702e62..45fd6620e373 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -37,7 +37,6 @@ 'IPython.sphinxext.ipython_directive', 'numpydoc', # Needs to be loaded *after* autodoc. 'sphinx_gallery.gen_gallery', - 'matplotlib.sphinxext.mathmpl', 'matplotlib.sphinxext.plot_directive', 'sphinxext.custom_roles', 'sphinxext.github', @@ -45,6 +44,8 @@ 'sphinxext.mock_gui_toolkits', 'sphinxext.skip_deprecated', ] +if sphinx.version_info < (1, 8): + extensions.append('matplotlib.sphinxext.mathmpl') exclude_patterns = ['api/api_changes/*', 'users/whats_new/*'] @@ -84,7 +85,10 @@ def _check_deps(): autosummary_generate = True autodoc_docstring_signature = True -autodoc_default_flags = ['members', 'undoc-members'] +if sphinx.version_info < (1, 8): + autodoc_default_flags = ['members', 'undoc-members'] +else: + autodoc_default_options = {'members': None, 'undoc-members': None} intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), diff --git a/doc/sphinxext/github.py b/doc/sphinxext/github.py index 8f0ffc0d9782..75c5ce10ae9d 100644 --- a/doc/sphinxext/github.py +++ b/doc/sphinxext/github.py @@ -75,7 +75,6 @@ def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]): prb = inliner.problematic(rawtext, rawtext, msg) return [prb], [msg] app = inliner.document.settings.env.app - #app.info('issue %r' % text) if 'pull' in name.lower(): category = 'pull' elif 'issue' in name.lower(): @@ -105,7 +104,6 @@ def ghuser_role(name, rawtext, text, lineno, inliner, options={}, content=[]): :param content: The directive content for customization. """ app = inliner.document.settings.env.app - #app.info('user link %r' % text) ref = 'https://www.github.com/' + text node = nodes.reference(rawtext, text, refuri=ref, **options) return [node], [] @@ -126,7 +124,6 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]): :param content: The directive content for customization. """ app = inliner.document.settings.env.app - #app.info('user link %r' % text) try: base = app.config.github_project_url if not base: @@ -146,7 +143,6 @@ def setup(app): :param app: Sphinx application context. """ - app.info('Initializing GitHub plugin') app.add_role('ghissue', ghissue_role) app.add_role('ghpull', ghissue_role) app.add_role('ghuser', ghuser_role) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy