Skip to content

Bump types-docutils from 0.21.0.20250525 to 0.21.0.20250604 #13634

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ lint = [
"sphinx-lint>=0.9",
"types-colorama==0.4.15.20240311",
"types-defusedxml==0.7.0.20250516",
"types-docutils==0.21.0.20250525",
"types-docutils==0.21.0.20250604",
"types-Pillow==10.2.0.20240822",
"types-Pygments==2.19.0.20250516",
"types-requests==2.32.4.20250611", # align with requests
Expand Down Expand Up @@ -167,7 +167,7 @@ type-stubs = [
# align with versions used elsewhere
"types-colorama==0.4.15.20240311",
"types-defusedxml==0.7.0.20250516",
"types-docutils==0.21.0.20250525",
"types-docutils==0.21.0.20250604",
"types-Pillow==10.2.0.20240822",
"types-Pygments==2.19.0.20250516",
"types-requests==2.32.4.20250611",
Expand Down
2 changes: 1 addition & 1 deletion sphinx/directives/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def _insert_input(include_lines: list[str], source: str) -> None:
# Only enable this patch if there are listeners for 'include-read'.
if self.env.events.listeners.get('include-read'):
# See https://github.com/python/mypy/issues/2427 for details on the mypy issue
self.state_machine.insert_input = _insert_input
self.state_machine.insert_input = _insert_input # type: ignore[method-assign]

if self.arguments[0].startswith('<') and self.arguments[0].endswith('>'):
# docutils "standard" includes, do not do path processing
Expand Down
7 changes: 4 additions & 3 deletions sphinx/directives/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from sphinx.util.osutil import SEP, relpath

if TYPE_CHECKING:
from collections.abc import Sequence
from typing import ClassVar

from docutils.nodes import Node
Expand All @@ -30,12 +31,12 @@
logger = logging.getLogger(__name__)


class Figure(images.Figure): # type: ignore[misc]
class Figure(images.Figure):
"""The figure directive which applies `:name:` option to the figure node
instead of the image node.
"""

def run(self) -> list[Node]:
def run(self) -> Sequence[Node]:
name = self.options.pop('name', None)
result = super().run()
if len(result) == 2 or isinstance(result[0], nodes.system_message):
Expand All @@ -56,7 +57,7 @@ def run(self) -> list[Node]:
return [figure_node]


class CSVTable(tables.CSVTable): # type: ignore[misc]
class CSVTable(tables.CSVTable):
"""The csv-table directive which searches a CSV file from Sphinx project's source
directory when an absolute path is given via :file: option.
"""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_util/test_util_docutils_sphinx_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
state_classes,
)
from docutils.statemachine import StringList
from docutils.utils import Reporter

from sphinx.util.docutils import SphinxDirective, new_document

Expand All @@ -26,7 +27,7 @@ def make_directive_and_state(
*, env: SimpleNamespace, input_lines: StringList | None = None
) -> tuple[RSTState, SphinxDirective]:
sm = RSTStateMachine(state_classes, initial_state='Body')
sm.reporter = object()
sm.reporter = Reporter(source='<tests>', report_level=0, halt_level=0)
if input_lines is not None:
sm.input_lines = input_lines
state = RSTState(sm)
Expand Down
Loading