[tox] min_version = 4.0 envlist = build_docs{,-devdeps,-bootstrap} astropy_docs{,-devdeps} website{,-devdeps} [testenv] allowlist_externals= /bin/sh /usr/bin/git /usr/bin/make 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 LC_ALL set_env = MPLBACKEND = agg bootstrap: THEME_NAME = bootstrap-astropy !bootstrap: THEME_NAME = astropy-unified bootstrap: PARALLEL = 1 !bootstrap: PARALLEL = auto deps = devdeps: git+https://github.com/pydata/pydata-sphinx-theme.git devdeps: git+https://github.com/astropy/astropy-sphinx-theme.git [testenv:build_docs{,-devdeps,-bootstrap}] changedir = docs description = Invoke sphinx-build to build the HTML docs extras = docs commands = pip freeze --all --no-input /bin/sh -c "rm -rf {toxinidir}/build_preview" 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} python -c 'import pathlib; print("Theme Docs available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))' [testenv:astropy_docs{,-devdeps}] changedir = .tmp/{envname} commands = /bin/sh -c "rm -rf {toxinidir}/build_preview" /bin/sh -c "git -C astropy pull || git clone https://github.com/Cadair/astropy -b unified-theme" python -m pip install -v -e "astropy/.[all,docs]" pip freeze --all --no-input sphinx-build --color -b html astropy/docs {toxinidir}/build_preview/_build/html {posargs} python -c 'import pathlib; print("Astropy Docs available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))' [testenv:website{,-devdeps}] changedir = .tmp/{envname} commands = /bin/sh -c "rm -rf {toxinidir}/build_preview" /bin/sh -c "git -C astropy.org pull || git clone --recurse-submodules https://github.com/astropy/astropy.github.com astropy.org" python -m pip install -r "astropy.org/requirements.txt" pip freeze --all --no-input sphinx-build --color -b dirhtml astropy.org/ {toxinidir}/build_preview/_build/html {posargs} python -c 'import pathlib; print("Website preview available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "build_preview" / "_build" / "html" / "index.html"))'