8000 Merge pull request #8221 from afvincent/doc_early_check_for_dot · matplotlib/matplotlib@bb167dd · GitHub
[go: up one dir, main page]

Skip to content

Commit bb167dd

Browse files
authored
Merge pull request #8221 from afvincent/doc_early_check_for_dot
Early check for dot binary (from graphviz) when building the doc (fixes #8207)
2 parents 558fb80 + a49e973 commit bb167dd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import os
1515
import sys
1616
import sphinx
17+
import six
1718

1819
# If your extensions are in another directory, add it here. If the directory
1920
# is relative to the documentation root, use os.path.abspath to make it
@@ -73,6 +74,16 @@
7374
raise ImportError("No module named Image - you need to install "
7475
"pillow to build the documentation")
7576

77+
if six.PY2:
78+
from distutils.spawn import find_executable
79+
has_dot = find_executable('dot') is not None
80+
else:
81+
from shutil import which # Python >= 3.3
82+
has_dot = which('dot') is not None
83+
if not has_dot:
84+
raise OSError(
85+
"No binary named dot - you need to install the Graph Visualization "
86+
"software (usually packaged as 'graphviz') to build the documentation")
7687

7788
try:
7889
import matplotlib

0 commit comments

Comments
 (0)
0