diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 83def93f57..d7c442cc49 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -83,9 +83,7 @@ jobs: cache-dependency-path: 'setup.py' - name: Install dependencies run: | - python -m pip install -U pip - python -m pip install sphinx + pip install tox - name: Check links run: | - cd doc - make linkcheck + tox -e linkcheck diff --git a/tox.ini b/tox.ini index e199914cb5..46c1a697de 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,20 @@ envlist = lint, # Run pre-commit on all files, including stages that require manual fixes. lint-manual, + # Typecheck using mypy. + typecheck-mypy, + # Typecheck using pyright. + typecheck-pyright, + # Typecheck using pyright strict. + typecheck-pyright-strict, # Typecheck all files. - typecheck + typecheck, + # Build sphinx docs + doc, + # Test sphinx docs + doc-test, + # Linkcheck sphinx docs + linkcheck [testenv:test] description = run unit tests @@ -75,3 +87,24 @@ commands = {[testenv:typecheck-mypy]commands} {[testenv:typecheck-pyright]commands} {[testenv:typecheck-pyright-strict]commands} + +[testenv:doc] +description = build sphinx docs +deps = + sphinx +commands = + sphinx-build -E -b html doc ./doc/_build/html + +[testenv:doc-test] +description = run sphinx doc tests +deps = + {[testenv:doc]deps} +commands = + sphinx-build -E -b doctest doc ./doc/_build/doctest + +[testenv:linkcheck] +description = check links of sphinx docs +deps = + {[testenv:doc]deps} +commands = + sphinx-build -E -b linkcheck doc ./doc/_build/linkcheck