Skip to content

Commit 6b587d1

Browse files
authored
Prepare for 3.0 release (#1576)
* Tests: `sphinxdev` tox environment installs Sphinx from `master` It seems we had a bug in the name and it wasn't installing Sphinx from `master`. I expect this test to fail now because we pin `Sphinx<8`, but that's fine for now. * Prepare for 3.0 release - Drop Python <3.8 - Drop docutils <=0.18 - Add support for docutils 0.21 - Add support for Python 3.12 This follows the plan we wrote in https://sphinx-rtd-theme.readthedocs.io/en/stable/development.html#roadmap-release-3-0-0 The main idea here is to move forward with newer versions and drop support for old stuffs so we reduce the maintanence burden. * Update CircleCI matrix * More fixes to CircleCI * Run test over Sphinx 8.0 * Update contributing guide * Remove deprecated `readthedocs-sphinx-ext` * Remove old Sphinx versions * Uninstall our extension * Show a warning if `extra_css_files` is in the `html_context` See #450 * Update development page * Add deprecate warning for `analytics_` theme options * Update docs * Remove unused dependency Closes #1533 * Remove environment variables from our docs This was already added in a more generic way to the theme itself. * Require Sphinx >=6.0 * Deprecation warning about `get_html_theme_path` See #1479 (comment)
1 parent 768dcc1 commit 6b587d1

File tree

9 files changed

+75
-74
lines changed

9 files changed

+75
-74
lines changed

.circleci/config.yml

+15-24
Original file line numberDiff line numberDiff line change
@@ -44,54 +44,51 @@ jobs:
4444
- image: 'cimg/python:3.9-node'
4545
steps:
4646
- run-build: {}
47-
py36:
48-
docker:
49-
- image: 'cimg/python:3.6'
50-
steps:
51-
- run-tox:
52-
version: py36
53-
sphinx-version: "50,51,52,53"
54-
py37:
55-
docker:
56-
- image: 'cimg/python:3.7'
57-
steps:
58-
- run-tox:
59-
version: py37
60-
sphinx-version: "50,51,52,53"
6147
py38:
6248
docker:
6349
- image: 'cimg/python:3.8'
6450
steps:
6551
- run-tox:
6652
version: py38
67-
sphinx-version: "50,51,52,53,60,61,62,70,71,latest"
53+
sphinx-version: "60,61,62,70,71"
6854
py39:
6955
docker:
7056
- image: 'cimg/python:3.9'
7157
steps:
7258
- run-tox:
7359
version: py39
74-
sphinx-version: "50,51,52,53,60,61,62,70,71,72,latest"
60+
sphinx-version: "60,61,62,70,71,72,73,74"
7561
py310:
7662
docker:
7763
- image: 'cimg/python:3.10'
7864
steps:
7965
- run-tox:
8066
version: py310
81-
sphinx-version: "50,51,52,53,60,61,62,70,71,72,latest"
67+
sphinx-version: "60,61,62,70,71,72,73,74,80,latest,dev"
8268
py311:
8369
docker:
8470
- image: 'cimg/python:3.11'
8571
steps:
8672
- run-tox:
8773
version: py311
88-
sphinx-version: "53,60,61,62,70,71,72,latest,dev"
74+
sphinx-version: "72,73,74,80,latest,dev"
75+
76+
py312:
77+
docker:
78+
- image: 'cimg/python:3.12'
79+
steps:
80+
- run-tox:
81+
version: py312
82+
sphinx-version: "72,73,74,80,latest,dev"
8983

9084
workflows:
9185
version: 2
9286
tests:
9387
jobs:
9488
- build
89+
- py312:
90+
requires:
91+
- build
9592
- py311:
9693
requires:
9794
- build
@@ -104,9 +101,3 @@ workflows:
104101
- py38:
105102
requires:
106103
- build
107-
- py37:
108-
requires:
109-
- build
110-
- py36:
111-
requires:
112-
- build

docs/conf.py

-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@
6868
range(1, 100)
6969
))
7070

