aiobotocore
aiobotocore copied to clipboard
Improve portability of docs automation
FWIW, it's nice to run the same automation @ RTD, CI, and locally. I like using tox for this (some people go for nox).
You can make RTD call tox as follows:
$ cat .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
---
version: 2
build:
os: ubuntu-24.04
tools:
python: >- # has to be parsed as a YAML string
3.11
commands:
- >-
PYTHONWARNINGS=error
python3 -Im venv "${READTHEDOCS_VIRTUALENV_PATH}"
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
pip install tox
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
tox -e build-docs --notest -vvvvv
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
tox -e build-docs --skip-pkg-install -q
--
"${READTHEDOCS_OUTPUT}"/html -b dirhtml
...
Another example: https://github.com/pytest-dev/pytest-asyncio/pull/920
This would allow wiring such a self-install into tox that could be run locally and in any other envs the same way.
Originally posted by @webknjaz in https://github.com/aio-libs/aiobotocore/pull/1165#discussion_r1725143794