[docutils] Add missing stubs for readers dir (#14242)

This commit is contained in:
Semyon Moroz
2025-07-07 17:18:48 +00:00
committed by GitHub
parent 402a217726
commit 22a5840d61
4 changed files with 31 additions and 6 deletions
+5 -2
View File
@@ -1,4 +1,4 @@
from typing import Any, ClassVar, Generic, TypeVar
from typing import Any, ClassVar, Final, Generic, TypeVar
from docutils import Component, nodes
from docutils.frontend import Values
@@ -8,6 +8,8 @@ from docutils.transforms import Transform
_S = TypeVar("_S")
__docformat__: Final = "reStructuredText"
class Reader(Component, Generic[_S]):
component_type: ClassVar[str]
config_section: ClassVar[str]
@@ -15,8 +17,9 @@ class Reader(Component, Generic[_S]):
def __init__(self, parser: Parser | None = None, parser_name: str | None = None) -> None: ...
parser: Parser | None
source: Input[_S] | None
input: str | Any | None
input: str | None
def set_parser(self, parser_name: str) -> None: ...
settings: Values
def read(self, source: Input[_S], parser: Parser, settings: Values) -> nodes.document: ...
document: nodes.document
def parse(self) -> None: ...
+3 -2
View File
@@ -1,7 +1,8 @@
from typing import TypeVar
from typing import ClassVar, TypeVar
from docutils import readers
_S = TypeVar("_S", bound=str | bytes)
class Reader(readers.ReReader[_S]): ...
class Reader(readers.ReReader[_S]):
config_section_dependencies: ClassVar[tuple[str, ...]]
+12 -1
View File
@@ -1 +1,12 @@
def __getattr__(name: str): ... # incomplete module
from typing import ClassVar, Final, TypeVar
from docutils.parsers.rst import states
from docutils.readers import standalone
__docformat__: Final = "reStructuredText"
_S = TypeVar("_S", bound=str | bytes)
class Reader(standalone.Reader[_S]):
settings_default_overrides: ClassVar[dict[str, int]]
inliner_class: ClassVar[type[states.Inliner]]
+11 -1
View File
@@ -1 +1,11 @@
def __getattr__(name: str): ... # incomplete module
from typing import ClassVar, Final, TypeVar
from docutils import readers
__docformat__: Final = "reStructuredText"
_S = TypeVar("_S", bound=str | bytes)
class Reader(readers.Reader[_S]):
document: None # type: ignore[assignment]
config_section_dependencies: ClassVar[tuple[str, ...]]