Skip to content

Commit

Permalink
DX: colorize sphinx-build output (#481)
Browse files Browse the repository at this point in the history
* DX: pass all environment variables in `tox` config

* MAINT: remove quotations from environment values

* MAINT: sort config keys in `tox.ini`
  • Loading branch information
redeboer authored Mar 7, 2023
1 parent 6548b77 commit 43057f2
Showing 1 changed file with 40 additions and 53 deletions.
93 changes: 40 additions & 53 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ envlist =
py,
doc,
sty,
passenv = PYTHONPATH
skip_install = True
skip_missing_interpreters = True
skipsdist = True

[testenv]
description =
Run all unit tests and doctests and compute test coverage
allowlist_externals =
pytest
commands =
Expand All @@ -19,62 +16,52 @@ commands =
--cov-report=html \
--cov-report=xml \
--cov=tensorwaves
description =
Run all unit tests and doctests and compute test coverage

[testenv:bench]
description =
Run benchmark tests and visualize in histogram
allowlist_externals =
pytest
commands =
pytest {posargs:benchmarks} \
--durations=0 \
--benchmark-autosave \
-k benchmark
description =
Run benchmark tests and visualize in histogram

[testenv:deps]
description =
Visualize module dependencies
deps =
pydeps
changedir = src
commands =
pydeps tensorwaves \
-o ../module_structure.svg \
--exclude *._* \
--max-bacon=1 \
--noshow
passenv = HOME
deps =
pydeps
description =
Visualize module dependencies
passenv = *

[testenv:doc]
description =
Build documentation and API through Sphinx
allowlist_externals =
sphinx-build
passenv =
EXECUTE_NB
GITHUB_REPO
GITHUB_TOKEN
READTHEDOCS_VERSION
commands =
sphinx-build \
--color \
--keep-going \
-TW \
-b html \
docs/ docs/_build/html
description =
Build documentation and API through Sphinx
passenv = *
setenv =
FORCE_COLOR = yes

[testenv:doclive]
description =
Set up a server to directly preview changes to the HTML pages
allowlist_externals =
sphinx-autobuild
passenv =
EXECUTE_NB
GITHUB_REPO
GITHUB_TOKEN
READTHEDOCS_VERSION
TERM
TF_GPU_ALLOCATOR
commands =
sphinx-autobuild \
--open-browser \
Expand All @@ -97,76 +84,76 @@ commands =
--watch docs \
--watch src \
docs/ docs/_build/html

[testenv:docnb]
description =
Build documentation through Sphinx WITH output of Jupyter notebooks
passenv =
GITHUB_REPO
GITHUB_TOKEN
READTHEDOCS_VERSION
TF_GPU_ALLOCATOR
Set up a server to directly preview changes to the HTML pages
passenv = *
setenv =
EXECUTE_NB = "yes"
FORCE_COLOR = yes

[testenv:docnb]
allowlist_externals =
sphinx-build
commands =
sphinx-build \
--color \
--keep-going \
-TW \
-b html \
docs/ docs/_build/html
description =
Build documentation through Sphinx WITH output of Jupyter notebooks
passenv = *
setenv =
EXECUTE_NB = yes
FORCE_COLOR = yes

[testenv:jax]
description =
Run tests with JAX only
allowlist_externals =
pytest
commands =
pytest {posargs:} \
-k "benchmark or not benchmark" \
-k "not (ampform or four_momenta or numba or tensorflow or tf)" \
--benchmark-disable
description =
Run tests with JAX only

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

[testenv:linkcheck]
description =
Check external links in the documentation (requires internet connection)
passenv =
EXECUTE_NB
READTHEDOCS_VERSION
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:nb]
description =
Run all notebooks with pytest
allowlist_externals =
pytest
commands =
pytest --nbmake {posargs:docs}
description =
Run all notebooks with pytest

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

0 comments on commit 43057f2

Please sign in to comment.