Skip to content

Commit

Permalink
Run sphinx-autobuild via tox -e docs-live[-src]
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Feb 16, 2024
1 parent 71cd314 commit da3e0d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions changes/2400.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ``sphinx-autobuild`` tool can now be invoked via ``tox -e docs-live`` and ``tox -e docs-live-src``.
33 changes: 16 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,31 @@ commands =

[docs]
build_dir = _build
# -W: make warnings into errors
# --keep-going: continue on errors
# -j: run with multiple processes
sphinx_args = -W --keep-going -j auto
# -v: verbose logging
# -E: force rebuild of environment
# -T: print traceback on error
# -a: read/parse all files
# -d: use tox's temp dir for caching
sphinx_args_extra = {[docs]sphinx_args} -v -E -T -a -d {envtmpdir}/doctrees
# replace when Sphinx 7.3 is released:
# -T -> --show-traceback
# -W -> --fail-on-warning
# -b -> --builder
# -v -> --verbose
# -a -> --write-all
# -E -> --fresh-env
sphinx_args = -T -W --keep-going --jobs auto

[testenv:docs{,-lint,-all}]
[testenv:docs{,-lint,-all,-live,-live-src}]
skip_install = True
change_dir = docs
deps =
./core[docs]
deps = ./core[docs]
passenv =
# On macOS M1, you need to manually set the location of the PyEnchant
# library:
# export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib
PYENCHANT_LIBRARY_PATH
commands =
!lint-!all : python -m sphinx {[docs]sphinx_args} -b html . {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args_extra} -b spelling . {[docs]build_dir}/spell
lint : python -m sphinx {[docs]sphinx_args_extra} -b linkcheck . {[docs]build_dir}/links
all : python -m sphinx {[docs]sphinx_args_extra} -b html . {[docs]build_dir}/html
!lint-!all-!live : python -m sphinx {[docs]sphinx_args} {posargs} -b html . {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b spelling . {[docs]build_dir}/spell
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b linkcheck . {[docs]build_dir}/links
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html . {[docs]build_dir}/html
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} -b html . {[docs]build_dir}/live
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} -a --watch ../core/src/toga/ -b html . {[docs]build_dir}/live

[testenv:package]
skip_install = True
Expand Down

0 comments on commit da3e0d8

Please sign in to comment.