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

Commit 5426789

Browse files
committed
ENH: Add additional environment to tox to run notebooks
Add an additional environment to `tox` to run notebooks. Add a new table to `pyproject.toml` to host the `jupyter`, `nbconvert` and `nbclient` dependencies so that the notebooks can be run.
1 parent 795a9b7 commit 5426789

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ test = [
7474
"pytest-xdist >= 1.28"
7575
]
7676

77+
notebooks = [
78+
"jupyter",
79+
"nbconvert",
80+
"nbclient",
81+
]
82+
7783
antsopt = [
7884
"ConfigSpace",
7985
"smac",

tox.ini

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
requires =
33
tox>=4
44
envlist =
5-
py312
5+
py312, notebooks
66
skip_missing_interpreters = true
77

88
# Configuration that allows us to split tests across GitHub runners effectively
99
[gh-actions]
1010
python =
11-
3.12: py312
11+
3.12: py312, notebooks
1212

1313
[testenv]
1414
description = Pytest with coverage
@@ -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 = notebooks
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)