diff --git a/.travis.yml b/.travis.yml index b0f864c0..180af209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,6 @@ install: - export DRMAA_LIBRARY_PATH=/usr/lib/libdrmaa.so.1.0 - conda install drmaa # Install sphinx and friends to build documentation. - - echo "sphinx 1.6.*" >> $HOME/miniconda/envs/testenv/conda-meta/pinned - conda install sphinx - conda install cloud_sptheme # Install coverage and coveralls to generate and submit test coverage results for coveralls.io. diff --git a/.wercker.yml b/.wercker.yml index c31f0738..dad2da3b 100644 --- a/.wercker.yml +++ b/.wercker.yml @@ -35,7 +35,6 @@ build: - script: name: Install dependencies for building docs. code: |- - echo "sphinx 1.6.*" >> /opt/conda/envs/testenv/conda-meta/pinned conda install -y sphinx conda install -y cloud_sptheme conda clean -tipsy diff --git a/setup.py b/setup.py index 6f8f39d7..4f0b6e5b 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand from setuptools.dist import Distribution +from distutils.version import LooseVersion import versioneer @@ -76,15 +77,22 @@ def run_tests(self): "functools32" ] elif sys.argv[1] == "build_sphinx": + import sphinx import sphinx.apidoc - sphinx.apidoc.main([ - sphinx.apidoc.__file__, + sphinx_apidoc_args = [] + if LooseVersion(sphinx.__version__) < LooseVersion("1.7"): + sphinx_apidoc_args.append(sphinx.apidoc.__file__) + + sphinx_apidoc_args.extend([ "-f", "-T", "-e", "-M", "-o", "docs", - ".", "setup.py", "tests", "versioneer.py" + ".", + "setup.py", "tests", "versioneer.py" ]) + sphinx.apidoc.main(sphinx_apidoc_args) + build_prefix_arg_index = None for each_build_arg in ["-b", "--builder"]: try: