Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update docutils requirement from >=0.16,<0.21 to >=0.18,<0.22 #916

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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