Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: colorize sphinx-build output #296

Merged
merged 3 commits into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 56 additions & 85 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,35 @@ envlist =
nb,
py,
sty,
passenv = PYTHONPATH
skip_install = True
skip_missing_interpreters = True
skipsdist = True

[testenv]
description =
Run all unit tests
allowlist_externals =
pytest
setenv =
PYTHONHASHSEED = 0
commands =
pytest {posargs}
description =
Run all unit tests
setenv =
PYTHONHASHSEED = 0

[testenv:doc]
description =
Build documentation with Sphinx
allowlist_externals =
sphinx-build
passenv =
EXECUTE_NB
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
setenv =
PYTHONHASHSEED = 0
commands =
sphinx-build -nW --keep-going -b html docs/ docs/_build/html
description =
Build documentation with Sphinx
passenv = *
setenv =
FORCE_COLOR = yes
PYTHONHASHSEED = 0

[testenv:doclive]
description =
Set up a server to directly preview changes to the HTML pages
allowlist_externals =
sphinx-autobuild
passenv =
EXECUTE_NB
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
setenv =
PYTHONHASHSEED = 0
commands =
sphinx-autobuild \
--open-browser \
Expand All @@ -71,118 +54,106 @@ commands =
--watch docs \
--watch src \
docs/ docs/_build/html
description =
Set up a server to directly preview changes to the HTML pages
passenv = *
setenv =
FORCE_COLOR = yes
PYTHONHASHSEED = 0

[testenv:docnb]
description =
Execute Jupyter notebooks and build documentation with Sphinx
allowlist_externals =
sphinx-build
passenv =
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
commands =
sphinx-build -nW --keep-going -b html docs/ docs/_build/html
description =
Execute Jupyter notebooks and build documentation with Sphinx
passenv = *
setenv =
EXECUTE_NB = yes
FORCE_COLOR = yes
PYTHONHASHSEED = 0
commands =
sphinx-build -nW --keep-going -b html docs/ docs/_build/html

[testenv:docnb-force]
description =
Execute Jupyter notebooks and build documentation with Sphinx
allowlist_externals =
sphinx-build
passenv =
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
commands =
sphinx-build -nW --keep-going -b html docs/ docs/_build/html
description =
Execute Jupyter notebooks and build documentation with Sphinx
passenv = *
setenv =
FORCE_COLOR = yes
FORCE_EXECUTE_NB = yes
PYTHONHASHSEED = 0
commands =
sphinx-build -nW --keep-going -b html docs/ docs/_build/html

[testenv:linkcheck]
description =
Check external links in the documentation (requires internet connection)
passenv =
EXECUTE_NB
TERM
allowlist_externals =
sphinx-build
commands =
sphinx-build \
--color \
-T \
-b linkcheck \
docs/ docs/_build/linkcheck
description =
Check external links in the documentation (requires internet connection)
passenv = *
setenv =
FORCE_COLOR = yes

[testenv:pdf]
description =
Create documentation as a single PDF file
allowlist_externals =
make
passenv =
EXECUTE_NB
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
setenv =
PYTHONHASHSEED = 0
changedir = docs
commands =
make latexpdf LATEXOPTS=' -interaction=batchmode'
description =
Create documentation as a single PDF file
passenv = *
setenv =
FORCE_COLOR = yes
PYTHONHASHSEED = 0

[testenv:pdfnb]
description =
Execute Jupyter notebooks and create documentation as a single PDF file
allowlist_externals =
make
passenv =
EXECUTE_PLUTO
JULIA_CI
JULIA_DEPOT_PATH
SYMPY_CACHE_DIR
TERM
setenv =
EXECUTE_NB = yes
PYTHONHASHSEED = 0
changedir = docs
commands =
make latexpdf LATEXOPTS=' -interaction=batchmode'
description =
Execute Jupyter notebooks and create documentation as a single PDF file
passenv = *
setenv =
EXECUTE_NB = yes
FORCE_COLOR = yes
PYTHONHASHSEED = 0

[testenv:jcache]
description =
Inspect Jupyter cache
allowlist_externals =
jcache
setenv =
PYTHONHASHSEED = 0
changedir = docs/_build
commands =
jcache {posargs:notebook list}
description =
Inspect Jupyter cache
setenv =
PYTHONHASHSEED = 0

[testenv:nb]
description =
Run all notebooks with pytest
allowlist_externals =
pytest
commands =
pytest --nbmake --nbmake-timeout=3600 {posargs:docs}
description =
Run all notebooks with pytest

[testenv:sty]
allowlist_externals =
pre-commit
commands =
pre-commit run {posargs} -a
description =
Perform all linting, formatting, and spelling checks
setenv =
PYTHONHASHSEED = 0
SKIP = pyright
allowlist_externals =
pre-commit
commands =
pre-commit run {posargs} -a