diff --git a/.circleci/config.yml b/.circleci/config.yml index 88baf29a..98b7c708 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,65 +1,64 @@ version: 2.1 commands: - run-tests: + run-tox: + description: "Run tox" + parameters: + version: + type: string + sphinx-version: + type: string + default: "18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,latest" steps: - checkout - run: pip install --user tox - - run: tox + - run: tox -e "<>-sphinx{<>}" jobs: - tests-py36: + py36: docker: - image: 'cimg/python:3.6' - environment: - # Select only the environments that match the Python version we have - # installed in this Docker image (e.g. `py36-*`). Use TOX_SKIP_ENV with - # a negated regex to only match the environment we want to run. Read - # more at https://github.com/tox-dev/tox/issues/238 - TOX_SKIP_ENV: '^(?!py36-)' steps: - - run-tests - tests-py37: + - run-tox: + version: py36 + py37: docker: - image: 'cimg/python:3.7' - environment: - TOX_SKIP_ENV: '^(?!py37-)' steps: - - run-tests + - run-tox: + version: py37 - tests-py38: + py38: docker: - image: 'cimg/python:3.8' - environment: - TOX_SKIP_ENV: '^(?!py38-)' steps: - - run-tests + - run-tox: + version: py38 - tests-py39: + py39: docker: - image: 'cimg/python:3.9' - environment: - TOX_SKIP_ENV: '^(?!py39-)' steps: - - run-tests + - run-tox: + version: py39 - - tests-py310: + py310: docker: - image: 'cimg/python:3.10' - environment: - # Skip py310-sphinx{35,40,41} because it's broken - # See https://github.com/sphinx-doc/sphinx/issues/9816 - TOX_SKIP_ENV: '^(?!py310-)|(^py310-sphinx(35|40|41)$)' steps: - - run-tests + - run-tox: + version: py310 + # Do not run tests for Python 3.10 and some versions of Sphinx because it's broken + # See https://github.com/sphinx-doc/sphinx/issues/9816 + sphinx-version: "18,20,21,22,23,24,42,43,latest" workflows: version: 2 test: jobs: - - tests-py36 - - tests-py37 - - tests-py38 - - tests-py39 - - tests-py310 + - py36 + - py37 + - py38 + - py39 + - py310 + diff --git a/tox.ini b/tox.ini index 579efe6b..675f09fa 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] envlist = docs - py{36,37,38,39,310}-sphinx{18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,latest} + py{36,37,38,39}-sphinx{18,20,21,22,23,24,30,31,32,33,34,35,40,41,42,43,latest} + py{310}-sphinx{18,20,21,22,23,24,42,43,latest} [testenv] deps = @@ -25,14 +26,19 @@ deps = sphinx41: sphinx~=4.1.0 sphinx42: sphinx~=4.2.0 sphinx43: sphinx~=4.3.0 - - # Pin docutils<0.18 because it generates issues on these versions - sphinx{18,20,21,22,23,24,25,30,31,32,33,34,35}: docutils<0.18 - sphinxlatest: sphinx + commands = pytest {posargs} -[testenv:py38-sphinx43] +# Pin docutils<0.18 for all Python versions using Sphinx 1.x, 2.x, 3.x, 4.0, 4.1 +# since it's incompatible and generating lot of errors +# https://tox.wiki/en/latest/config.html#generating-environments-conditional-settings +[testenv:py{36,37,38,39,310}-sphinx{18,20,21,22,23,24,30,31,32,33,34,35,40,41}] +deps = + {[testenv]deps} + docutils<0.18 + +[testenv:py310-sphinx43] deps = {[testenv]deps} pytest-cov @@ -43,8 +49,5 @@ deps = -r {toxinidir}/docs/requirements.txt . changedir = {toxinidir}/docs -setenv = - READTHEDOCS_PROJECT = sphinx-hoverxref - READTHEDOCS_VERSION = latest commands = sphinx-build -W -E -q -b html -d {envtmpdir}/doctrees . {envtmpdir}/html