From a49e97358ca3b7782d02651afcaac99a4d652492 Mon Sep 17 00:00:00 2001 From: "Adrien F. Vincent" Date: Tue, 7 Mar 2017 13:37:32 +0100 Subject: [PATCH] add early check for dot binary (from graphviz) when building the doc --- doc/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 36f0d25f8f38..989f1f946a5d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,6 +14,7 @@ import os import sys import sphinx +import six # If your extensions are in another directory, add it here. If the directory # is relative to the documentation root, use os.path.abspath to make it @@ -73,6 +74,16 @@ raise ImportError("No module named Image - you need to install " "pillow to build the documentation") +if six.PY2: + from distutils.spawn import find_executable + has_dot = find_executable('dot') is not None +else: + from shutil import which # Python >= 3.3 + has_dot = which('dot') is not None +if not has_dot: + raise OSError( + "No binary named dot - you need to install the Graph Visualization " + "software (usually packaged as 'graphviz') to build the documentation") try: import matplotlib