Skip to content

Commit

Permalink
Wire Sphinx builds into the RTD config via tox
Browse files Browse the repository at this point in the history
Resolves #917

Adjust test paths to new doc location.
  • Loading branch information
webknjaz authored and seifertm committed Aug 20, 2024
1 parent f03cf13 commit 1bfc181
Show file tree
Hide file tree
Showing 46 changed files with 62 additions and 73 deletions.
38 changes: 24 additions & 14 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
---
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: '3.12'

sphinx:
configuration: docs/source/conf.py
fail_on_warning: true

python:
install:
- requirements: dependencies/default/constraints.txt
- requirements: dependencies/docs/constraints.txt
- path: .
python: >-
3.12
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 docs --notest -vvvvv
- >-
PYTHONWARNINGS=error
"${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im
tox -e docs --skip-pkg-install -q
--
"${READTHEDOCS_OUTPUT}"/html
-b html
-D language=en
20 changes: 0 additions & 20 deletions docs/Makefile

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ show_missing = true
[tool:pytest]
python_files = test_*.py *_example.py
addopts = -rsx --tb=short
testpaths = docs/source tests
testpaths = docs tests
asyncio_mode = auto
junit_family=xunit2
filterwarnings =
Expand Down
40 changes: 37 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,48 @@ allowlist_externals =
make

[testenv:docs]
allowlist_externals =
git
extras = docs
deps =
--requirement dependencies/docs/requirements.txt
--constraint dependencies/docs/constraints.txt
change_dir = docs
commands = make html
allowlist_externals =
make
description = Build The Docs with {basepython}
commands =
# Retrieve possibly missing commits:
-git fetch --unshallow
-git fetch --tags

# Build the html docs with Sphinx:
{envpython} -Im sphinx \
-j auto \
{tty:--color} \
-a \
-T \
-n \
-W --keep-going \
-d "{temp_dir}{/}.doctrees" \
. \
{posargs:"{envdir}{/}docs_out" -b html}

# Print out the output docs dir and a way to serve html:
-{envpython} -c\
'import pathlib;\
docs_dir = pathlib.Path(r"{envdir}") / "docs_out";\
index_file = docs_dir / "index.html";\
print("\n" + "=" * 120 +\
f"\n\nOpen the documentation with:\n\n\
\t$ python3 -Im webbrowser \N\{QUOTATION MARK\}file://\{index_file\}\N\{QUOTATION MARK\}\n\n\
To serve docs, use\n\n\
\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 =
SSH_AUTH_SOCK
skip_install = false

[gh-actions]
python =
Expand Down

0 comments on commit 1bfc181

Please sign in to comment.