Skip to content

Commit bc66d83

Browse files
authored
PYTHON-3738 Use tox for sphinx doc instead of setup.py (#1245)
1 parent 82d87dc commit bc66d83

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

.github/workflows/test-python.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ jobs:
8383
cache-dependency-path: 'setup.py'
8484
- name: Install dependencies
8585
run: |
86-
python -m pip install -U pip
87-
python -m pip install sphinx
86+
pip install tox
8887
- name: Check links
8988
run: |
90-
cd doc
91-
make linkcheck
89+
tox -e linkcheck

tox.ini

+34-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,20 @@ envlist =
88
lint,
99
# Run pre-commit on all files, including stages that require manual fixes.
1010
lint-manual,
11+
# Typecheck using mypy.
12+
typecheck-mypy,
13+
# Typecheck using pyright.
14+
typecheck-pyright,
15+
# Typecheck using pyright strict.
16+
typecheck-pyright-strict,
1117
# Typecheck all files.
12-
typecheck
18+
typecheck,
19+
# Build sphinx docs
20+
doc,
21+
# Test sphinx docs
22+
doc-test,
23+
# Linkcheck sphinx docs
24+
linkcheck
1325

1426
[testenv:test]
1527
description = run unit tests
@@ -75,3 +87,24 @@ commands =
7587
{[testenv:typecheck-mypy]commands}
7688
{[testenv:typecheck-pyright]commands}
7789
{[testenv:typecheck-pyright-strict]commands}
90+
91+
[testenv:doc]
92+
description = build sphinx docs
93+
deps =
94+
sphinx
95+
commands =
96+
sphinx-build -E -b html doc ./doc/_build/html
97+
98+
[testenv:doc-test]
99+
description = run sphinx doc tests
100+
deps =
101+
{[testenv:doc]deps}
102+
commands =
103+
sphinx-build -E -b doctest doc ./doc/_build/doctest
104+
105+
[testenv:linkcheck]
106+
description = check links of sphinx docs
107+
deps =
108+
{[testenv:doc]deps}
109+
commands =
110+
sphinx-build -E -b linkcheck doc ./doc/_build/linkcheck

0 commit comments

Comments
 (0)