Skip to content

Commit

Permalink
ENH: Add additional step to tox to run notebooks
Browse files Browse the repository at this point in the history
Add an additional step to `tox` to run notebooks.

Add `nbconvert` and `nbclient` to the dependencies of the `test` table
in `pyproject.toml` so that the notebooks can be run.
  • Loading branch information
jhlegarreta committed Nov 9, 2024
1 parent 795a9b7 commit 8a95480
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ resmon = ["psutil >=5.4"]

test = [
"coverage",
"nbconvert",
"nbclient",
"pytest >= 4.4",
"pytest-cov",
"pytest-env",
Expand Down
27 changes: 27 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ commands =
pytest --doctest-modules --cov eddymotion -n auto --cov-report xml \
--junitxml=test-results.xml -v src test {posargs}

[testenv:notebooks]
description = Run notebooks
labels = notebooks
pass_env =
# getpass.getuser() sources for Windows:
LOGNAME
USER
LNAME
USERNAME
# Pass user color preferences through
PY_COLORS
FORCE_COLOR
NO_COLOR
CLICOLOR
CLICOLOR_FORCE
CURBRANCH
GITHUB_ACTIONS
TEST_DATA_HOME
TEST_OUTPUT_DIR
TEST_WORK_DIR
PYTHONHASHSEED
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS
PATH
extras = test
commands =
python -m nbconvert --to notebook --ExecutePreprocessor.kernel_name=python3 --execute docs/notebooks/*

[testenv:docs]
description = Build documentation site
labels = docs
Expand Down

0 comments on commit 8a95480

Please sign in to comment.