Skip to content

Commit 97ab29f

Browse files
authored
⬆️ Drop python 3.10 and sphinx 7 (#1059)
In preparation for sphinx 9
1 parent 5dda664 commit 97ab29f

27 files changed

Lines changed: 77 additions & 145 deletions

.github/workflows/test-formats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
22+
- name: Set up Python 3.11
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.11"
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
@@ -43,10 +43,10 @@ jobs:
4343

4444
steps:
4545
- uses: actions/checkout@v4
46-
- name: Set up Python 3.10
46+
- name: Set up Python 3.11
4747
uses: actions/setup-python@v5
4848
with:
49-
python-version: "3.10"
49+
python-version: "3.11"
5050
- name: Install dependencies
5151
run: |
5252
python -m pip install --upgrade pip

.github/workflows/tests.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.10
17+
- name: Set up Python 3.11
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.10"
20+
python-version: "3.11"
2121
- uses: pre-commit/action@v3.0.1
2222

2323
tests:
2424

2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.10", "3.11", "3.12", "3.13"]
29-
sphinx: [">=8,<8.2"]
28+
python-version: ["3.11", "3.12", "3.13"]
29+
sphinx: [">=8,<9"]
3030
os: [ubuntu-latest]
3131
include:
32-
- os: ubuntu-latest
33-
python-version: "3.10"
34-
sphinx: ">=7,<8"
32+
# - os: ubuntu-latest
33+
# python-version: "3.11"
34+
# sphinx: ">=7,<8"
3535
- os: windows-latest
36-
python-version: "3.10"
37-
sphinx: ">=7,<8"
36+
python-version: "3.11"
37+
sphinx: ">=8,<9"
3838

3939
runs-on: ${{ matrix.os }}
4040

@@ -56,7 +56,7 @@ jobs:
5656
pytest --cov=myst_parser --cov-report=xml --cov-report=term-missing
5757
coverage xml
5858
- name: Upload to Codecov
59-
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.10 && matrix.os == 'ubuntu-latest'
59+
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.11 && matrix.os == 'ubuntu-latest'
6060
uses: codecov/codecov-action@v4
6161
with:
6262
token: ${{ secrets.CODECOV_TOKEN }}
@@ -78,10 +78,10 @@ jobs:
7878
steps:
7979
- name: Checkout source
8080
uses: actions/checkout@v4
81-
- name: Set up Python 3.10
81+
- name: Set up Python 3.11
8282
uses: actions/setup-python@v5
8383
with:
84-
python-version: "3.10"
84+
python-version: "3.11"
8585
- name: Install setup
8686
run: |
8787
python -m pip install --upgrade pip
@@ -133,10 +133,10 @@ jobs:
133133
steps:
134134
- name: Checkout source
135135
uses: actions/checkout@v4
136-
- name: Set up Python 3.10
136+
- name: Set up Python 3.11
137137
uses: actions/setup-python@v5
138138
with:
139-
python-version: "3.10"
139+
python-version: "3.11"
140140
- name: install flit
141141
run: |
142142
pip install flit~=3.4
@@ -156,10 +156,10 @@ jobs:
156156
steps:
157157
- name: Checkout source
158158
uses: actions/checkout@v4
159-
- name: Set up Python 3.10
159+
- name: Set up Python 3.11
160160
uses: actions/setup-python@v5
161161
with:
162-
python-version: "3.10"
162+
python-version: "3.11"
163163
- name: install flit and tomlkit
164164
run: |
165165
pip install flit~=3.4 tomlkit

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repos:
3434
args: [--config-file=pyproject.toml]
3535
additional_dependencies:
3636
- types-urllib3
37-
- sphinx~=7.4
37+
- sphinx~=8.2
3838
- markdown-it-py~=3.0
3939
- mdit-py-plugins~=0.4.0
4040
files: >

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.10"
6+
python: "3.11"
77

88
python:
99
install:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
suppress_warnings = ["myst.strikethrough"]
5555

5656
intersphinx_mapping = {
57-
"python": ("https://docs.python.org/3.10", None),
57+
"python": ("https://docs.python.org/3.11", None),
5858
"sphinx": ("https://www.sphinx-doc.org/en/master", None),
5959
"markdown_it": ("https://markdown-it-py.readthedocs.io/en/latest", None),
6060
}

myst_parser/inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def to_sphinx(inv: InventoryType) -> SphinxInventoryType:
8080
for domain_name, obj_types in inv["objects"].items():
8181
for obj_type, refs in obj_types.items():
8282
for refname, refdata in refs.items():
83-
objs.setdefault(f"{domain_name}:{obj_type}", {})[refname] = (
83+
objs.setdefault(f"{domain_name}:{obj_type}", {})[refname] = ( # type: ignore[assignment]
8484
inv["name"],
8585
inv["version"],
8686
refdata["loc"],

myst_parser/sphinx_ext/main.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from typing import Any
44

5-
import sphinx
65
from docutils import nodes
76
from sphinx.application import Sphinx
87
from sphinx.transforms import (
@@ -12,9 +11,7 @@
1211
from myst_parser.mdit_to_docutils.transforms import UnreferencedFootnotesDetector
1312
from myst_parser.parsers.docutils_ import (
1413
depart_container_html,
15-
depart_rubric_html,
1614
visit_container_html,
17-
visit_rubric_html,
1815
)
1916
from myst_parser.warnings_ import MystWarnings
2017

@@ -51,13 +48,6 @@ def setup_sphinx(app: Sphinx, load_parser: bool = False) -> None:
5148

5249
app.add_post_transform(MystReferenceResolver)
5350

54-
# override only the html writer visit methods for rubric, to use the "level" attribute
55-
# this allows for nested headers to be correctly rendered
56-
if sphinx.version_info < (7, 4):
57-
# This is now added in sphinx: https://github.com/sphinx-doc/sphinx/pull/12506
58-
app.add_node(
59-
nodes.rubric, override=True, html=(visit_rubric_html, depart_rubric_html)
60-
)
6151
# override only the html writer visit methods for container,
6252
# to remove the "container" class for divs
6353
# this avoids CSS clashes with the bootstrap theme

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ classifiers = [
1515
"License :: OSI Approved :: MIT License",
1616
"Programming Language :: Python :: 3",
1717
"Programming Language :: Python :: 3 :: Only",
18-
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
2019
"Programming Language :: Python :: 3.12",
2120
"Programming Language :: Python :: 3.13",
@@ -32,14 +31,14 @@ keywords = [
3231
"docutils",
3332
"sphinx",
3433
]
35-
requires-python = ">=3.10"
34+
requires-python = ">=3.11"
3635
dependencies = [
3736
"docutils>=0.19,<0.22",
3837
"jinja2", # required for substitutions, but let sphinx choose version
3938
"markdown-it-py~=3.0",
4039
"mdit-py-plugins~=0.4,>=0.4.1",
4140
"pyyaml",
42-
"sphinx>=7,<9",
41+
"sphinx>=8,<9",
4342
]
4443

4544
[project.urls]
@@ -52,7 +51,7 @@ code_style = ["pre-commit~=4.0"]
5251
linkify = ["linkify-it-py~=2.0"]
5352
# Note: This is only required for internal use
5453
rtd = [
55-
"sphinx>=7",
54+
"sphinx>=8",
5655
"ipython",
5756
"sphinx-book-theme~=1.1",
5857
"sphinx-design",

tests/test_renderers/fixtures/sphinx_directives.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ object (`sphinx.directives.ObjectDescription`):
2121
.
2222
<document source="<src>/index.md">
2323
<index entries="">
24-
<desc classes="object" desctype="object" domain="" nocontentsentry="False" noindex="False" noindexentry="False" objtype="object">
24+
<desc classes="object" desctype="object" domain="" no-contents-entry="False" no-index="False" no-index-entry="False" no-typesetting="False" nocontentsentry="False" noindex="False" noindexentry="False" objtype="object">
2525
<desc_signature _toc_name="" _toc_parts="()" classes="sig sig-object">
2626
<desc_name classes="sig-name descname" xml:space="preserve">
2727
something
@@ -323,7 +323,7 @@ math (`sphinx.directives.patches.MathDirective`):
323323
```
324324
.
325325
<document source="<src>/index.md">
326-
<math_block docname="index" label="True" nowrap="False" number="True" xml:space="preserve">
326+
<math_block docname="index" label="True" no-wrap="False" nowrap="False" number="True" xml:space="preserve">
327327
.
328328

329329
deprecated (`sphinx.domains.changeset.VersionChange`):
@@ -347,7 +347,7 @@ versionadded (`sphinx.domains.changeset.VersionChange`):
347347
<versionmodified type="versionadded" version="0.2">
348348
<paragraph translatable="False">
349349
<inline classes="versionmodified added">
350-
New in version 0.2.
350+
Added in version 0.2.
351351
.
352352

353353
versionchanged (`sphinx.domains.changeset.VersionChange`):
@@ -372,7 +372,7 @@ term 2 : B
372372
```
373373
.
374374
<document source="<src>/index.md">
375-
<glossary>
375+
<glossary sorted="False">
376376
<definition_list classes="glossary">
377377
<definition_list_item>
378378
<term ids="term-term-1">
@@ -404,7 +404,7 @@ cmdoption (`sphinx.domains.std.Cmdoption`):
404404
.
405405
<document source="<src>/index.md">
406406
<index entries="('pair',\ 'command\ line\ option;\ a',\ 'cmdoption-arg-a',\ '',\ None)">
407-
<desc classes="std cmdoption" desctype="cmdoption" domain="std" nocontentsentry="False" noindex="False" noindexentry="False" objtype="cmdoption">
407+
<desc classes="std cmdoption" desctype="cmdoption" domain="std" no-contents-entry="False" no-index="False" no-index-entry="False" no-typesetting="False" nocontentsentry="False" noindex="False" noindexentry="False" objtype="cmdoption">
408408
<desc_signature _toc_name="" _toc_parts="()" allnames="a" classes="sig sig-object" ids="cmdoption-arg-a">
409409
<desc_name classes="sig-name descname" xml:space="preserve">
410410
a
@@ -419,7 +419,7 @@ rst:directive (`sphinx.domains.rst.ReSTDirective`):
419419
.
420420
<document source="<src>/index.md">
421421
<index entries="('single',\ 'a\ (directive)',\ 'directive-a',\ '',\ None)">
422-
<desc classes="rst directive" desctype="directive" domain="rst" nocontentsentry="False" noindex="False" noindexentry="False" objtype="directive">
422+
<desc classes="rst directive" desctype="directive" domain="rst" no-contents-entry="False" no-index="False" no-index-entry="False" no-typesetting="False" nocontentsentry="False" noindex="False" noindexentry="False" objtype="directive">
423423
<desc_signature _toc_name=".. a::" _toc_parts="('a',)" classes="sig sig-object" fullname="a" ids="directive-a">
424424
<desc_name classes="sig-name descname" xml:space="preserve">
425425
.. a::

tests/test_renderers/test_fixtures_sphinx.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -96,33 +96,9 @@ def test_sphinx_directives(
9696

9797
sphinx_doctree_no_tr.set_conf({"extensions": ["myst_parser"]})
9898
pformat = sphinx_doctree_no_tr(file_params.content, "index.md").pformat("index")
99-
# see https://github.com/sphinx-doc/sphinx/issues/9827
100-
pformat = pformat.replace('<glossary sorted="False">', "<glossary>")
10199
# see https://github.com/executablebooks/MyST-Parser/issues/522
102100
if sys.maxsize == 2147483647:
103101
pformat = pformat.replace('"2147483647"', '"9223372036854775807"')
104-
# changed in sphinx 7.1 (but fixed in 7.2)
105-
pformat = pformat.replace(
106-
'classes="sig sig-object sig sig-object"', 'classes="sig sig-object"'
107-
)
108-
pformat = pformat.replace(
109-
'classes="sig-name descname sig-name descname"', 'classes="sig-name descname"'
110-
)
111-
pformat = pformat.replace(
112-
'classes="sig-prename descclassname sig-prename descclassname"',
113-
'classes="sig-prename descclassname"',
114-
)
115-
# changed in sphinx 7.2 (#11533)
116-
pformat = pformat.replace(
117-
(
118-
'no-contents-entry="False" no-index="False" '
119-
'no-index-entry="False" no-typesetting="False" '
120-
),
121-
"",
122-
)
123-
# changed in sphinx 7.3
124-
pformat = pformat.replace("Added in version 0.2", "New in version 0.2")
125-
126102
file_params.assert_expected(pformat, rstrip_lines=True)
127103

128104

0 commit comments

Comments
 (0)