Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

ENH: Add an additional environment to tox to run notebooks #257

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ test = [
"pytest-xdist >= 1.28"
]

notebooks = [
"jupyter",
"nbconvert",
"nbclient",
]

antsopt = [
"ConfigSpace",
"smac",
Expand Down
31 changes: 29 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
requires =
tox>=4
envlist =
py312
py312, notebooks
skip_missing_interpreters = true

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

[testenv]
description = Pytest with coverage
Expand Down 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 = notebooks
commands =
python -m nbconvert --to notebook --ExecutePreprocessor.kernel_name=python3 --execute docs/notebooks/*

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