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: define developer environment with uv #301

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
149 changes: 44 additions & 105 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,154 +1,93 @@
[tox]
envlist =
doc,
docnb-force,
linkcheck,
sty,
skip_install = True
skip_missing_interpreters = True
skipsdist = True

[testenv]
passenv = *

[testenv:doc]
allowlist_externals =
sphinx-build
commands =
sphinx-build \
--builder html \
--builder=html \
--fail-on-warning \
--keep-going \
--show-traceback --fail-on-warning \
docs/ docs/_build/html
description =
Build documentation and API through Sphinx
passenv = *
setenv =
FORCE_COLOR = 1
PYTHONWARNINGS =
ZFIT_DISABLE_TF_WARNINGS = 1

[testenv:doclive]
allowlist_externals =
sphinx-autobuild
commands =
sphinx-autobuild \
--open-browser \
--re-ignore .*/.ipynb_checkpoints/.* \
--re-ignore .*/.virtual_documents/.* \
--re-ignore .*/__pycache__/.* \
--re-ignore docs/.*\.png \
--re-ignore docs/.*\.svg \
--re-ignore docs/.*\.yaml \
--re-ignore docs/.*\.yml \
--re-ignore docs/_build/.* \
--watch docs \
--show-traceback \
docs/ docs/_build/html
description =
Set up a server to directly preview changes to the HTML pages
passenv = *
description = Build documentation and API through Sphinx
setenv =
FORCE_COLOR = 1
PYTHONWARNINGS =
TF_CPP_MIN_LOG_LEVEL = 3
ZFIT_DISABLE_TF_WARNINGS = 1

[testenv:docnb]
allowlist_externals =
sphinx-build
commands =
sphinx-build \
--builder html \
--keep-going \
--show-traceback --fail-on-warning \
docs/ docs/_build/html
description =
Build documentation through Sphinx WITH output of Jupyter notebooks
passenv = *
base = doc
description = {[testenv:doc]description} with cached notebook execution
setenv =
{[testenv:doc]setenv}
EXECUTE_NB = yes
FORCE_COLOR = 1
PYTHONWARNINGS =
TF_CPP_MIN_LOG_LEVEL = 3
ZFIT_DISABLE_TF_WARNINGS = 1

[testenv:docnblive]
[testenv:docnb-force]
base = doc
description = {[testenv:doc]description} with notebook execution (no cache)
setenv =
{[testenv:doc]setenv}
FORCE_EXECUTE_NB = yes

[testenv:doclive]
allowlist_externals =
sphinx-autobuild
base = doc
commands =
sphinx-autobuild \
--ignore=docs/_build/ \
--open-browser \
--re-ignore .*/.ipynb_checkpoints/.* \
--re-ignore .*/.virtual_documents/.* \
--re-ignore .*/__pycache__/.* \
--re-ignore docs/.*\.png \
--re-ignore docs/.*\.svg \
--re-ignore docs/.*\.yaml \
--re-ignore docs/.*\.yml \
--re-ignore docs/_build/.* \
--watch docs \
--port=0 \
--re-ignore='.*/__pycache__/.*' \
--re-ignore='.*/.ipynb_checkpoints/.*' \
--re-ignore='.*/.virtual_documents/.*' \
--re-ignore='.*\.png' \
--re-ignore='.*\.svg' \
--re-ignore='.*\.yaml' \
--re-ignore='.*\.yml' \
--watch=docs \
docs/ docs/_build/html
description =
Set up a server to directly preview changes to the HTML pages
passenv = *
setenv =
EXECUTE_NB = yes
FORCE_COLOR = 1
PYTHONWARNINGS =
TF_CPP_MIN_LOG_LEVEL = 3
ZFIT_DISABLE_TF_WARNINGS = 1
description = Set up a server to directly preview changes to the HTML pages

[testenv:docnb-force]
allowlist_externals =
sphinx-build
commands =
sphinx-build \
--builder html \
--fail-on-warning \
--keep-going \
docs/ docs/_build/html
description =
Execute ALL Jupyter notebooks and build documentation with Sphinx
passenv = *
[testenv:docnblive]
base = doclive
description = {[testenv:doclive]description} with cached notebook execution
setenv =
FORCE_COLOR = 1
FORCE_EXECUTE_NB = yes
PYTHONWARNINGS =
TF_CPP_MIN_LOG_LEVEL = 3
ZFIT_DISABLE_TF_WARNINGS = 1

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

[testenv:linkcheck]
allowlist_externals =
sphinx-build
base = doc
commands =
sphinx-build \
--builder linkcheck \
--builder=linkcheck \
--show-traceback \
docs/ docs/_build/linkcheck
description =
Check external links in the documentation (requires internet connection)
passenv = *
setenv =
FORCE_COLOR = 1
description = Check external links in the documentation (requires internet connection)

[testenv:nb]
allowlist_externals =
pytest
commands =
pytest --nbmake {posargs:docs}
description =
Run all notebooks with pytest
passenv = *
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
pre-commit run {posargs} --all-files
description = Perform all linting, formatting, and spelling checks
setenv =
SKIP = pyright
Loading