Skip to content
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
1 change: 1 addition & 0 deletions stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ docutils.transforms.Transform.apply # method apply is not implemented
docutils.transforms.Transform.__getattr__
docutils.TransformSpec.unknown_reference_resolvers
docutils.writers.latex2e.PreambleCmds... contents
docutils.writers.latex2e.PreambleCmds.inline role \w+ # attribute names with spaces, set with setattr() from docutils.sty

# Files that don't exist at runtime of stubtests, raises ImportError:
docutils.parsers.commonmark_wrapper
Expand Down
2 changes: 1 addition & 1 deletion stubs/docutils/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "0.22.3"
version = "0.23"
upstream-repository = "https://sourceforge.net/p/docutils/code"
2 changes: 1 addition & 1 deletion stubs/docutils/docutils/frontend.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ class ConfigParser(RawConfigParser):

class ConfigDeprecationWarning(FutureWarning): ...

def get_default_settings(*components: SettingsSpec) -> Values: ...
def get_default_settings(*components: SettingsSpec | type[SettingsSpec]) -> Values: ...
36 changes: 29 additions & 7 deletions stubs/docutils/docutils/nodes.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
import xml.dom.minidom
from _typeshed import Incomplete
from _typeshed import Incomplete, StrPath
from abc import abstractmethod
from collections import Counter
from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Sequence
Expand Down Expand Up @@ -63,7 +63,12 @@ class Node:

@overload
def findall(
self, condition: type[_N], include_self: bool = True, descend: bool = True, siblings: bool = False, ascend: bool = False
self,
condition: type[_N] | tuple[type[_N], ...],
include_self: bool = True,
descend: bool = True,
siblings: bool = False,
ascend: bool = False,
) -> Generator[_N]: ...
@overload
def findall(
Expand All @@ -78,7 +83,12 @@ class Node:
@overload
@deprecated("The `nodes.Node.traverse()` is deprecated. Use `Node.findall()` instead.")
def traverse(
self, condition: type[_N], include_self: bool = True, descend: bool = True, siblings: bool = False, ascend: bool = False
self,
condition: type[_N] | tuple[type[_N], ...],
include_self: bool = True,
descend: bool = True,
siblings: bool = False,
ascend: bool = False,
) -> list[_N]: ...
@overload
@deprecated("The `nodes.Node.traverse()` is deprecated. Use `Node.findall()` instead.")
Expand All @@ -93,7 +103,12 @@ class Node:

@overload
def next_node(
self, condition: type[_N], include_self: bool = False, descend: bool = True, siblings: bool = False, ascend: bool = False
self,
condition: type[_N] | tuple[type[_N], ...],
include_self: bool = False,
descend: bool = True,
siblings: bool = False,
ascend: bool = False,
) -> _N | None: ...
@overload
def next_node(
Expand Down Expand Up @@ -309,6 +324,7 @@ class document(Root, Structural, Element):
substitution_names: dict[str, str]
refnames: dict[str, list[Element]]
refids: dict[str, list[Element]]
names: dict[str, Element | None]
nameids: dict[str, str]
nametypes: dict[str, bool]
ids: dict[str, Element]
Expand All @@ -322,17 +338,21 @@ class document(Root, Structural, Element):
citations: list[citation]
autofootnote_start: int
symbol_footnote_start: int
id_counter: Counter[int]
id_counter: Counter[str]
parse_messages: list[system_message]
transform_messages: list[system_message]
transformer: Transformer
include_log: list[tuple[StrPath, tuple[Incomplete, ...]]]
decoration: decoration | None
document: Self
def __init__(self, settings: Values, reporter: Reporter, *args: Node, **kwargs: Any) -> None: ...
def asdom(self, dom: Any | None = None) -> Any: ...
def set_id(self, node: Element, msgnode: Element | None = None, suggested_prefix: str = "") -> str: ...
def create_id(self, node: Element, suggested_prefix: str = "") -> str: ...
@deprecated("`nodes.document.set_name_id_map()` will be removed in Docutils 1.0.")
def set_name_id_map(self, node: Element, id: str, msgnode: Element | None = None, explicit: bool = False) -> None: ...
def set_duplicate_name_id(self, node: Element, id: str, name: str, msgnode: Element, explicit: bool) -> None: ...
def set_duplicate_name(self, node: Element, name: str, msgnode: Element, explicit: bool) -> None: ...
def note_names(self, node: Element, msgnode: Element | None = None, explicit: bool = False) -> None: ...
def has_name(self, name: str) -> bool: ...
def note_implicit_target(self, target: Element, msgnode: Element | None = None) -> None: ...
def note_explicit_target(self, target: Element, msgnode: Element | None = None) -> None: ...
Expand Down Expand Up @@ -395,7 +415,9 @@ class footer(Decorative, Element): ...
class section(Structural, Element): ...
class topic(Structural, Element): ...
class sidebar(Structural, Element): ...
class transition(Structural, Element): ...

class transition(Structural, Element):
ignored_siblings: ClassVar[tuple[type[Element], ...]]

# Body Elements
# ===============
Expand Down
3 changes: 0 additions & 3 deletions stubs/docutils/docutils/parsers/rst/directives/tables.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ class CSVTable(Table):
quoting: Incomplete
def __init__(self) -> None: ...

@staticmethod
@deprecated("Deprecated and not required with Python 3; will be removed in Docutils 0.22.")
def check_requirements() -> None: ...
def process_header_option(self): ...
def run(self) -> Sequence[nodes.table | nodes.system_message]: ...
def get_csv_data(self): ...
Expand Down
2 changes: 1 addition & 1 deletion stubs/docutils/docutils/parsers/rst/roles.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def raw_role(
content: Sequence[str] | None = None,
) -> tuple[list[Node], list[system_message]]: ...
def code_role(
role: str,
role_name: str,
rawtext: str,
text: str,
lineno: int,
Expand Down
1 change: 1 addition & 0 deletions stubs/docutils/docutils/transforms/misc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class Transitions(Transform):
default_priority: ClassVar[int]
def apply(self) -> None: ...
def visit_transition(self, node: nodes.transition) -> None: ...
def warn(self, msg: str, node: nodes.Node) -> None: ...
4 changes: 4 additions & 0 deletions stubs/docutils/docutils/transforms/references.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ from docutils.transforms import Transform

__docformat__: Final = "reStructuredText"

class SectionIDs(Transform):
default_priority: ClassVar[int]
def apply(self) -> None: ...

class PropagateTargets(Transform):
default_priority: ClassVar[int]
def apply(self) -> None: ...
Expand Down
1 change: 1 addition & 0 deletions stubs/docutils/docutils/writers/latex2e/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class PreambleCmds:
admonition: ClassVar[str]
fieldlist: ClassVar[str]
footnotes: ClassVar[str]
bracket_footnoterefs: ClassVar[str]
inline: ClassVar[str]
legend: ClassVar[str]
lineblock: ClassVar[str]
Expand Down