Preparations for the Big Reformat (#4228)

A few comments between imports were removed or moved to the top of the
import block, due to behavioral differences between black and isort. See
psf/black#251 for details.

In two instances @overloads at the top of the file needed to be moved
due to psf/black#1490.
This commit is contained in:
Sebastian Rittau
2020-06-14 16:58:26 +02:00
committed by GitHub
parent 53431cab1d
commit 89d3a55f1a
12 changed files with 14 additions and 45 deletions

View File

@@ -1,5 +1,3 @@
# Stubs for six (Python 2.7)
from __future__ import print_function
import types
@@ -10,7 +8,6 @@ from typing import (
import typing
import unittest
# Exports
from __builtin__ import unichr as unichr
from StringIO import StringIO as StringIO, StringIO as BytesIO
from functools import wraps as wraps

View File

@@ -1,6 +1,6 @@
from typing import Any, Container, Iterable, Optional, Text
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker
from bleach.linkifier import DEFAULT_CALLBACKS as DEFAULT_CALLBACKS, Linker as Linker, _Callback
from bleach.sanitizer import (
ALLOWED_ATTRIBUTES as ALLOWED_ATTRIBUTES,
ALLOWED_PROTOCOLS as ALLOWED_PROTOCOLS,
@@ -9,7 +9,6 @@ from bleach.sanitizer import (
Cleaner as Cleaner,
)
from .linkifier import _Callback
__releasedate__: Text
__version__: Text

View File

@@ -1,8 +1,8 @@
from collections import OrderedDict
from typing import overload, Mapping, Any, Text
def force_unicode(text: Text) -> Text: ...
@overload
def alphabetize_attributes(attrs: None) -> None: ...
@overload
def alphabetize_attributes(attrs: Mapping[Any, Text]) -> OrderedDict[Any, Text]: ...
def force_unicode(text: Text) -> Text: ...

View File

@@ -1,13 +1,14 @@
import sys
from typing import Any
from six.moves import http_client
if sys.version_info >= (3,):
from base64 import encodebytes as encodebytes
else:
from base64 import encodestring as encodebytes
from six.moves import http_client
expanduser: Any
if sys.version_info >= (3, 0):

View File

@@ -14,7 +14,6 @@
:license: BSD, see LICENSE for more details.
"""
# Core classes
from .core import (
Context as Context,
BaseCommand as BaseCommand,
@@ -26,11 +25,7 @@ from .core import (
Option as Option,
Argument as Argument,
)
# Globals
from .globals import get_current_context as get_current_context
# Decorators
from .decorators import (
pass_context as pass_context,
pass_obj as pass_obj,
@@ -44,8 +39,6 @@ from .decorators import (
version_option as version_option,
help_option as help_option,
)
# Types
from .types import (
ParamType as ParamType,
File as File,
@@ -62,8 +55,6 @@ from .types import (
UUID as UUID,
UNPROCESSED as UNPROCESSED,
)
# Utilities
from .utils import (
echo as echo,
get_binary_stream as get_binary_stream,
@@ -73,8 +64,6 @@ from .utils import (
get_app_dir as get_app_dir,
get_os_args as get_os_args,
)
# Terminal functions
from .termui import (
prompt as prompt,
confirm as confirm,
@@ -90,8 +79,6 @@ from .termui import (
getchar as getchar,
pause as pause,
)
# Exceptions
from .exceptions import (
ClickException as ClickException,
UsageError as UsageError,
@@ -103,11 +90,7 @@ from .exceptions import (
BadArgumentUsage as BadArgumentUsage,
MissingParameter as MissingParameter,
)
# Formatting
from .formatting import HelpFormatter as HelpFormatter, wrap_text as wrap_text
# Parsing
from .parser import OptionParser as OptionParser
# Controls if click should emit the warning about the use of unicode

View File

@@ -1,5 +1,3 @@
# Stubs for six (Python 3.5)
from __future__ import print_function
from typing import (
@@ -26,7 +24,6 @@ import types
import typing
import unittest
# Exports
from io import StringIO as StringIO, BytesIO as BytesIO
from builtins import next as next
from functools import wraps as wraps