71-
if 'READTHEDOCS' in os.environ:
72-
html_context['READTHEDOCS'] = True
73-
html_context['READTHEDOCS_PROJECT'] = os.environ.get("READTHEDOCS_PROJECT")
74-
7571
html_logo = "demo/static/logo-wordmark-light.svg"
7672
html_show_sourcelink = True
7773
html_favicon = "demo/static/favicon.ico"

docs/configuring.rst

+7
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ Miscellaneous options
102102

103103
:type: string
104104

105+
.. deprecated:: 3.0.0
106+
The ``analytics_id`` option is deprecated, use the sphinxcontrib-googleanalytics_ extension instead.
107+
105108
.. _gtag.js: https://developers.google.com/gtagjs
109+
.. _sphinxcontrib-googleanalytics: https://pypi.org/project/sphinxcontrib-googleanalytics/
106110

107111
.. confval:: analytics_anonymize_ip
108112

@@ -111,6 +115,9 @@ Miscellaneous options
111115
:type: boolean
112116
:default: ``False``
113117

118+
.. deprecated:: 3.0.0
119+
The ``analytics_anonymize_ip`` option is deprecated, use the sphinxcontrib-googleanalytics_ extension instead.
120+
114121
.. confval:: canonical_url
115122

116123
This will specify a `canonical URL`_ meta link element to tell search

docs/contributing.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Use the following steps:
8686
8787
# Runs the development webserver
8888
$ docker-compose run sphinx_rtd_theme dev
89-
89+
9090
# If you want to copy stuff out of the Docker environment, run this make
9191
# target or read the actual Makefile to see what is going on.
9292
# We suggest running this command every time that you want to quickly build
@@ -108,13 +108,13 @@ The following cases need to be tested with changes to CSS or JavaScript:
108108
We support large, tablet, and mobile viewport sizes
109109
* We currently support only HTML5 writer.
110110
* Multiple major versions of Sphinx should be tested.
111-
We currently support Sphinx ``>=5.0``
111+
We currently support Sphinx ``>=6.0``
112112

113113
It's easiest to test combinations of dependency versions using ``tox``:
114114

115115
.. code:: console
116116
117-
% tox -e py310-sphinx62
117+
% tox -e py312-sphinx74
118118
119119
If the tests and build are successful, you can view the built documentation at
120120
the directory noted by Sphinx:
@@ -123,9 +123,9 @@ the directory noted by Sphinx:
123123
124124
build succeeded, 10 warnings.
125125
126-
The HTML pages are in .tox/py310-sphinx62/tmp/html.
126+
The HTML pages are in .tox/py312-sphinx74/tmp/html.
127127
___________________________ summary ___________________________
128-
py310-sphinx62: commands succeeded
128+
py312-sphinx74: commands succeeded
129129
congratulations :)
130130
131131
You can then open up this path with a series of browsers to test.
@@ -135,12 +135,12 @@ multiple ``tox`` environments, and open both up for comparison:
135135

136136
.. code:: console
137137
138-
% tox -e py310-sphinx62
138+
% tox -e py312-sphinx62
139139
...
140-
% tox -e py310-sphinx53
140+
% tox -e py312-sphinx74
141141
...
142-
% firefox .tox/py310-sphinx62/tmp/html/index.html
143-
% firefox .tox/py310-sphinx53/tmp/html/index.html
142+
% firefox .tox/py312-sphinx62/tmp/html/index.html
143+
% firefox .tox/py312-sphinx74/tmp/html/index.html
144144
145145
You can also use a separate ``tox`` environment for building output to compare
146146
against. All of the ``tox`` environments have an additional postfix, ``-qa``, to
@@ -167,11 +167,11 @@ Currently, the most important environments to QA are:
167167
the cases above, we'll be here all day. Python 3, and latest
168168
minor of each major Sphinx release should give us enough work.
169169
170-
* ``py310-sphinx53``
171-
* ``py310-sphinx62``
172-
* ``py310-sphinx72``
173-
* ``py310-sphinxlatest``
174-
* ``py310-sphinxdev``
170+
* ``py312-sphinx62``
171+
* ``py312-sphinx74``
172+
* ``py312-sphinx80``
173+
* ``py312-sphinxlatest``
174+
* ``py312-sphinxdev``
175175

