Skip to content

Commit b901727

Browse files
authored
Merge pull request #496 from beeware/rtd-py-version
Add explicit RTD version pin, and protect against Sphinx 8 deprecations
2 parents 9dbc5d2 + 12d6f93 commit b901727

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

.readthedocs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3"
12+
# Docs are always built on Python 3.12. See also the tox config and contribution docs.
13+
python: "3.12"
1314
jobs:
1415
pre_build:
1516
- tox -e docs-lint

changes/496.doc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Building Rubicon ObjC's documentation now requires the use of Python 3.12.

docs/how-to/contribute-docs.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ study the other index files for clues.
1919
Build documentation locally
2020
---------------------------
2121

22+
.. Docs are always built on Python 3.12. See also the RTD and tox config.
23+
2224
To build the documentation locally, :ref:`set up a development environment
23-
<setup-dev-environment>`.
25+
<setup-dev-environment>`. However, you **must** have a Python 3.12 interpreter
26+
installed and available on your path (i.e., ``python3.12`` must start a Python
27+
3.12 interpreter).
2428

2529
You'll also need to install the Enchant spell checking library.
2630
Enchant can be installed using `Homebrew <https://brew.sh>`__:

pyproject.toml

+4-6
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,14 @@ dev = [
5555
"setuptools_scm == 8.1.0",
5656
"tox == 4.16.0",
5757
]
58+
# Docs are always built on a specific Python version; see RTD and tox config files,
59+
# and the docs contribution guide.
5860
docs = [
5961
"furo == 2024.7.18",
6062
"pyenchant == 3.2.2",
61-
# Sphinx 7.2 deprecated support for Python 3.8
62-
"sphinx == 7.1.2 ; python_version < '3.9'",
63-
"sphinx == 7.4.7 ; python_version >= '3.9'",
63+
"sphinx == 7.4.7",
6464
"sphinx_tabs == 3.4.5",
65-
# Sphinx 2024.2.4 deprecated support for Python 3.8
66-
"sphinx-autobuild == 2021.3.14 ; python_version < '3.9'",
67-
"sphinx-autobuild == 2024.4.16 ; python_version >= '3.9'",
65+
"sphinx-autobuild == 2024.4.16",
6866
"sphinx-copybutton == 0.5.2",
6967
"sphinxcontrib-spelling == 8.0.0",
7068
]

tox.ini

+11-15
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,25 @@ commands =
4242
[docs]
4343
docs_dir = {tox_root}{/}docs
4444
build_dir = {[docs]docs_dir}{/}_build
45-
# replace when Sphinx>=7.3 and Python 3.8 is dropped:
46-
# -T => --show-traceback
47-
# -W => --fail-on-warning
48-
# -b => --builder
49-
# -v => --verbose
50-
# -a => --write-all
51-
# -E => --fresh-env
52-
sphinx_args = -T -W --keep-going --jobs auto
45+
sphinx_args = --show-traceback --fail-on-warning --keep-going --jobs auto
5346

5447
[testenv:docs{,-lint,-all,-live,-live-src}]
48+
# Docs are always built on Python 3.12. See also the RTD config and contribution docs.
49+
base_python = py312
50+
# give sphinx-autobuild time to shutdown http server
51+
suicide_timeout = 1
5552
package = wheel
5653
wheel_build_env = .pkg
57-
change_dir = docs
5854
extras = docs
5955
passenv =
6056
# On macOS M1, you need to manually set the location of the PyEnchant
6157
# library:
6258
# export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.2.dylib
6359
PYENCHANT_LIBRARY_PATH
6460
commands =
65-
!lint-!all-!live : python -m sphinx {[docs]sphinx_args} {posargs} -b html {[docs]docs_dir} {[docs]build_dir}{/}html
66-
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b spelling {[docs]docs_dir} {[docs]build_dir}{/}spell
67-
lint : python -m sphinx {[docs]sphinx_args} {posargs} -b linkcheck {[docs]docs_dir} {[docs]build_dir}{/}links
68-
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html {[docs]docs_dir} {[docs]build_dir}{/}html
69-
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} -b html {[docs]docs_dir} {[docs]build_dir}{/}live
70-
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} -a -E --watch {tox_root}{/}src{/}rubicon{/}objc -b html {[docs]docs_dir} {[docs]build_dir}{/}live
61+
!lint-!all-!live : python -m sphinx {[docs]sphinx_args} {posargs} --builder html {[docs]docs_dir} {[docs]build_dir}{/}html
62+
lint : python -m sphinx {[docs]sphinx_args} {posargs} --builder spelling {[docs]docs_dir} {[docs]build_dir}{/}spell
63+
lint : python -m sphinx {[docs]sphinx_args} {posargs} --builder linkcheck {[docs]docs_dir} {[docs]build_dir}{/}links
64+
all : python -m sphinx {[docs]sphinx_args} {posargs} --verbose --write-all --fresh-env --builder html {[docs]docs_dir} {[docs]build_dir}{/}html
65+
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} --builder html {[docs]docs_dir} {[docs]build_dir}{/}live
66+
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} --write-all --fresh-env --watch {tox_root}{/}src{/}rubicon{/}objc --builder html {[docs]docs_dir} {[docs]build_dir}{/}live

0 commit comments

Comments
 (0)