Skip to content

docutils - added missing stubs for __init__ methods #5924

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

Merged
merged 7 commits into from
Aug 14, 2021
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
2 changes: 0 additions & 2 deletions stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ docutils.TransformSpec.unknown_reference_resolvers
docutils.frontend.ConfigParser.__getattr__
docutils.frontend.ConfigParser.read
docutils.frontend.OptionParser.__getattr__
docutils.frontend.OptionParser.__init__
docutils.io.FileOutput.__getattr__
docutils.io.FileOutput.__init__
docutils.io.Input.__getattr__
docutils.io.Input.__init__
docutils.parsers.rst.Directive.__getattr__
docutils.parsers.rst.Directive.__init__
docutils.parsers.rst.nodes
2 changes: 1 addition & 1 deletion stubs/docutils/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.1"
version = "0.17"
12 changes: 11 additions & 1 deletion stubs/docutils/docutils/frontend.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import optparse
from collections.abc import Iterable, Mapping
from configparser import RawConfigParser
from typing import Any, ClassVar, Tuple
from typing import Any, ClassVar, Tuple, Type

from docutils import SettingsSpec
from docutils.parsers import Parser
from docutils.utils import DependencyList

__docformat__: str
Expand Down Expand Up @@ -60,6 +62,14 @@ class OptionParser(optparse.OptionParser, SettingsSpec):
default_error_encoding_error_handler: ClassVar[str]
config_section: ClassVar[str]
version_template: ClassVar[str]
def __init__(
self,
components: Iterable[Type[Parser]] = ...,
defaults: Mapping[str, Any] | None = ...,
read_config_files: bool | None = ...,
*args,
**kwargs,
) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete

class ConfigParser(RawConfigParser):
Expand Down
13 changes: 13 additions & 0 deletions stubs/docutils/docutils/parsers/rst/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ from typing import Any, ClassVar, Tuple
from typing_extensions import Literal

from docutils import parsers
from docutils.parsers.rst import states

class Parser(parsers.Parser):
config_section_dependencies: ClassVar[Tuple[str, ...]]
Expand All @@ -16,6 +17,18 @@ class DirectiveError(Exception):
def __init__(self, level: Any, message: str) -> None: ...

class Directive:
def __init__(
self,
name: str,
arguments: list[Any],
options: dict[str, Any],
content: list[str],
lineno: int,
content_offset: int,
block_text: str,
state: states.RSTState,
state_machine: states.RSTStateMachine,
) -> None: ...
def __getattr__(self, name: str) -> Any: ... # incomplete

def convert_directive_function(directive_fn): ...