Skip to content

Commit

Permalink
PYTHON-3738 Use tox for sphinx doc instead of setup.py (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStapp authored Jun 20, 2023
1 parent 82d87dc commit bc66d83
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
35 changes: 34 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit bc66d83

Please sign in to comment.