Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit 8a95480

Browse files
committed
ENH: Add additional step to tox to run notebooks
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.
1 parent 795a9b7 commit 8a95480

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ resmon = ["psutil >=5.4"]
6868

6969
test = [
7070
"coverage",
71+
"nbconvert",
72+
"nbclient",
7173
"pytest >= 4.4",
7274
"pytest-cov",
7375
"pytest-env",

tox.ini

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,33 @@ commands =
3838
pytest --doctest-modules --cov eddymotion -n auto --cov-report xml \
3939
--junitxml=test-results.xml -v src test {posargs}
4040

41+
[testenv:notebooks]
42+
description = Run notebooks
43+
labels = notebooks
44+
pass_env =
45+
# getpass.getuser() sources for Windows:
46+
LOGNAME
47+
USER
48+
LNAME
49+
USERNAME
50+
# Pass user color preferences through
51+
PY_COLORS
52+
FORCE_COLOR
53+
NO_COLOR
54+
CLICOLOR
55+
CLICOLOR_FORCE
56+
CURBRANCH
57+
GITHUB_ACTIONS
58+
TEST_DATA_HOME
59+
TEST_OUTPUT_DIR
60+
TEST_WORK_DIR
61+
PYTHONHASHSEED
62+
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS
63+
PATH
64+
extras = test
65+
commands =
66+
python -m nbconvert --to notebook --ExecutePreprocessor.kernel_name=python3 --execute docs/notebooks/*
67+
4168
[testenv:docs]
4269
description = Build documentation site
4370
labels = docs

0 commit comments

Comments
 (0)