From 44ad7e62dbcc33800e1fe54f5679f38ea61a4785 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 6 Jan 2019 10:18:15 +0100 Subject: [PATCH] Check for sphinx_copybutton when building the docs --- doc/conf.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index cc8a1754d9c0..cd168bcfb494 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -51,13 +51,16 @@ exclude_patterns = ['api/api_changes/*', 'users/whats_new/*'] -def _check_deps(): - names = {"colorspacious": 'colorspacious', - "IPython.sphinxext.ipython_console_highlighting": 'ipython', - "matplotlib": 'matplotlib', - "numpydoc": 'numpydoc', - "PIL.Image": 'pillow', - "sphinx_gallery": 'sphinx_gallery'} +def _check_dependencies(): + names = { + "colorspacious": 'colorspacious', + "IPython.sphinxext.ipython_console_highlighting": 'ipython', + "matplotlib": 'matplotlib', + "numpydoc": 'numpydoc', + "PIL.Image": 'pillow', + "sphinx_copybutton": 'sphinx_copybutton', + "sphinx_gallery": 'sphinx_gallery', + } missing = [] for name in names: try: @@ -69,7 +72,8 @@ def _check_deps(): "The following dependencies are missing to build the " "documentation: {}".format(", ".join(missing))) -_check_deps() +_check_dependencies() + # Import only after checking for dependencies. # gallery_order.py from the sphinxext folder provides the classes that