From e790fe4d1e018df0f926d4b68423d0be0c9d4e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Est=C3=A8ve?= Date: Tue, 24 Jan 2017 13:12:43 +0100 Subject: [PATCH] Test sphinx extensions doctests only on Circle. Some sphinx extensions import sphinx in their doctests. --- build_tools/circle/build_doc.sh | 6 +++--- build_tools/travis/test_script.sh | 2 +- circle.yml | 12 ++++++++++-- doc/sphinxext/sphinx_issues.py | 12 ++++-------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build_tools/circle/build_doc.sh b/build_tools/circle/build_doc.sh index 28bab1ccbbea0..84b4b87596080 100755 --- a/build_tools/circle/build_doc.sh +++ b/build_tools/circle/build_doc.sh @@ -107,15 +107,15 @@ then wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \ -O miniconda.sh fi -chmod +x miniconda.sh && ./miniconda.sh -b -p $HOME/miniconda +chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH cd .. -export PATH="$HOME/miniconda/bin:$PATH" +export PATH="$MINICONDA_PATH/bin:$PATH" conda update --yes --quiet conda popd # Configure the conda environment and put it in the path using the # provided versions -conda create -n testenv --yes --quiet python numpy scipy \ +conda create -n $CONDA_ENV_NAME --yes --quiet python numpy scipy \ cython nose coverage matplotlib sphinx pillow source activate testenv diff --git a/build_tools/travis/test_script.sh b/build_tools/travis/test_script.sh index 3e9bb9978161d..6ab342b932cf1 100755 --- a/build_tools/travis/test_script.sh +++ b/build_tools/travis/test_script.sh @@ -41,7 +41,7 @@ run_tests() { # Test doc cd $OLDPWD - make test-doc test-sphinxext + make test-doc } if [[ "$RUN_FLAKE8" == "true" ]]; then diff --git a/circle.yml b/circle.yml index bdc4d1b0bdbda..5b791aeb1102b 100644 --- a/circle.yml +++ b/circle.yml @@ -2,6 +2,11 @@ checkout: post: - ./build_tools/circle/checkout_merge_commit.sh +machine: + environment: + MINICONDA_PATH: $HOME/miniconda + CONDA_ENV_NAME: testenv + dependencies: cache_directories: - "~/scikit_learn_data" @@ -12,10 +17,13 @@ dependencies: override: - ./build_tools/circle/build_doc.sh: timeout: 3600 # seconds + test: override: - # override is needed otherwise nosetests is run by default - - echo "Documentation has been built in the 'dependencies' step. No additional test to run" + - | + export PATH="$MINICONDA_PATH/bin:$PATH" + source activate $CONDA_ENV_NAME + make test-sphinxext deployment: push: branch: /^master$|^[0-9]+\.[0-9]+\.X$/ diff --git a/doc/sphinxext/sphinx_issues.py b/doc/sphinxext/sphinx_issues.py index 63ebb60f312d8..f4b8c9346b56b 100644 --- a/doc/sphinxext/sphinx_issues.py +++ b/doc/sphinxext/sphinx_issues.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -"""A Sphinx extension for linking to your project's issue tracker.""" -""" +"""A Sphinx extension for linking to your project's issue tracker. + Copyright 2014 Steven Loria Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,12 +22,8 @@ THE SOFTWARE. """ -try: - from docutils import nodes, utils - from sphinx.util.nodes import split_explicit_title -except ImportError: - # Load lazily so that test-sphinxext does not require docutils dependency - pass +from docutils import nodes, utils +from sphinx.util.nodes import split_explicit_title __version__ = '0.2.0' __author__ = 'Steven Loria'