Skip to content

Commit 79371b4

Browse files
committed
⬆️ Support Sphinx v9
1 parent 59d5384 commit 79371b4

6 files changed

Lines changed: 21 additions & 20 deletions

File tree

.github/workflows/tests.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,15 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
python-version: ["3.11", "3.12", "3.13", "3.14"]
29-
sphinx: [">=8,<9"]
29+
sphinx: [">=8,<9", ">=9,<10"]
3030
os: [ubuntu-latest]
3131
include:
32-
# - os: ubuntu-latest
33-
# python-version: "3.11"
34-
# sphinx: ">=7,<8"
3532
- os: windows-latest
3633
python-version: "3.11"
3734
sphinx: ">=8,<9"
3835
- os: windows-latest
3936
python-version: "3.14"
40-
sphinx: ">=8,<9"
37+
sphinx: ">=9,<10"
4138

4239
runs-on: ${{ matrix.os }}
4340

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
"markdown-it-py~=4.0",
4040
"mdit-py-plugins~=0.5",
4141
"pyyaml",
42-
"sphinx>=8,<9",
42+
"sphinx>=8,<10",
4343
]
4444

4545
[project.urls]

tests/test_renderers/fixtures/sphinx_directives.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ term 2 : B
386386
Definition of both terms.
387387
.
388388

389-
SPHINX4-SKIP productionlist (`sphinx.domains.std.ProductionList`):
389+
productionlist (`sphinx.domains.std.ProductionList`):
390390
.
391391
```{productionlist} try_stmt: try1_stmt | try2_stmt
392392
```
@@ -426,7 +426,7 @@ rst:directive (`sphinx.domains.rst.ReSTDirective`):
426426
<desc_content>
427427
.
428428

429-
SPHINX4-SKIP rst:directive:option (`sphinx.domains.rst.ReSTDirectiveOption`):
429+
rst:directive:option (`sphinx.domains.rst.ReSTDirectiveOption`):
430430
.
431431
```{rst:directive:option} a
432432
```

tests/test_renderers/fixtures/sphinx_syntax_elements.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Image empty:
169169
.
170170
<document source="<src>/index.md">
171171
<paragraph>
172-
<image alt="" uri="">
172+
<image alt="" candidates="{'*': '.'}" original_uri="" uri=".">
173173
.
174174

175175
Image with alt and title:
@@ -178,7 +178,7 @@ Image with alt and title:
178178
.
179179
<document source="<src>/index.md">
180180
<paragraph>
181-
<image alt="alt" title="title" uri="src">
181+
<image alt="alt" candidates="{'*': 'src'}" title="title" uri="src">
182182
.
183183

184184
Image with escapable html:
@@ -187,7 +187,7 @@ Image with escapable html:
187187
.
188188
<document source="<src>/index.md">
189189
<paragraph>
190-
<image alt="alt" uri="http://www.google%3C%3E.com">
190+
<image alt="alt" candidates="{'?': 'http://www.google%3C%3E.com'}" uri="http://www.google%3C%3E.com">
191191
.
192192

193193
Block Quote:

tests/test_renderers/test_fixtures_sphinx.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ def _apply_transforms(self):
3434

3535
result = sphinx_doctree(file_params.content, "index.md")
3636
pformat = result.pformat("index")
37-
# changed in docutils 0.20.1
38-
pformat = pformat.replace(
39-
'<literal classes="code" language="">', '<literal classes="code">'
40-
)
37+
replacements = {
38+
# changed in docutils 0.20.1
39+
'<literal classes="code" language="">': '<literal classes="code">',
40+
# changed in sphinx 9
41+
'<image alt="" uri="">': "<image alt=\"\" candidates=\"{'*': '.'}\" original_uri=\"\" uri=\".\">",
42+
'<image alt="alt" title="title" uri="src">': "<image alt=\"alt\" candidates=\"{'*': 'src'}\" title=\"title\" uri=\"src\">",
43+
'<image alt="alt" uri=\"http://www.google%3C%3E.com\">': "<image alt=\"alt\" candidates=\"{'?': 'http://www.google%3C%3E.com'}\" uri=\"http://www.google%3C%3E.com\">",
44+
}
45+
for old, new in replacements.items():
46+
pformat = pformat.replace(old, new)
4147
file_params.assert_expected(pformat, rstrip_lines=True)
4248

4349

@@ -89,9 +95,7 @@ def test_sphinx_directives(
8995
):
9096
# TODO fix skipped directives
9197
# TODO test domain directives
92-
if file_params.title.startswith("SKIP") or file_params.title.startswith(
93-
"SPHINX4-SKIP"
94-
):
98+
if file_params.title.startswith("SKIP"):
9599
pytest.skip(file_params.title)
96100

97101
sphinx_doctree_no_tr.set_conf({"extensions": ["myst_parser"]})

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
# then then deleting compiled files has been found to fix it: `find . -name \*.pyc -delete`
1212

1313
[tox]
14-
envlist = py311-sphinx8
14+
envlist = py311-sphinx9
1515

1616
[testenv]
1717
usedevelop = true
1818

19-
[testenv:py{311,312,313,314}-sphinx{8}]
19+
[testenv:py{311,312,313,314}-sphinx{8,9}]
2020
deps =
2121
sphinx8: sphinx>=8,<9
2222
extras =

0 commit comments

Comments
 (0)