From a1a3f0520222f6a8b2f8610c52d6c0e7cd0dba81 Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Mon, 28 Aug 2017 14:01:14 -0700 Subject: [PATCH] Fix for Sphinx 1.6 --- autoapi/extension.py | 4 ---- tests/test_integration.py | 9 +++++++++ tox.ini | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/autoapi/extension.py b/autoapi/extension.py index e4361a8..53f88d3 100644 --- a/autoapi/extension.py +++ b/autoapi/extension.py @@ -135,10 +135,6 @@ def doctree_read(app, doctree): app.info(bold('[AutoAPI] ') + darkgreen('Adding AutoAPI TOCTree [%s] to index.rst' % toc_entry) ) - if sphinx.version_info >= (1, 5): - app.env.toctree.process_doc(app.env.docname, doctree) - else: - app.env.build_toc_from(app.env.docname, doctree) def setup(app): diff --git a/tests/test_integration.py b/tests/test_integration.py index 7415fb2..f5ca600 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -89,6 +89,15 @@ class PythonTests(LanguageIntegrationTests): self.assertFalse( os.path.exists('_build/text/autoapi/method_multiline') ) + index_file = open('_build/text/index.txt').read() + self.assertIn( + 'Sphinx AutoAPI Index', + index_file + ) + self.assertIn( + 'Foo', + index_file + ) class DotNetTests(LanguageIntegrationTests): diff --git a/tox.ini b/tox.ini index ea7dd36..01a0fc8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{27,34,35}-sphinx{13,14,15} + py{27,34,35}-sphinx{13,14,15,16} lint docs @@ -12,12 +12,13 @@ deps = -r{toxinidir}/requirements.txt mock sphinx14: Sphinx<1.5 sphinx15: Sphinx<1.6 + sphinx16: Sphinx<1.7 commands = py.test {posargs} [testenv:docs] deps = - Sphinx==1.5 + Sphinx>=1.6,<=1.7 sphinx_rtd_theme changedir = {toxinidir}/docs commands =