176176
Translations
177177
============

docs/development.rst

+11-13
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,8 @@ combinations.
3636

3737
Unsupported browser/operating system combinations include:
3838

39-
Internet Explorer (any OS, versions <=10)
40-
**Unsupported.** IE11 is the last partially supported version. We do no
41-
testing on prior versions.
42-
43-
Internet Explorer (any OS, version 11)
44-
We currently only partially support IE11, and only test for major bugs.
45-
Support will be removed in the :ref:`roadmap-release-3.0.0` release.
39+
Internet Explorer (any OS, any version)
40+
Support was removed in the :ref:`roadmap-release-3.0.0` release.
4641

4742
Opera (any OS, any version)
4843
**Community support only.** We do not receive enough traffic with this
@@ -62,11 +57,14 @@ The theme officially supports the following dependencies in your Sphinx project:
6257
* - Dependency
6358
- Versions
6459
* - Python
65-
- 3.6 or greater
60+
- 3.8 or greater
6661
* - Sphinx
67-
- 5 or greater
62+
- 6 or greater
6863
* - docutils
69-
- >= 0.14, < 0.19
64+
- > 0.18, < 0.22
65+
66+
.. deprecated:: 3.0
67+
Sphinx < 6 support removed
7068

7169
.. deprecated:: 2.0
7270
Sphinx < 5 support removed
@@ -179,10 +177,10 @@ HTML4 support will be removed
179177
3.0.0
180178
~~~~~
181179

182-
:Planned release date: 2024 Q1
180+
:Planned release date: 2024 Q3
183181

184-
This release is not yet fully planned.
185-
However, we already know that we will be dropping support for older version of different dependencies and browsers.
182+
This release will drop support for old Python and Sphinx versions,
183+
and will add support for new ones.
186184

187185
Sphinx 5, Python < 3.8 and docutils < 0.18 support will be removed
188186
Sphinx 5 is the latest version that supports Python 3.6 and 3.7,

setup.cfg

+4-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ classifiers =
2929
Intended Audience :: Developers
3030
Programming Language :: Python :: 3
3131
Programming Language :: Python :: 3 :: Only
32-
Programming Language :: Python :: 3.6
33-
Programming Language :: Python :: 3.7
3432
Programming Language :: Python :: 3.8
3533
Programming Language :: Python :: 3.9
3634
Programming Language :: Python :: 3.10
3735
Programming Language :: Python :: 3.11
36+
Programming Language :: Python :: 3.12
3837
Operating System :: OS Independent
3938
Topic :: Documentation
4039
Topic :: Software Development :: Documentation
@@ -43,18 +42,17 @@ classifiers =
4342
include_package_data = True
4443
zip_safe = False
4544
packages = sphinx_rtd_theme
46-
python_requires = >=3.6
45+
python_requires = >=3.8
4746
install_requires =
48-
sphinx >=5,<8
49-
docutils <0.21
47+
sphinx >=6,<9
48+
docutils >0.18,<0.22
5049
sphinxcontrib-jquery >=4,<5
5150
tests_require =
5251
pytest
5352

5453
[options.extras_require]
5554
dev =
5655
transifex-client
57-
sphinxcontrib-httpdomain
5856
bump2version
5957
wheel
6058
twine

sphinx_rtd_theme/__init__.py

+20-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
def get_html_theme_path():
2323
"""Return list of HTML theme paths."""
24+
logger.warning(
25+
_('Calling get_html_theme_path is deprecated. If you are calling it to define html_theme_path, you are safe to remove that code.')
26+
)
27+
2428
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
2529
return cur_dir
2630

