diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ac2882..17a6e7e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ commands: type: string sphinx-version: type: string - default: "21,22,23,24,30,31,32,33,34,latest" + default: "21,22,23,24,30,31,32,33,34,35,40,41,42,43,44,latest" steps: - checkout - run: pip install --user tox @@ -48,6 +48,13 @@ jobs: - run-tox: version: py39 + py310: + docker: + - image: 'cimg/python:3.10' + steps: + - run-tox: + version: py310 + lint: docker: - image: 'cimg/python:3.9' @@ -61,6 +68,7 @@ workflows: tests: jobs: - lint + - py310 - py39 - py38 - py37 diff --git a/readthedocs_ext/readthedocs.py b/readthedocs_ext/readthedocs.py index aac53a2..87efccf 100644 --- a/readthedocs_ext/readthedocs.py +++ b/readthedocs_ext/readthedocs.py @@ -249,9 +249,12 @@ def remove_search_init(app, exception): replacement_text = '/* Search initialization removed for Read the Docs */' replacement_regex = re.compile( r''' - ^\$\(document\).ready\(function\s*\(\)\s*{(?:\n|\r\n?) + ^(\$\(document\).ready\(function\s*\(\)\s*{(?:\n|\r\n?) \s*Search.init\(\);(?:\n|\r\n?) - \}\); + \}\);) + | + # Sphinx >=5.0 calls Search.init this way. + (_ready\(Search.init\);) ''', (re.MULTILINE | re.VERBOSE) ) diff --git a/tests/pr-example/conf.py b/tests/pr-example/conf.py index 64f9361..cba627e 100644 --- a/tests/pr-example/conf.py +++ b/tests/pr-example/conf.py @@ -14,7 +14,7 @@ author = 'readthedocs' version = '0.1' release = '0.1' -language = None +language = 'en' exclude_patterns = ['_build'] todo_include_todos = False html_theme = 'alabaster' diff --git a/tests/pyexample-json/conf.py b/tests/pyexample-json/conf.py index 4916bbc..57fc48b 100644 --- a/tests/pyexample-json/conf.py +++ b/tests/pyexample-json/conf.py @@ -15,7 +15,7 @@ author = u'readthedocs' version = '0.1' release = '0.1' -language = None +language = 'en' exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos = False diff --git a/tests/pyexample/conf.py b/tests/pyexample/conf.py index f566e4d..342bb69 100644 --- a/tests/pyexample/conf.py +++ b/tests/pyexample/conf.py @@ -15,7 +15,7 @@ author = u'readthedocs' version = '0.1' release = '0.1' -language = None +language = 'en' exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos = False diff --git a/tox.ini b/tox.ini index 27c73ae..ebeb1bc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{27,36}-sphinx{15,16,17,18} - py{36,37,38,39}-sphinx{21,22,23,24,30,31,32,33,34,latest} + py{36,37,38,39,310}-sphinx{21,22,23,24,30,31,32,33,34,35,40,41,42,43,44,latest} lint [testenv] @@ -24,7 +24,14 @@ deps = sphinx32: Sphinx<3.3 sphinx33: Sphinx<3.4 sphinx34: Sphinx<3.5 + sphinx35: Sphinx<3.6 + sphinx40: Sphinx<4.1 + sphinx41: Sphinx<4.2 + sphinx42: Sphinx<4.3 + sphinx43: Sphinx<4.4 + sphinx44: Sphinx<4.5 sphinxlatest: Sphinx + sphinxmaster: git+https://github.com/sphinx-doc/sphinx.git@master commands = py.test {posargs}