diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf08d472..1722feb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: - linux: py311 - windows: py310-online - macos: py39 - - linux: build_docs + - linux: build_docs-notebooks pytest: false libraries: apt: diff --git a/tox.ini b/tox.ini index 1ccd017a..0d33230b 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -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]