@@ -32,6 +36,21 @@ def config_initiated(app, config):
3236
_('The canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.')
3337
)
3438

39+
if theme_options.get("analytics_id"):
40+
logger.warning(
41+
_('The analytics_id option is deprecated, use the sphinxcontrib-googleanalytics extension instead.')
42+
)
43+
44+
if theme_options.get("analytics_anonymize_ip"):
45+
logger.warning(
46+
_('The analytics_anonymize_ip option is deprecated, use the sphinxcontrib-googleanalytics extension instead.')
47+
)
48+
49+
if "extra_css_files" in config.html_context:
50+
logger.warning(
51+
_('The extra_css_file option is deprecated, use the html_css_files option from Sphinx instead.')
52+
)
53+
3554

3655
def extend_html_context(app, pagename, templatename, context, doctree):
3756
# Add ``sphinx_version_info`` tuple for use in Jinja templates
@@ -52,7 +71,7 @@ def setup(app):
5271
if python_version[0] < 3:
5372
logger.error("Python 2 is not supported with sphinx_rtd_theme, update to Python 3.")
5473

55-
app.require_sphinx('5.0')
74+
app.require_sphinx('6.0')
5675
if app.config.html4_writer:
5776
logger.error("'html4_writer' is not supported with sphinx_rtd_theme.")
5877

tests/util.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def build(root, builder='html', **kwargs):
3434
confoverrides['html_theme'] = 'sphinx_rtd_theme'
3535
extensions = confoverrides.get('extensions', [])
3636
extensions.append('sphinx_rtd_theme')
37-
extensions.append('readthedocs_ext.readthedocs')
3837
confoverrides['extensions'] = extensions
3938
kwargs['confoverrides'] = confoverrides
4039

@@ -55,7 +54,6 @@ def build(root, builder='html', **kwargs):
5554

5655

5756
def build_all(root, **kwargs):
58-
for builder in ['html', 'singlehtml', 'readthedocs', 'readthedocsdirhtml',
59-
'readthedocssinglehtml', 'readthedocssinglehtmllocalmedia']:
57+
for builder in ['html', 'singlehtml']:
6058
with build(root, builder, **kwargs) as ret:
6159
yield ret

tox.ini

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39,310}-sphinx{50,51,52,53}{-qa}
43
py{38,39,310}-sphinx{60,61,62,70,71}{-qa}
5-
py{39,310}-sphinx{72,latest,dev}{-qa}
6-
# Python 3.11 working from Sphinx 5.3 and up
7-
py{311}-sphinx{53,60,61,62,70,71,72,latest,dev}{-qa}
4+
py{39,310,311,312}-sphinx{72,73,74,80}{-qa}
5+
py{310,311,312}-sphinx{latest,dev}{-qa}
86

97
[testenv]
108
setenv =
119
LANG=C
1210
deps =
1311
.
14-
readthedocs-sphinx-ext
1512
pytest
16-
sphinx50: Sphinx>=5.0,<5.1
17-
sphinx51: Sphinx>=5.1,<5.2
18-
sphinx52: Sphinx>=5.2,<5.3
19-
sphinx53: Sphinx>=5.3,<5.4
2013
sphinx60: Sphinx>=6.0,<6.1
2114
sphinx61: Sphinx>=6.1,<6.2
2215
sphinx62: Sphinx>=6.2,<6.3
2316
sphinx70: Sphinx>=7.0,<7.1
2417
sphinx71: Sphinx>=7.1,<7.2
2518
sphinx72: Sphinx>=7.2,<7.3
19+
sphinx80: Sphinx>=8.0,<8.1
2620
sphinxlatest: Sphinx
2721
sphinxdev: https://github.com/sphinx-doc/sphinx/archive/refs/heads/master.zip
2822
allowlist_externals =

0 commit comments

Comments
 (0)