Skip to content

Commit 7cbc77f

Browse files
authored
Fix RTD build (#1396)
* Fix RTD build * Update contributing guide
1 parent d85bc09 commit 7cbc77f

File tree

4 files changed

+27
-32
lines changed

4 files changed

+27
-32
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,20 @@ $ tox run -e docs-watch
9898

9999
This will build the documentation, watch for changes, and rebuild it whenever you save a file.
100100

101-
To just build the documentation and run doctests, use:
101+
To just build the documentation and exit immediately use:
102102

103103
```console
104-
$ tox run -e docs
104+
$ tox run -e docs-build
105105
```
106106

107107
You will find the built documentation in `docs/_build/html`.
108108

109+
To run doctests:
110+
111+
```console
112+
$ tox run -e docs-doctests
113+
```
114+
109115

110116
## Code
111117

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
if: ${{ failure() }}
173173

174174
docs:
175-
name: Build docs & run doctests
175+
name: Run doctests & render changelog
176176
runs-on: ubuntu-latest
177177
needs: build-package
178178
steps:
@@ -188,7 +188,7 @@ jobs:
188188
python-version: "3.13"
189189
- uses: hynek/setup-cached-uv@v2
190190

191-
- run: uvx --with=tox-uv tox run -e docs,changelog
191+
- run: uvx --with=tox-uv tox run -e docs-doctests,changelog
192192

193193
pyright:
194194
name: Check types using pyright

.readthedocs.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ build:
77
# Keep version in sync with tox.ini/docs and ci.yml/docs.
88
python: "3.13"
99
jobs:
10-
# Need the tags to calculate the version (sometimes).
11-
post_checkout:
10+
create_environment:
11+
# Need the tags to calculate the version (sometimes).
1212
- git fetch --tags
1313

14-
# Replace versions in sponsor URLs.
15-
pre_build:
16-
- python -Im pip install tox-uv
17-
- python -Im tox run -e docs-sponsors
14+
- asdf plugin add uv
15+
- asdf install uv latest
16+
- asdf global uv latest
1817

19-
python:
20-
install:
21-
- method: pip
22-
path: .
23-
extra_requirements:
24-
- docs
18+
build:
19+
html:
20+
- uvx --with tox-uv tox run -e docs-sponsors
21+
- uvx --with tox-uv tox run -e docs-build -- $READTHEDOCS_OUTPUT

tox.ini

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env_list =
66
py3{10,11,12,13}-mypy,
77
pypy3-tests,
88
pyright,
9-
docs{,-sponsors},
9+
docs-{sponsors,doctests},
1010
changelog,
1111
coverage-report
1212

@@ -64,19 +64,19 @@ pass_env =
6464
commands = pytest --codspeed -n auto bench/test_benchmarks.py
6565

6666

67-
[testenv:docs]
68-
# Keep base_python in-sync with ci.yml/docs and .readthedocs.yaml.
67+
[testenv:docs-{build,doctests,linkcheck}]
68+
# Keep base_python in sync with ci.yml/docs and .readthedocs.yaml.
6969
base_python = py313
7070
extras = docs
7171
commands =
72-
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
73-
sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
74-
72+
build: sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
73+
doctests: sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
74+
linkcheck: sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
7575

7676
[testenv:docs-watch]
7777
package = editable
78-
base_python = {[testenv:docs]base_python}
79-
extras = {[testenv:docs]extras}
78+
base_python = {[testenv:docs-build]base_python}
79+
extras = {[testenv:docs-build]extras}
8080
deps = watchfiles
8181
commands =
8282
watchfiles \
@@ -85,14 +85,6 @@ commands =
8585
src \
8686
docs
8787

88-
89-
[testenv:docs-linkcheck]
90-
package = editable
91-
base_python = {[testenv:docs]base_python}
92-
extras = {[testenv:docs]extras}
93-
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
94-
95-
9688
[testenv:docs-sponsors]
9789
description = Ensure sponsor logos are up to date.
9890
deps = cogapp

0 commit comments

Comments
 (0)