From 820fea9971caa6dec9bf6a61173617e2f89e458b Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Mon, 19 Feb 2018 23:23:02 -0500 Subject: [PATCH 1/4] Split sphinx-apidoc call lines Add the current directory with all modules for sphinx-apidoc to run through on one line and all files to be excluded on the next line. Makes it clearer to the reader that these serve different purposes in sphinx-apidoc. --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e245a327..4bc04ac1 100644 --- a/setup.py +++ b/setup.py @@ -82,7 +82,8 @@ def run_tests(self): sphinx.apidoc.__file__, "-f", "-T", "-e", "-M", "-o", "docs", - ".", "setup.py", "tests", "versioneer.py" + ".", + "setup.py", "tests", "versioneer.py" ]) build_prefix_arg_index = None From 526a108adf154003aab1bdeb3ebfede8f1cf64a5 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Mon, 19 Feb 2018 23:23:04 -0500 Subject: [PATCH 2/4] Address change in sphinx-apidoc in Sphinx 1.7.0 It appears that in Sphinx 1.7.0 `sphinx.apidoc.main` does not take the full result from `sys.argv`, but only takes every argument after the first. So there is no need to pass along the command run. Only the arguments are actually used. Handle this discrepancy between Sphinx versions by doing a quick version check and then adding the command run for older Sphinx versions and skipping it for newer Sphinx versions. --- setup.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4bc04ac1..2c5f2ce7 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,16 +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" ]) + sphinx.apidoc.main(sphinx_apidoc_args) + build_prefix_arg_index = None for each_build_arg in ["-b", "--builder"]: try: From 60a9ad91568aba498b7982f01423a1d360249208 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Mon, 19 Feb 2018 23:25:11 -0500 Subject: [PATCH 3/4] Revert "Restrict sphinx to 1.6" This reverts commit ce0e4bbc457ac1d033c0050adef0fe2afefe526d. Now that we can work with `sphinx` 1.7+, drop the version constraint on `sphinx`. --- .travis.yml | 2 -- .wercker.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index b0f864c0..edcffb8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,6 @@ install: - python setup.py bdist_conda # Setup environment for nanshe and install it with all dependencies. - conda create --use-local -n testenv python=$PYTHON_VERSION nanshe==$VERSION - - touch $HOME/miniconda/envs/testenv/conda-meta/pinned - conda update --use-local -n testenv --all - conda install --use-local -n testenv nanshe==$VERSION - source activate testenv @@ -60,7 +59,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..f55fce8b 100644 --- a/.wercker.yml +++ b/.wercker.yml @@ -24,7 +24,6 @@ build: conda create -y --use-local -n testenv nanshe==$(python setup.py --version) source activate testenv conda clean -tipsy - touch /opt/conda/envs/testenv/conda-meta/pinned - script: name: Install dependencies for cluster support. @@ -35,7 +34,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 From db4cf356a2c948e4ed47d7e913248ce632e3f25b Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Mon, 19 Feb 2018 23:26:13 -0500 Subject: [PATCH 4/4] Keep the `pinned` file for `conda` on CIs In case we find ourselves needing to pinning things in the `conda` testing environment in the future, keep the `pinned` files around on CI even though they are currently empty. --- .travis.yml | 1 + .wercker.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index edcffb8e..180af209 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,7 @@ install: - python setup.py bdist_conda # Setup environment for nanshe and install it with all dependencies. - conda create --use-local -n testenv python=$PYTHON_VERSION nanshe==$VERSION + - touch $HOME/miniconda/envs/testenv/conda-meta/pinned - conda update --use-local -n testenv --all - conda install --use-local -n testenv nanshe==$VERSION - source activate testenv diff --git a/.wercker.yml b/.wercker.yml index f55fce8b..dad2da3b 100644 --- a/.wercker.yml +++ b/.wercker.yml @@ -24,6 +24,7 @@ build: conda create -y --use-local -n testenv nanshe==$(python setup.py --version) source activate testenv conda clean -tipsy + touch /opt/conda/envs/testenv/conda-meta/pinned - script: name: Install dependencies for cluster support.