diff --git a/.travis.yml b/.travis.yml index 93dd724f..e46f9962 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,12 @@ cache: # See http://docs.travis-ci.com/user/caching/#pip-cache directories: - $HOME/.cache/pip + - $HOME/.cache/sphinx + - $HOME/.ccache addons: apt: packages: + - ccache - libfreeimage3 - texlive - texlive-latex-extra @@ -40,8 +43,9 @@ python: - 3.4 before_install: + - ccache -s + - export PATH=/usr/lib/ccache:${PATH} - source tools/travis_before_install.sh - - which python; python --version - python check_bento_build.py - tools/build_versions.py diff --git a/doc/Makefile b/doc/Makefile index 82478f07..589e2937 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -5,12 +5,13 @@ PYTHON ?= python SPHINXOPTS ?= SPHINXBUILD ?= python $(shell which sphinx-build) +SPHINXCACHE ?= build/doctrees PAPER ?= # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +ALLSPHINXOPTS = -d $(SPHINXCACHE) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source DEST = build .PHONY: all help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest gitwash gh-pages release_notes random_gallery diff --git a/doc/source/conf.py b/doc/source/conf.py index 5f121d05..8107cfd3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -296,7 +296,8 @@ plot2rst_rcparams = {'image.cmap' : 'gray', # ----------------------------------------------------------------------------- # intersphinx # ----------------------------------------------------------------------------- -_python_doc_base = 'http://docs.python.org/2.7' +_python_version_str = '{0.major}.{0.minor}'.format(sys.version_info) +_python_doc_base = 'http://docs.python.org/' + _python_version_str intersphinx_mapping = { 'python': (_python_doc_base, None), 'numpy': ('http://docs.scipy.org/doc/numpy', diff --git a/tools/travis_script.sh b/tools/travis_script.sh index afb1cf41..ad3afca3 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -9,7 +9,7 @@ section_end "Test.with.min.requirements" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - make html + export SPHINXCACHE=$HOME/.cache/sphinx; make html fi section_end "Build.docs"