From f1358e31f6149be24f343ab4a8946a5b59402a62 Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Wed, 10 Jan 2018 15:51:54 +1100 Subject: [PATCH 1/4] Require that sphinx issue no warnings in CI --- .travis.yml | 4 ++-- doc/conf.py | 5 ++--- doc/format.rst | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fda4f5cf..7010fd49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,5 +23,5 @@ script: - nosetests numpydoc - | cd ../doc - make html - make latexpdf + make SPHINXOPTS='-W' html + make SPHINXOPTS='-W' latexpdf diff --git a/doc/conf.py b/doc/conf.py index 5a311bca..f58ae7bd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -41,7 +41,7 @@ 'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', - 'sphinx.ext.pngmath', + 'sphinx.ext.imgmath', 'sphinx.ext.todo', 'numpydoc', 'sphinx.ext.ifconfig', @@ -149,13 +149,12 @@ html_sidebars = {} html_title = "%s v%s Manual" % (project, version) -html_static_path = ['_static'] html_last_updated_fmt = '%b %d, %Y' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = [] # ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied diff --git a/doc/format.rst b/doc/format.rst index 9b3b0ca5..c30ca4fd 100644 --- a/doc/format.rst +++ b/doc/format.rst @@ -374,7 +374,7 @@ The sections of a function's docstring are: and neural-network techniques," Computers & Geosciences, vol. 22, pp. 585-588, 1996. - which renders as + which renders as [1]_: .. [1] O. McNoleg, "The integration of GIS, remote sensing, expert systems and adaptive co-kriging for environmental habitat From 4112bb4adab2347097c7f77928eb3c7391286fb5 Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Mon, 5 Feb 2018 20:42:47 +1100 Subject: [PATCH 2/4] Only use imgmath when supported --- doc/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index f58ae7bd..c487c90a 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -41,13 +41,19 @@ 'sphinx.ext.autosummary', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', - 'sphinx.ext.imgmath', 'sphinx.ext.todo', 'numpydoc', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', ] +try: + import sphinx.ext.imgmath # noqa +except ImportError: + extensions.append('sphinx.ext.pngmath') +else: + extensions.append('sphinx.ext.imgmath') + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] From 8501238d83518d342a022d29055520adfa2f77fd Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Mon, 5 Feb 2018 21:01:22 +1100 Subject: [PATCH 3/4] Alphanumeric intersphinx --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index c487c90a..ef2788e2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -269,5 +269,5 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { 'python': ('http://docs.python.org/', None), - 'scikit-learn': ('http://scikit-learn.org/stable/', None), + 'scikitlearn': ('http://scikit-learn.org/stable/', None), } From 6be9f334ff4c1bc0982f5283c95e770efe4a29da Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Sun, 1 Apr 2018 22:42:03 +1000 Subject: [PATCH 4/4] Make warnings check only in Py3 does this work? --- .travis.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7010fd49..c299e6b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,15 @@ # http://lint.travis-ci.org/ language: python sudo: false -python: - - 3.6 - - 2.7 env: - SPHINX_SPEC="Sphinx==1.2.3" - SPHINX_SPEC="Sphinx" +matrix: + include: + - python: 3.6 + - python: 2.7 + env: + - SPHINXOPTS='-W' cache: directories: - $HOME/.cache/pip @@ -23,5 +26,5 @@ script: - nosetests numpydoc - | cd ../doc - make SPHINXOPTS='-W' html - make SPHINXOPTS='-W' latexpdf + make SPHINXOPTS=$SPHINXOPTS html + make SPHINXOPTS=$SPHINXOPTS latexpdf