-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add types and fix google docstrings to agree
- Loading branch information
Showing
35 changed files
with
1,076 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
include *.md | ||
include *.py | ||
include *.toml | ||
include run_doctests.sh | ||
include *.txt | ||
include LICENSE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from _typeshed import Incomplete | ||
|
||
|
||
def main(argv: Incomplete | None = ...): | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
from _typeshed import Incomplete | ||
|
||
unicode_literal_re: Incomplete | ||
bytes_literal_re: Incomplete | ||
BLANKLINE_MARKER: str | ||
ELLIPSIS_MARKER: str | ||
TRAILING_WS: Incomplete | ||
|
||
|
||
def check_got_vs_want(want: str, | ||
got_stdout: str, | ||
got_eval: str = ..., | ||
runstate: Incomplete | None = ...): | ||
... | ||
|
||
|
||
def extract_exc_want(want): | ||
... | ||
|
||
|
||
def check_exception(exc_got, want, runstate: Incomplete | None = ...): | ||
... | ||
|
||
|
||
def check_output(got, want, runstate: Incomplete | None = ...): | ||
... | ||
|
||
|
||
def normalize(got, want, runstate: Incomplete | None = ...): | ||
... | ||
|
||
|
||
class ExtractGotReprException(AssertionError): | ||
orig_ex: Incomplete | ||
|
||
def __init__(self, msg, orig_ex) -> None: | ||
... | ||
|
||
|
||
class GotWantException(AssertionError): | ||
got: Incomplete | ||
want: Incomplete | ||
|
||
def __init__(self, msg, got, want) -> None: | ||
... | ||
|
||
def output_difference(self, | ||
runstate: Incomplete | None = ..., | ||
colored: bool = ...): | ||
... | ||
|
||
def output_repr_difference(self, runstate: Incomplete | None = ...): | ||
... | ||
|
||
|
||
def remove_blankline_marker(text): | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from _typeshed import Incomplete | ||
|
||
|
||
class _NOT_EVAL_TYPE: | ||
|
||
def __new__(cls): | ||
... | ||
|
||
def __reduce__(self): | ||
... | ||
|
||
def __copy__(self): | ||
... | ||
|
||
def __deepcopy__(self, memo): | ||
... | ||
|
||
def __call__(self, default) -> None: | ||
... | ||
|
||
def __bool__(self): | ||
... | ||
|
||
__nonzero__: Incomplete | ||
|
||
|
||
NOT_EVALED: Incomplete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from typing import Union | ||
from os import PathLike | ||
import xdoctest | ||
from types import ModuleType | ||
from typing import List | ||
from typing import Dict | ||
from _typeshed import Incomplete | ||
from collections.abc import Generator | ||
from typing import Any | ||
|
||
DOCTEST_STYLES: Incomplete | ||
|
||
|
||
def parse_freeform_docstr_examples( | ||
docstr: str, | ||
callname: str = None, | ||
modpath: Union[str, PathLike] = None, | ||
lineno: int = 1, | ||
fpath: Union[str, PathLike] = None, | ||
asone: bool = True | ||
) -> Generator[xdoctest.doctest_example.DocTest, None, Any]: | ||
... | ||
|
||
|
||
def parse_google_docstr_examples( | ||
docstr: str, | ||
callname: str = None, | ||
modpath: Union[str, PathLike] = None, | ||
lineno: int = 1, | ||
fpath: Union[str, PathLike] = None, | ||
eager_parse: bool = True | ||
) -> Generator[xdoctest.doctest_example.DocTest, None, None]: | ||
... | ||
|
||
|
||
def parse_auto_docstr_examples(docstr, *args, | ||
**kwargs) -> Generator[Any, None, None]: | ||
... | ||
|
||
|
||
def parse_docstr_examples( | ||
docstr: str, | ||
callname: str = None, | ||
modpath: Union[str, PathLike] = None, | ||
lineno: int = 1, | ||
style: str = 'auto', | ||
fpath: Union[str, PathLike] = None, | ||
parser_kw: dict = ... | ||
) -> Generator[xdoctest.doctest_example.DocTest, None, None]: | ||
... | ||
|
||
|
||
def package_calldefs(pkg_identifier: Union[str, ModuleType], | ||
exclude: List[str] = ..., | ||
ignore_syntax_errors: bool = True, | ||
analysis: str = 'auto') -> Generator[None, None, None]: | ||
... | ||
|
||
|
||
def parse_calldefs( | ||
module_identifier: Union[str, ModuleType], | ||
analysis: str = 'auto' | ||
) -> Dict[str, xdoctest.static_analysis.CallDefNode]: | ||
... | ||
|
||
|
||
def parse_doctestables( | ||
module_identifier: Union[str, PathLike, ModuleType], | ||
exclude: List[str] = ..., | ||
style: str = 'auto', | ||
ignore_syntax_errors: bool = True, | ||
parser_kw=..., | ||
analysis: str = 'auto' | ||
) -> Generator[xdoctest.doctest_example.DocTest, None, None]: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from _typeshed import Incomplete | ||
|
||
|
||
def myfunc(): | ||
... | ||
|
||
|
||
class MyClass: | ||
data: Incomplete | ||
|
||
def __init__(self, *args, **kw) -> None: | ||
... | ||
|
||
@classmethod | ||
def demo(cls, **kw): | ||
... | ||
|
||
@staticmethod | ||
def always_fails() -> None: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
from typing import List | ||
from typing import Dict | ||
from _typeshed import Incomplete | ||
from collections.abc import Generator | ||
from typing import NamedTuple | ||
from xdoctest import utils | ||
|
||
|
||
def named(key, pattern): | ||
... | ||
|
||
|
||
DEFAULT_RUNTIME_STATE: Incomplete | ||
|
||
|
||
class Effect(NamedTuple): | ||
action: Incomplete | ||
key: Incomplete | ||
value: Incomplete | ||
|
||
|
||
class RuntimeState(utils.NiceRepr): | ||
|
||
def __init__(self, default_state: Incomplete | None = ...) -> None: | ||
... | ||
|
||
def to_dict(self): | ||
... | ||
|
||
def __nice__(self): | ||
... | ||
|
||
def __getitem__(self, key): | ||
... | ||
|
||
def __setitem__(self, key, value) -> None: | ||
... | ||
|
||
def set_report_style(self, | ||
reportchoice, | ||
state: Incomplete | None = ...) -> None: | ||
... | ||
|
||
def update(self, directives: List[Directive]) -> None: | ||
... | ||
|
||
|
||
class Directive(utils.NiceRepr): | ||
name: Incomplete | ||
args: Incomplete | ||
inline: Incomplete | ||
positive: Incomplete | ||
|
||
def __init__(self, | ||
name, | ||
positive: bool = ..., | ||
args=..., | ||
inline: Incomplete | None = ...) -> None: | ||
... | ||
|
||
@classmethod | ||
def extract(cls, text: str) -> Generator[Directive, None, None]: | ||
... | ||
|
||
def __nice__(self): | ||
... | ||
|
||
def effect(self, | ||
argv: Incomplete | None = ..., | ||
environ: Incomplete | None = ...): | ||
... | ||
|
||
def effects(self, | ||
argv: List[str] = None, | ||
environ: Dict[str, str] = None) -> List[Effect]: | ||
... | ||
|
||
|
||
COMMANDS: Incomplete | ||
DIRECTIVE_PATTERNS: Incomplete | ||
DIRECTIVE_RE: Incomplete | ||
|
||
|
||
def parse_directive_optstr(optpart, | ||
inline: Incomplete | None = ...) -> Directive: | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.