| 1 |
[tox] |
| 2 |
min_version = 4.0 |
| 3 |
envlist = |
| 4 |
build_docs{,-devdeps,-bootstrap} |
| 5 |
astropy_docs{,-devdeps} |
| 6 |
website{,-devdeps} |
| 7 |
|
| 8 |
[testenv] |
| 9 |
allowlist_externals= |
| 10 |
/bin/sh |
| 11 |
/usr/bin/git |
| 12 |
/usr/bin/make |
| 13 |
pass_env = |
| 14 |
# A variable to tell tests we are on a CI system |
| 15 |
CI |
| 16 |
# Custom compiler locations (such as ccache) |
| 17 |
CC |
| 18 |
# Location of locales (needed by sphinx on some systems) |
| 19 |
LOCALE_ARCHIVE |
| 20 |
# If the user has set a LC override we should follow it |
| 21 |
LC_ALL |
| 22 |
set_env = |
| 23 |
MPLBACKEND = agg |
| 24 |
bootstrap: THEME_NAME = bootstrap-astropy |
| 25 |
!bootstrap: THEME_NAME = astropy-unified |
| 26 |
bootstrap: PARALLEL = 1 |
| 27 |
!bootstrap: PARALLEL = auto |
| 28 |
deps = |
| 29 |
devdeps: git+https://github.com/pydata/pydata-sphinx-theme.git |
| 30 |
devdeps: git+https://github.com/astropy/astropy-sphinx-theme.git |
| 31 |
|
| 32 |
[testenv:build_docs{,-devdeps,-bootstrap}] |
| 33 |
changedir = docs |
| 34 |
description = Invoke sphinx-build to build the HTML docs |
| 35 |
extras = |
| 36 |
docs |
| 37 |
commands = |
| 38 |
pip freeze --all --no-input |
| 39 |
/bin/sh -c "rm -rf {toxinidir}/build_preview" |
| 40 |
sphinx-build --color -W --keep-going -b html -d _build/.doctrees -D html_theme={env:THEME_NAME} . {toxinidir}/build_preview/_build/html -j {env:PARALLEL} {posargs} |
| 41 |
python -c 'import pathlib; print("Theme Docs available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))' |
| 42 |
|
| 43 |
[testenv:astropy_docs{,-devdeps}] |
| 44 |
changedir = .tmp/{envname} |
| 45 |
commands = |
| 46 |
/bin/sh -c "rm -rf {toxinidir}/build_preview" |
| 47 |
/bin/sh -c "git -C astropy pull || git clone https://github.com/Cadair/astropy -b unified-theme" |
| 48 |
python -m pip install -v -e "astropy/.[all,docs]" |
| 49 |
pip freeze --all --no-input |
| 50 |
sphinx-build --color -b html astropy/docs {toxinidir}/build_preview/_build/html {posargs} |
| 51 |
python -c 'import pathlib; print("Astropy Docs available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))' |
| 52 |
|
| 53 |
[testenv:website{,-devdeps}] |
| 54 |
changedir = .tmp/{envname} |
| 55 |
commands = |
| 56 |
/bin/sh -c "rm -rf {toxinidir}/build_preview" |
| 57 |
/bin/sh -c "git -C astropy.org pull || git clone --recurse-submodules https://github.com/astropy/astropy.github.com astropy.org" |
| 58 |
python -m pip install -r "astropy.org/requirements.txt" |
| 59 |
pip freeze --all --no-input |
| 60 |
sphinx-build --color -b dirhtml astropy.org/ {toxinidir}/build_preview/_build/html {posargs} |
| 61 |
python -c 'import pathlib; print("Website preview available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))' |