From e224b0dd7d52e98894a9d39bf590170a7039af40 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sat, 5 Sep 2015 15:48:20 +0200 Subject: [PATCH 01/10] Enable ccache on Travis --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eeb21d97..4c8ab126 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,11 @@ cache: # See http://docs.travis-ci.com/user/caching/#pip-cache directories: - $HOME/.cache/pip + - $HOME/.ccache addons: apt: packages: + - ccache - libfreeimage3 - texlive - texlive-latex-extra @@ -36,8 +38,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 From 8721bee3ef9747a9d5548157e594833e360d6682 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sat, 5 Sep 2015 18:29:40 +0200 Subject: [PATCH 02/10] Attempt to cache the sphinx-build intermediates on Travis. --- .travis.yml | 1 + tools/travis_script.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4c8ab126..6a282420 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ cache: # See http://docs.travis-ci.com/user/caching/#pip-cache directories: - $HOME/.cache/pip + - $HOME/.cache/sphinx - $HOME/.ccache addons: apt: diff --git a/tools/travis_script.sh b/tools/travis_script.sh index afb1cf41..9810f855 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 + SPHINXBUILD="python $(which sphinx-build) -d $HOME/.cache/sphinx" make html fi section_end "Build.docs" From d29c97f6252be8d2c536dccc84d98114752b1bb5 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sat, 5 Sep 2015 21:59:49 +0200 Subject: [PATCH 03/10] Fix the SPHINXBUILD define for Travis --- tools/travis_script.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 9810f855..b5d3141a 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -9,7 +9,8 @@ section_end "Test.with.min.requirements" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - SPHINXBUILD="python $(which sphinx-build) -d $HOME/.cache/sphinx" make html + export SPHINXBUILD="python $(which sphinx-build) -d $HOME/.cache/sphinx" + make html fi section_end "Build.docs" From abd0f4847326c8171b7085fc0945753fe7f2fc2e Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 6 Sep 2015 08:27:32 +0200 Subject: [PATCH 04/10] Correct the docs build on Travis --- tools/travis_script.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/travis_script.sh b/tools/travis_script.sh index b5d3141a..0fc4eb13 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -9,8 +9,9 @@ section_end "Test.with.min.requirements" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - export SPHINXBUILD="python $(which sphinx-build) -d $HOME/.cache/sphinx" - make html + pushd doc + python `which sphinx-build` -d $HOME/.cache/sphinx -W source build/html + popd fi section_end "Build.docs" From dc394abdf3221e62ec6e78fe64e1509590d0e31f Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 6 Sep 2015 12:14:36 +0200 Subject: [PATCH 05/10] Try again with the sphinx build on Travis. --- tools/travis_script.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 0fc4eb13..0331575b 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -9,8 +9,9 @@ section_end "Test.with.min.requirements" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then + SPHINXBUILD="python $(which sphinx-build)" pushd doc - python `which sphinx-build` -d $HOME/.cache/sphinx -W source build/html + $SPHINXBUILD -d $HOME/.cache/sphinx -W source build/html popd fi section_end "Build.docs" From 97ff3576bbeb57ac97e454b8f060807735e4e297 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 6 Sep 2015 15:42:08 +0200 Subject: [PATCH 06/10] Make sure sphinx is installed before building the docs on Travis --- optional_requirements.txt | 1 + tools/travis_script.sh | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/optional_requirements.txt b/optional_requirements.txt index 6dff92af..d6472ca0 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -4,3 +4,4 @@ SimpleITK; python_version != '3.4' astropy tifffile imageio; python_version != '2.6' +sphinx; python_version != '2.6' and python_version != '3.2' diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 0331575b..945f6a49 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -7,15 +7,6 @@ section "Test.with.min.requirements" nosetests $TEST_ARGS skimage section_end "Test.with.min.requirements" -section "Build.docs" -if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - SPHINXBUILD="python $(which sphinx-build)" - pushd doc - $SPHINXBUILD -d $HOME/.cache/sphinx -W source build/html - popd -fi -section_end "Build.docs" - section "Flake8.test" flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples section_end "Flake8.test" @@ -58,6 +49,16 @@ pip list section_end "Install.optional.dependencies" +section "Build.docs" +if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then + SPHINXBUILD="python $(which sphinx-build)" + pushd doc + $SPHINXBUILD -d $HOME/.cache/sphinx -W source build/html + popd +fi +section_end "Build.docs" + + section "Run.doc.examples" # Matplotlib settings - do not show figures during doc examples From 7e4c1d2b36374549369be15540a60302edefe33f Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Mon, 7 Sep 2015 18:33:55 +0200 Subject: [PATCH 07/10] Allow a cache directory to be passed to the docs Makefile --- doc/Makefile | 3 ++- tools/travis_script.sh | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) 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/tools/travis_script.sh b/tools/travis_script.sh index 945f6a49..e6ca59c4 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -51,10 +51,8 @@ section_end "Install.optional.dependencies" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - SPHINXBUILD="python $(which sphinx-build)" - pushd doc - $SPHINXBUILD -d $HOME/.cache/sphinx -W source build/html - popd + export SPHINXCACHE=$HOME/.cache/sphinx + make html fi section_end "Build.docs" From a445dda638a5baa4646e5b7520360a52a47a1e5a Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 13 Sep 2015 10:50:22 +0200 Subject: [PATCH 08/10] Put the docs build command on a single line. --- tools/travis_script.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/travis_script.sh b/tools/travis_script.sh index e6ca59c4..f46d5306 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -51,8 +51,7 @@ section_end "Install.optional.dependencies" section "Build.docs" if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - export SPHINXCACHE=$HOME/.cache/sphinx - make html + export SPHINXCACHE=$HOME/.cache/sphinx; make html fi section_end "Build.docs" From 4fe753fd453bc5d6b45db03e877f8833952390ce Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 13 Sep 2015 12:53:54 +0200 Subject: [PATCH 09/10] Use the current python version for the python intersphinx reference --- doc/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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', From 8c2d8e8e0049b0206dc492fb078d21edb5106eb2 Mon Sep 17 00:00:00 2001 From: John Wiggins Date: Sun, 13 Sep 2015 13:11:48 +0200 Subject: [PATCH 10/10] Remove sphinx from the optional dependencies --- optional_requirements.txt | 1 - tools/travis_script.sh | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/optional_requirements.txt b/optional_requirements.txt index d6472ca0..6dff92af 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -4,4 +4,3 @@ SimpleITK; python_version != '3.4' astropy tifffile imageio; python_version != '2.6' -sphinx; python_version != '2.6' and python_version != '3.2' diff --git a/tools/travis_script.sh b/tools/travis_script.sh index f46d5306..ad3afca3 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -7,6 +7,12 @@ section "Test.with.min.requirements" nosetests $TEST_ARGS skimage section_end "Test.with.min.requirements" +section "Build.docs" +if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then + export SPHINXCACHE=$HOME/.cache/sphinx; make html +fi +section_end "Build.docs" + section "Flake8.test" flake8 --exit-zero --exclude=test_*,six.py skimage doc/examples viewer_examples section_end "Flake8.test" @@ -49,13 +55,6 @@ pip list section_end "Install.optional.dependencies" -section "Build.docs" -if [[ ($PY != 2.6) && ($PY != 3.2) ]]; then - export SPHINXCACHE=$HOME/.cache/sphinx; make html -fi -section_end "Build.docs" - - section "Run.doc.examples" # Matplotlib settings - do not show figures during doc examples