Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain that matplotlib must be built before the HTML documentation #1660

Merged
merged 4 commits into from Jan 23, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/README.txt
Expand Up @@ -39,6 +39,15 @@ for the initial run (which builds the example gallery) to be done,
then run "python make.py html" again. The top file of the results will
be ./build/html/index.html

Note that Sphinx uses the installed version of the package to build
the documentation, so matplotlib must be installed *before* the docs
can be generated. Even if that is the case, one of the files needed
to do this, '../lib/matplotlib/mpl-data/matplotlibrc', is not version
controlled, but created when matplotlib is built. This means that the
documentation cannot be generated immediately after checking out the
source code, even if matplotlib is installed on your system: you will
have to run ``python setup.py build`` first.

To build a smaller version of the documentation (without
high-resolution PNGs and PDF examples), type "python make.py --small
html".
7 changes: 6 additions & 1 deletion doc/conf.py
Expand Up @@ -47,7 +47,12 @@
# other places throughout the built documents.
#
# The short X.Y version.
import matplotlib
try:
import matplotlib
except ImportError:
msg = "Error: matplotlib must be installed before building the documentation"
sys.exit(msg)

version = matplotlib.__version__
# The full version, including alpha/beta/rc tags.
release = version
Expand Down
10 changes: 9 additions & 1 deletion doc/make.py
Expand Up @@ -110,7 +110,15 @@ def copytree(src, dst, symlinks=False, ignore=None):
def copy_if_out_of_date(original, derived):
if (not os.path.exists(derived) or
os.stat(derived).st_mtime < os.stat(original).st_mtime):
shutil.copyfile(original, derived)
try:
shutil.copyfile(original, derived)
except IOError:
if os.path.basename(original) == 'matplotlibrc':
msg = "'%s' not found. " % original + \
"Did you run `python setup.py build`?"
raise IOError(msg)
else:
raise

def check_build():
build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
Expand Down