Skip to content

Commit

Permalink
⬆️ Update docutils requirement from >=0.16,<0.21 to >=0.18,<0.22 (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Apr 23, 2024
1 parent c00ef09 commit 167c902
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ jobs:
strategy:
fail-fast: false
matrix:
docutils-version: ["0.17", "0.18", "0.19", "0.20"]
docutils-version: ["0.18", "0.19", "0.20", "0.21"]

steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- name: Install setup
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 1 addition & 9 deletions myst_parser/mdit_to_docutils/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1918,19 +1918,11 @@ def html_meta_to_nodes(
if not data:
return []

try:
meta_cls = nodes.meta
except AttributeError:
# docutils-0.17 or older
from docutils.parsers.rst.directives.html import MetaBody

meta_cls = MetaBody.meta

output = []

for key, value in data.items():
content = str(value or "")
meta_node = meta_cls(content)
meta_node = nodes.meta(content)
meta_node.source = document["source"]
meta_node.line = line
meta_node["content"] = content
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ keywords = [
]
requires-python = ">=3.8"
dependencies = [
"docutils>=0.16,<0.21",
"docutils>=0.18,<0.22",
"jinja2", # required for substitutions, but let sphinx choose version
"markdown-it-py~=3.0",
"mdit-py-plugins~=0.4",
Expand Down
5 changes: 0 additions & 5 deletions tests/test_sphinx/test_sphinx_builds.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
"""Uses sphinx's pytest fixture to run builds.
see conftest.py for fixture usage
NOTE: sphinx 3 & 4 regress against different output files,
the major difference being sphinx 4 uses docutils 0.17,
which uses semantic HTML tags
(e.g. converting `<div class="section">` to `<section>`)
"""

from __future__ import annotations
Expand Down

0 comments on commit 167c902

Please sign in to comment.