From cc832530ef784723953dcb3ae943d95da6afb557 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 16 Feb 2013 15:46:10 +0200 Subject: MAINT: always use plot directive from Matplotlib, and prefer Sphinx linkcode --- doc/source/conf.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'doc/source/conf.py') diff --git a/doc/source/conf.py b/doc/source/conf.py index de9f6adf3..0fb517961 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -20,24 +20,8 @@ sys.path.insert(0, os.path.abspath('../sphinxext')) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'numpydoc', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', - 'sphinx.ext.doctest', 'sphinx.ext.autosummary'] - -# Determine if the matplotlib has a recent enough version of the -# plot_directive, otherwise use the local fork. -try: - from matplotlib.sphinxext import plot_directive -except ImportError: - use_matplotlib_plot_directive = False -else: - try: - use_matplotlib_plot_directive = (plot_directive.__version__ >= 2) - except AttributeError: - use_matplotlib_plot_directive = False - -if use_matplotlib_plot_directive: - extensions.append('matplotlib.sphinxext.plot_directive') -else: - extensions.append('plot_directive') + 'sphinx.ext.doctest', 'sphinx.ext.autosummary', + 'matplotlib.sphinxext.plot_directive'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -283,9 +267,6 @@ plot_rcparams = { 'text.usetex': False, } -if not use_matplotlib_plot_directive: - import matplotlib - matplotlib.rcParams.update(plot_rcparams) # ----------------------------------------------------------------------------- # Source code links @@ -294,7 +275,7 @@ if not use_matplotlib_plot_directive: import inspect from os.path import relpath, dirname -for name in ['sphinx.ext.linkcode', 'linkcode', 'numpydoc.linkcode']: +for name in ['sphinx.ext.linkcode', 'numpydoc.linkcode']: try: __import__(name) extensions.append(name) -- cgit v1.2.1