Skip to content

Commit eea24ac

Browse files
committed
Update for Sphinx 5.2
Drop support for Sphinx 3.2
1 parent 9e19af0 commit eea24ac

7 files changed

Lines changed: 66 additions & 61 deletions

File tree

.github/workflows/python_ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
fail-fast: False
2929
matrix:
3030
config:
31-
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
32-
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
33-
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
34-
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
35-
- {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
36-
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: True}
31+
- {python-version: "3.6", testenvs: "py36-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
32+
- {python-version: "3.7", testenvs: "py37-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
33+
- {python-version: "3.8", testenvs: "py38-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
34+
- {python-version: "3.9", testenvs: "py39-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
35+
- {python-version: "3.10", testenvs: "py310-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
36+
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: True}
3737

3838
steps:
3939
- name: Checkout 🛎️

.github/workflows/python_ci_linux.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
fail-fast: False
3030
matrix:
3131
config:
32-
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
33-
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
34-
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
35-
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
36-
- {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
37-
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: True}
32+
- {python-version: "3.6", testenvs: "py36-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
33+
- {python-version: "3.7", testenvs: "py37-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
34+
- {python-version: "3.8", testenvs: "py38-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
35+
- {python-version: "3.9", testenvs: "py39-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
36+
- {python-version: "3.10", testenvs: "py310-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
37+
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: True}
3838

3939
steps:
4040
- name: Checkout 🛎️

.github/workflows/python_ci_macos.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
fail-fast: False
2929
matrix:
3030
config:
31-
- {python-version: "3.6", testenvs: "py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
32-
- {python-version: "3.7", testenvs: "py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
33-
- {python-version: "3.8", testenvs: "py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
34-
- {python-version: "3.9", testenvs: "py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
35-
- {python-version: "3.10", testenvs: "py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: False}
36-
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1},build", experimental: True}
31+
- {python-version: "3.6", testenvs: "py36-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5},build", experimental: False}
32+
- {python-version: "3.7", testenvs: "py37-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
33+
- {python-version: "3.8", testenvs: "py38-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
34+
- {python-version: "3.9", testenvs: "py39-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
35+
- {python-version: "3.10", testenvs: "py310-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: False}
36+
- {python-version: "3.11.0-rc.1", testenvs: "py311-dev-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2},build", experimental: True}
3737

3838
steps:
3939
- name: Checkout 🛎️

html_section/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ def depart_title(
159159

160160
translator.in_title = 0
161161
if isinstance(node.parent, nodes.table):
162+
assert translator.table is not None
162163
translator.table.caption = translator.popbody()
163164
else:
164165
translator.body.append(translator.context.pop())
@@ -192,7 +193,7 @@ def apply(self, **kwargs) -> None: # noqa: D102
192193
if not hasattr(env, "html_only_node_docnames"):
193194
env.html_only_node_docnames = set()
194195

195-
if self.app.builder.format.lower() == "html": # type: ignore[union-attr]
196+
if self.app.builder.format.lower() == "html":
196197
return
197198

198199
for node in _traverse(self.document, html_section_indicator):

repo_helper.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ python_versions:
2424
sphinx:
2525
- 5.0
2626
- 5.1
27+
- 5.2
2728
3.7:
2829
3.8:
2930
3.9:
@@ -37,7 +38,6 @@ keywords:
3738

3839
third_party_version_matrix:
3940
sphinx:
40-
- 3.2
4141
- 3.3
4242
- 3.4
4343
- 3.5
@@ -49,6 +49,7 @@ third_party_version_matrix:
4949
- 4.5
5050
- 5.0
5151
- 5.1
52+
- 5.2
5253
docutils:
5354
- 0.16
5455
- 0.17
@@ -65,3 +66,6 @@ classifiers:
6566

6667
mypy_deps:
6768
- types-docutils
69+
70+
tox_unmanaged:
71+
- testenv

tests/test_output_/test_html_output.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
<script src="_static/_sphinx_javascript_frameworks_compat.js">
1919
</script>{% endif %}
2020
<script src="_static/doctools.js">
21-
</script>
21+
</script>{% if sphinx_version >= (5, 2) %}
22+
<script src="_static/sphinx_highlight.js">
23+
</script>{% endif %}
2224
<meta content="width=device-width, initial-scale=0.9, maximum-scale=0.9" name="viewport"/>
2325
</head>
2426
<body>

tox.ini

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# You may add new sections, but any changes made to the following sections will be lost:
33
# * tox
44
# * envlists
5-
# * testenv
65
# * testenv:docs
76
# * testenv:build
87
# * testenv:lint
@@ -18,12 +17,12 @@
1817

1918
[tox]
2019
envlist =
21-
py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5}
22-
py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
23-
py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
24-
py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
25-
py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
26-
py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
20+
py36-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5}
21+
py37-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
22+
py38-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
23+
py39-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
24+
py310-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
25+
py311-dev-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
2726
py36-docutils{0.16}
2827
py37-docutils{0.16,0.17,0.18}
2928
py38-docutils{0.16,0.17,0.18}
@@ -41,46 +40,20 @@ requires =
4140

4241
[envlists]
4342
test =
44-
py36-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5}
45-
py37-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
46-
py38-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
47-
py39-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
48-
py310-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
49-
py311-dev-sphinx{3.2,3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1}
43+
py36-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5}
44+
py37-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
45+
py38-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
46+
py39-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
47+
py310-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
48+
py311-dev-sphinx{3.3,3.4,3.5,4.0,4.1,4.2,4.3,4.4,4.5,5.0,5.1,5.2}
5049
py36-docutils{0.16}
5150
py37-docutils{0.16,0.17,0.18}
5251
py38-docutils{0.16,0.17,0.18}
5352
py39-docutils{0.16,0.17,0.18}
5453
py310-docutils{0.16,0.17,0.18}
5554
py311-dev-docutils{0.16,0.17,0.18}
5655
qa = mypy, lint
57-
cov = py36-sphinx3.2, coverage
58-
59-
[testenv]
60-
setenv =
61-
PYTHONDEVMODE=1
62-
PIP_DISABLE_PIP_VERSION_CHECK=1
63-
SETUPTOOLS_USE_DISTUTILS=stdlib
64-
deps =
65-
-r{toxinidir}/tests/requirements.txt
66-
sphinx3.2: sphinx~=3.2.0
67-
sphinx3.3: sphinx~=3.3.0
68-
sphinx3.4: sphinx~=3.4.0
69-
sphinx3.5: sphinx~=3.5.0
70-
sphinx4.0: sphinx~=4.0.0
71-
sphinx4.1: sphinx~=4.1.0
72-
sphinx4.2: sphinx~=4.2.0
73-
sphinx4.3: sphinx~=4.3.0
74-
sphinx4.4: sphinx~=4.4.0
75-
sphinx4.5: sphinx~=4.5.0
76-
sphinx5.0: sphinx~=5.0.0
77-
sphinx5.1: sphinx~=5.1.0
78-
docutils0.16: docutils~=0.16.0
79-
docutils0.17: docutils~=0.17.0
80-
docutils0.18: docutils~=0.18.0
81-
commands =
82-
python --version
83-
python -m pytest --cov=html_section -r aR tests/ {posargs}
56+
cov = py36-sphinx3.3, coverage
8457

8558
[testenv:build]
8659
skip_install = True
@@ -232,3 +205,28 @@ filterwarnings =
232205
always:'imghdr' is deprecated and slated for removal in Python 3.13:DeprecationWarning:sphinx.util.images
233206
always:The `docutils.parsers.rst.directive.html` module will be removed in Docutils 1.2:DeprecationWarning
234207
markers = sphinx
208+
209+
[testenv]
210+
setenv =
211+
PYTHONDEVMODE=1
212+
PIP_DISABLE_PIP_VERSION_CHECK=1
213+
SETUPTOOLS_USE_DISTUTILS=stdlib
214+
deps =
215+
-r{toxinidir}/tests/requirements.txt
216+
-r{toxinidir}/requirements.txt
217+
sphinx3.3: sphinx==3.3.1
218+
sphinx3.4: sphinx==3.4.3
219+
sphinx3.5: sphinx==3.5.4
220+
sphinx3.{2,3,4,5}: docutils==0.16
221+
sphinx4.0: sphinx==4.0.3
222+
sphinx4.1: sphinx==4.1.2
223+
sphinx4.2: sphinx==4.2.0
224+
sphinx4.3: sphinx==4.3.2
225+
sphinx4.4: sphinx==4.4.0
226+
sphinx4.5: sphinx==4.5.0
227+
sphinx5.0: sphinx==5.0.2
228+
sphinx5.1: sphinx==5.1.1
229+
sphinx5.2: sphinx==5.2.1
230+
commands =
231+
python --version
232+
python -m pytest --cov=html_section -r aR tests/ {posargs}

0 commit comments

Comments
 (0)