Skip to content

Commit b05acb1

Browse files
authored
Merge pull request #1872 from chrysle/tox-preview-env
Add docs preview env for `tox`
2 parents 41f4b66 + bf5b189 commit b05acb1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tox.ini

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,37 @@ skip_install = true
9292
allowlist_externals =
9393
git
9494

95+
96+
[testenv:preview-docs]
97+
description = preview the docs
98+
deps =
99+
sphinx-autobuild
100+
{[testenv:build-docs]deps}
101+
commands_pre =
102+
commands =
103+
# Retrieve possibly missing commits:
104+
-git fetch --unshallow
105+
-git fetch --tags
106+
107+
# Build the html docs with sphinx-autobuild:
108+
{envpython} -m sphinx_autobuild \
109+
-j auto \
110+
-b html \
111+
-n \
112+
-W \
113+
-d "{temp_dir}/.doctrees" \
114+
. \
115+
--watch ../README.rst \
116+
--watch ../CHANGELOG.md \
117+
"{envdir}/docs_out"
118+
119+
changedir = {[testenv:build-docs]changedir}
120+
isolated_build = {[testenv:build-docs]isolated_build}
121+
passenv = {[testenv:build-docs]passenv}
122+
skip_install = {[testenv:build-docs]skip_install}
123+
allowlist_externals = {[testenv:build-docs]allowlist_externals}
124+
125+
95126
[testenv:linkcheck-docs]
96127
description = check links in the documentation
97128
deps =

0 commit comments

Comments
 (0)