Skip to content

Commit

Permalink
Separate out notebooks and not notebooks in tox (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair authored Mar 6, 2024
1 parent 788bfd9 commit 38b6829
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- linux: py311
- windows: py310-online
- macos: py39
- linux: build_docs
- linux: build_docs-notebooks
pytest: false
libraries:
apt:
Expand Down
19 changes: 15 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
[tox]
envlist = py{39,310,311}{,-devdeps,-oldestdeps,-online},build_docs,codestyle
envlist = py{39,310,311}{,-devdeps,-oldestdeps,-online},build_docs{,-notebooks},codestyle
requires =
setuptools >= 30.3.0
pip >= 21.0.1
#tox-pypi-filter >= 0.12

[testenv]
passenv = CC
# Pass through the following environment variables which may be needed for the CI
pass_env =
# A variable to tell tests we are on a CI system
CI
# Custom compiler locations (such as ccache)
CC
# Location of locales (needed by sphinx on some systems)
LOCALE_ARCHIVE
# If the user has set a LC override we should follow it
# (note LANG is automatically passed through by tox)
LC_ALL
setenv =
MPLBACKEND = agg
COLUMNS = 180
Expand Down Expand Up @@ -49,14 +59,15 @@ commands_pre =
oldestdeps: pip install -r requirements-min.txt cryptography<42 jsonschema==4.0.1
pip freeze --all --no-input

[testenv:build_docs]
[testenv:build_docs{,-notebooks}]
changedir = docs
extras = docs
description = Invoke sphinx-build to build the HTML docs
commands =
pip freeze --all --no-input
# Disable parallel here due to https://github.com/astropy/astropy/issues/14916
sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
!notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html -D nb_execution_mode=off {posargs}
notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'

[testenv:codestyle]
Expand Down

0 comments on commit 38b6829

Please sign in to comment.