Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ffdd946

Browse filesBrowse files
committed
Merge pull request #1660 from vterron/master
Explain that matplotlib must be built before the HTML documentation
2 parents abe4b3e + 3a38438 commit ffdd946
Copy full SHA for ffdd946

File tree

Expand file treeCollapse file tree

3 files changed

+24
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+24
-2
lines changed

‎doc/README.txt

Copy file name to clipboardExpand all lines: doc/README.txt
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ for the initial run (which builds the example gallery) to be done,
3939
then run "python make.py html" again. The top file of the results will
4040
be ./build/html/index.html
4141

42+
Note that Sphinx uses the installed version of the package to build
43+
the documentation, so matplotlib must be installed *before* the docs
44+
can be generated. Even if that is the case, one of the files needed
45+
to do this, '../lib/matplotlib/mpl-data/matplotlibrc', is not version
46+
controlled, but created when matplotlib is built. This means that the
47+
documentation cannot be generated immediately after checking out the
48+
source code, even if matplotlib is installed on your system: you will
49+
have to run ``python setup.py build`` first.
50+
4251
To build a smaller version of the documentation (without
4352
high-resolution PNGs and PDF examples), type "python make.py --small
4453
html".

‎doc/conf.py

Copy file name to clipboardExpand all lines: doc/conf.py
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@
4747
# other places throughout the built documents.
4848
#
4949
# The short X.Y version.
50-
import matplotlib
50+
try:
51+
import matplotlib
52+
except ImportError:
53+
msg = "Error: matplotlib must be installed before building the documentation"
54+
sys.exit(msg)
55+
5156
version = matplotlib.__version__
5257
# The full version, including alpha/beta/rc tags.
5358
release = version

‎doc/make.py

Copy file name to clipboardExpand all lines: doc/make.py
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,15 @@ def copytree(src, dst, symlinks=False, ignore=None):
110110
def copy_if_out_of_date(original, derived):
111111
if (not os.path.exists(derived) or
112112
os.stat(derived).st_mtime < os.stat(original).st_mtime):
113-
shutil.copyfile(original, derived)
113+
try:
114+
shutil.copyfile(original, derived)
115+
except IOError:
116+
if os.path.basename(original) == 'matplotlibrc':
117+
msg = "'%s' not found. " % original + \
118+
"Did you run `python setup.py build`?"
119+
raise IOError(msg)
120+
else:
121+
raise
114122

115123
def check_build():
116124
build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.