diff --git a/tests/pytype_blacklist.txt b/tests/pytype_blacklist.txt index 7f9e71331..cf01d3e00 100644 --- a/tests/pytype_blacklist.txt +++ b/tests/pytype_blacklist.txt @@ -20,30 +20,7 @@ third_party/2and3/attr/converters.pyi third_party/2and3/attr/filters.pyi third_party/2and3/attr/validators.pyi third_party/2and3/boto/utils.pyi -third_party/2and3/click/README.md -third_party/2and3/click/__init__.pyi -third_party/2and3/click/core.pyi -third_party/2and3/click/decorators.pyi -third_party/2and3/click/exceptions.pyi -third_party/2and3/click/formatting.pyi -third_party/2and3/click/globals.pyi -third_party/2and3/click/parser.pyi -third_party/2and3/click/termui.pyi -third_party/2and3/click/testing.pyi -third_party/2and3/click/types.pyi third_party/2and3/dateutil/rrule.pyi -third_party/2and3/flask/__init__.pyi -third_party/2and3/flask/app.pyi -third_party/2and3/flask/blueprints.pyi -third_party/2and3/flask/cli.pyi -third_party/2and3/flask/ctx.pyi -third_party/2and3/flask/debughelpers.pyi -third_party/2and3/flask/globals.pyi -third_party/2and3/flask/helpers.pyi -third_party/2and3/flask/logging.pyi -third_party/2and3/flask/templating.pyi -third_party/2and3/flask/testing.pyi -third_party/2and3/flask/views.pyi third_party/2and3/google/protobuf/any_pb2.pyi third_party/2and3/google/protobuf/any_test_pb2.pyi third_party/2and3/google/protobuf/api_pb2.pyi diff --git a/tests/pytype_test.py b/tests/pytype_test.py index 33b9aeeed..bb4793a20 100755 --- a/tests/pytype_test.py +++ b/tests/pytype_test.py @@ -172,7 +172,7 @@ def pytype_test(args): for root, _, filenames in itertools.chain.from_iterable( os.walk(p) for p in paths): - for f in sorted(filenames): + for f in sorted(f for f in filenames if f.endswith('.pyi')): f = os.path.join(root, f) rel = _get_relative(f) if not skipped.search(rel): diff --git a/third_party/2and3/click/README.md b/third_party/2and3/click/README.md index d7410e3fc..debe70142 100644 --- a/third_party/2and3/click/README.md +++ b/third_party/2and3/click/README.md @@ -1,7 +1,7 @@ # click 6.6, Python 3 -`__init__.pyi` is literally a copy of click/__init__.py. It's a shortcut module -anyway in the actual sources so it works well without additional changes. +`__init__.pyi` is almost a copy of `click/__init__.py`. It's a shortcut module +anyway in the actual sources so it works well with minimal changes. The types are pretty complete but they were created mostly for public API use so some internal modules (`_compat`) or functions (`core._bashcomplete`) are diff --git a/third_party/2and3/click/__init__.pyi b/third_party/2and3/click/__init__.pyi index 2ac61bef4..4733c6d0c 100644 --- a/third_party/2and3/click/__init__.pyi +++ b/third_party/2and3/click/__init__.pyi @@ -108,49 +108,9 @@ from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text # Parsing from .parser import OptionParser as OptionParser - -__all__ = [ - # Core classes - 'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group', - 'CommandCollection', 'Parameter', 'Option', 'Argument', - - # Globals - 'get_current_context', - - # Decorators - 'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group', - 'argument', 'option', 'confirmation_option', 'password_option', - 'version_option', 'help_option', - - # Types - 'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple', 'STRING', - 'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED', - - # Utilities - 'echo', 'get_binary_stream', 'get_text_stream', 'open_file', - 'format_filename', 'get_app_dir', 'get_os_args', - - # Terminal functions - 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager', - 'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch', - 'getchar', 'pause', - - # Exceptions - 'ClickException', 'UsageError', 'BadParameter', 'FileError', - 'Abort', 'NoSuchOption', 'BadOptionUsage', 'BadArgumentUsage', - 'MissingParameter', - - # Formatting - 'HelpFormatter', 'wrap_text', - - # Parsing - 'OptionParser', -] - - # Controls if click should emit the warning about the use of unicode # literals. -disable_unicode_literals_warning = False +disable_unicode_literals_warning: bool -__version__ = '6.6' +__version__: str diff --git a/third_party/2and3/click/core.pyi b/third_party/2and3/click/core.pyi index 73807c9da..6b8167937 100644 --- a/third_party/2and3/click/core.pyi +++ b/third_party/2and3/click/core.pyi @@ -1,7 +1,7 @@ -from contextlib import contextmanager from typing import ( Any, Callable, + ContextManager, Dict, Generator, Iterable, @@ -28,10 +28,9 @@ def invoke_param_callback( ... -@contextmanager def augment_usage_errors( ctx: Context, param: Optional[Parameter] = ... -) -> Generator[None, None, None]: +) -> ContextManager[None]: ... @@ -90,8 +89,7 @@ class Context: ) -> None: ... - @contextmanager - def scope(self, cleanup: bool = ...) -> Generator[Context, None, None]: + def scope(self, cleanup: bool = ...) -> ContextManager[Context]: ... def make_formatter(self) -> HelpFormatter: diff --git a/third_party/2and3/click/formatting.pyi b/third_party/2and3/click/formatting.pyi index f4fe249e2..bcd3048e9 100644 --- a/third_party/2and3/click/formatting.pyi +++ b/third_party/2and3/click/formatting.pyi @@ -1,5 +1,4 @@ -from contextlib import contextmanager -from typing import Generator, Iterable, List, Optional, Tuple +from typing import ContextManager, Generator, Iterable, List, Optional, Tuple FORCED_WIDTH: Optional[int] @@ -73,12 +72,10 @@ class HelpFormatter: ) -> None: ... - @contextmanager - def section(self, name) -> Generator[None, None, None]: + def section(self, name) -> ContextManager[None]: ... - @contextmanager - def indentation(self) -> Generator[None, None, None]: + def indentation(self) -> ContextManager[None]: ... def getvalue(self) -> str: diff --git a/third_party/2and3/click/types.pyi b/third_party/2and3/click/types.pyi index a21b28972..7f1e0ba8f 100644 --- a/third_party/2and3/click/types.pyi +++ b/third_party/2and3/click/types.pyi @@ -261,9 +261,9 @@ def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) - # parameter type shortcuts -BOOL = BoolParamType() -FLOAT = FloatParamType() -INT = IntParamType() -STRING = StringParamType() -UNPROCESSED = UnprocessedParamType() -UUID = UUIDParameterType() +BOOL: BoolParamType +FLOAT: FloatParamType +INT: IntParamType +STRING: StringParamType +UNPROCESSED: UnprocessedParamType +UUID: UUIDParameterType