From e2e6496f8121b2ef715a6e768387eecd3ebcc2f3 Mon Sep 17 00:00:00 2001 From: klonuo Date: Fri, 3 Jun 2016 07:43:19 +0200 Subject: [PATCH 1/2] Update make.py Referencing #6527, these changes provide: - fix for symlink exception on Windows - no need for rebuilding matplotlib from source --- doc/make.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/make.py b/doc/make.py index 4869fc96ca77..21c322167a05 100755 --- a/doc/make.py +++ b/doc/make.py @@ -7,6 +7,7 @@ import sys import re import argparse +import matplotlib def copy_if_out_of_date(original, derived): if (not os.path.exists(derived) or @@ -38,7 +39,13 @@ def linkcheck(): def html(buildername='html'): check_build() - copy_if_out_of_date('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc') + + rc = '../lib/matplotlib/mpl-data/matplotlibrc' + active_rc = matplotlib.matplotlib_fname() + if not os.path.exists(rc) and os.path.exists(active_rc): + rc = active_rc + copy_if_out_of_date(rc, '_static/matplotlibrc') + if small_docs: options = "-D plot_formats=png:80" else: @@ -168,9 +175,9 @@ def all(): raise RuntimeError("doc/{0} should be a directory or symlink -- it" " isn't".format(link)) if not os.path.exists(link): - if hasattr(os, 'symlink'): + try: os.symlink(target, link) - else: + except OSError: symlink_warnings.append('files copied to {0}'.format(link)) shutil.copytree(os.path.join(link, '..', target), link) From 070fbffd7e398f3ae13990897298e4ab840c47ec Mon Sep 17 00:00:00 2001 From: klonuo Date: Sat, 4 Jun 2016 05:33:51 +0200 Subject: [PATCH 2/2] Update make.py Fallback to default "matplotlibrc" instead user's "matplotlibrc" --- doc/make.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/make.py b/doc/make.py index 21c322167a05..b70e9c8a9ea8 100755 --- a/doc/make.py +++ b/doc/make.py @@ -41,9 +41,9 @@ def html(buildername='html'): check_build() rc = '../lib/matplotlib/mpl-data/matplotlibrc' - active_rc = matplotlib.matplotlib_fname() - if not os.path.exists(rc) and os.path.exists(active_rc): - rc = active_rc + default_rc = os.path.join(matplotlib._get_data_path(), 'matplotlibrc') + if not os.path.exists(rc) and os.path.exists(default_rc): + rc = default_rc copy_if_out_of_date(rc, '_static/matplotlibrc') if small_docs: