diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 6964328dd..51c5c810a 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,30 +4,26 @@ --- -# Required +# RTD API version version: 2 -# Build documentation in the docs/ directory with Sphinx -sphinx: - builder: dirhtml - configuration: docs/conf.py - fail_on_warning: true - -formats: [] - -submodules: - include: all # [] - exclude: [] - recursive: true - build: os: ubuntu-22.04 tools: - python: "3.10" + python: >- + 3.10 + commands: + - python -Im venv "${READTHEDOCS_VIRTUALENV_PATH}" + - >- + "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im + pip install tox + - >- + "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im + tox -e build-docs --notest -vvvvv + - >- + SPHINX_BUILDER=dirhtml + SPHINX_BUILD_OUTPUT_DIRECTORY="${READTHEDOCS_OUTPUT}"/html + "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im + tox -e build-docs --skip-pkg-install -q -# Optionally set the version of Python and requirements required -# to build docs -python: - install: - - requirements: docs/requirements.txt ... diff --git a/tox.ini b/tox.ini index 3a618f90a..3cf0c78e1 100644 --- a/tox.ini +++ b/tox.ini @@ -325,16 +325,18 @@ commands = -git fetch --tags # Build the html docs with Sphinx: - {envpython} -m sphinx \ + {envpython} -Im sphinx \ + {posargs:\ -j auto \ - -b html \ + -b {env:SPHINX_BUILDER:html} \ {tty:--color} \ -a \ -n \ -W --keep-going \ -d "{temp_dir}/.doctrees" \ . \ - "{envdir}/docs_out" + {env:SPHINX_BUILD_OUTPUT_DIRECTORY:"{envdir}/docs_out"} \ + } # Print out the output docs dir and a way to serve html: -{envpython} -c\ @@ -344,12 +346,14 @@ commands = print("\n" + "=" * 120 +\ f"\n\nDocumentation available under:\n\n\ \tfile://\{index_file\}\n\nTo serve docs, use\n\n\ - \t$ python3 -m http.server --directory \ + \t$ python3 -Im http.server --directory \ \N\{QUOTATION MARK\}\{docs_dir\}\N\{QUOTATION MARK\} 0\n\n" +\ "=" * 120)' changedir = {toxinidir}/docs isolated_build = true passenv = + SPHINX_BUILDER + SPHINX_BUILD_OUTPUT_DIRECTORY SSH_AUTH_SOCK skip_install = true