Skip to content

Commit 167c902

Browse files
authored
⬆️ Update docutils requirement from >=0.16,<0.21 to >=0.18,<0.22 (#916)
1 parent c00ef09 commit 167c902

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ jobs:
7070
strategy:
7171
fail-fast: false
7272
matrix:
73-
docutils-version: ["0.17", "0.18", "0.19", "0.20"]
73+
docutils-version: ["0.18", "0.19", "0.20", "0.21"]
7474

7575
steps:
7676
- name: Checkout source
7777
uses: actions/checkout@v4
78-
- name: Set up Python 3.8
78+
- name: Set up Python 3.9
7979
uses: actions/setup-python@v5
8080
with:
81-
python-version: "3.8"
81+
python-version: "3.9"
8282
- name: Install setup
8383
run: |
8484
python -m pip install --upgrade pip

myst_parser/mdit_to_docutils/base.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,19 +1918,11 @@ def html_meta_to_nodes(
19181918
if not data:
19191919
return []
19201920

1921-
try:
1922-
meta_cls = nodes.meta
1923-
except AttributeError:
1924-
# docutils-0.17 or older
1925-
from docutils.parsers.rst.directives.html import MetaBody
1926-
1927-
meta_cls = MetaBody.meta
1928-
19291921
output = []
19301922

19311923
for key, value in data.items():
19321924
content = str(value or "")
1933-
meta_node = meta_cls(content)
1925+
meta_node = nodes.meta(content)
19341926
meta_node.source = document["source"]
19351927
meta_node.line = line
19361928
meta_node["content"] = content

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ keywords = [
3535
]
3636
requires-python = ">=3.8"
3737
dependencies = [
38-
"docutils>=0.16,<0.21",
38+
"docutils>=0.18,<0.22",
3939
"jinja2", # required for substitutions, but let sphinx choose version
4040
"markdown-it-py~=3.0",
4141
"mdit-py-plugins~=0.4",

tests/test_sphinx/test_sphinx_builds.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
"""Uses sphinx's pytest fixture to run builds.
22
33
see conftest.py for fixture usage
4-
5-
NOTE: sphinx 3 & 4 regress against different output files,
6-
the major difference being sphinx 4 uses docutils 0.17,
7-
which uses semantic HTML tags
8-
(e.g. converting `<div class="section">` to `<section>`)
94
"""
105

116
from __future__ import annotations

0 commit comments

Comments
 (0)