adjust isort config (#4290)

Fixes #4288.

- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.

Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
This commit is contained in:
Jelle Zijlstra
2020-06-29 00:00:21 -07:00
committed by GitHub
parent cc8344b8c6
commit 0142a87da8
113 changed files with 112 additions and 234 deletions

View File

@@ -32,7 +32,6 @@ jobs:
- name: "black"
install: pip install $(grep black requirements-tests-py3.txt)
script: black --check --diff stdlib third_party
allow_failures:
- name: "isort"
install: pip install $(grep isort requirements-tests-py3.txt)
script: isort --check-only --diff --recursive stdlib third_party

View File

@@ -9,3 +9,5 @@ force_grid_wrap = 0
use_parentheses = true
combine_as_imports = true
line_length = 130
default_section = "THIRDPARTY"
known_standard_library = ["typing_extensions", "_typeshed", "_compression", "_markupbase", "opcode"]

View File

@@ -1,6 +1,5 @@
from typing import IO, Any, Dict, List, Optional, Sequence, Tuple, Union
from _typeshed import SupportsReadline
from typing import IO, Any, Dict, List, Optional, Sequence, Tuple, Union
DEFAULTSECT: str
MAX_INTERPOLATION_DEPTH: int

View File

@@ -2,6 +2,16 @@
# Python 3, and stub files conform to Python 3 syntax.
import sys
from _typeshed import (
AnyPath,
OpenBinaryMode,
OpenBinaryModeReading,
OpenBinaryModeUpdating,
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
SupportsWrite,
)
from abc import ABCMeta
from ast import AST, mod
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
@@ -46,20 +56,8 @@ from typing import (
ValuesView,
overload,
)
from typing_extensions import Literal
from _typeshed import (
AnyPath,
OpenBinaryMode,
OpenBinaryModeReading,
OpenBinaryModeUpdating,
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
SupportsWrite,
)
if sys.version_info >= (3,):
from typing import SupportsBytes, SupportsRound

View File

@@ -1,6 +1,5 @@
from typing import Any, Optional, Pattern
from _typeshed import AnyPath
from typing import Any, Optional, Pattern
# rx can be any object with a 'search' method; once we have Protocols we can change the type
def compile_dir(

View File

@@ -1,6 +1,5 @@
from typing import Any, Union
from _typeshed import FileDescriptorLike
from typing import Any, Union
FASYNC: int
FD_CLOEXEC: int

View File

@@ -1,6 +1,5 @@
from typing import IO, Any, Callable, Dict, List, Optional, Text, Tuple, Type, Union
from _typeshed import SupportsRead
from typing import IO, Any, Callable, Dict, List, Optional, Text, Tuple, Type, Union
class JSONDecodeError(ValueError):
def dumps(self, obj: Any) -> str: ...

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import AnyPath
from builtins import OSError as error
from io import TextIOWrapper as _TextIOWrapper
from posix import listdir as listdir, stat_result as stat_result # TODO: use this, see https://github.com/python/mypy/issues/3078
@@ -25,8 +26,6 @@ from typing import (
overload,
)
from _typeshed import AnyPath
from . import path as path
# We need to use something from path, or flake8 and pytype get unhappy

View File

@@ -1,11 +1,10 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
from _typeshed import AnyPath, BytesPath, StrPath
_T = TypeVar("_T")
if sys.version_info >= (3, 6):

View File

@@ -1,11 +1,10 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
from _typeshed import AnyPath, BytesPath, StrPath
_T = TypeVar("_T")
if sys.version_info >= (3, 6):

View File

@@ -16,7 +16,6 @@ import array
import mmap
import sys
from typing import Protocol, Text, TypeVar, Union
from typing_extensions import Literal
_T_co = TypeVar("_T_co", covariant=True)

View File

@@ -1,7 +1,6 @@
import sys
from types import TracebackType
from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Type, Union, overload
from typing_extensions import Literal
class Error(Exception): ...

View File

@@ -4,7 +4,6 @@
import sys
from typing import Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import FileDescriptorLike
from socket import SocketType
from typing import Any, Dict, Optional, Tuple, Union, overload
from _typeshed import FileDescriptorLike
# cyclic dependence with asynchat
_maptype = Dict[int, Any]

View File

@@ -2,6 +2,16 @@
# Python 3, and stub files conform to Python 3 syntax.
import sys
from _typeshed import (
AnyPath,
OpenBinaryMode,
OpenBinaryModeReading,
OpenBinaryModeUpdating,
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
SupportsWrite,
)
from abc import ABCMeta
from ast import AST, mod
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
@@ -46,20 +56,8 @@ from typing import (
ValuesView,
overload,
)
from typing_extensions import Literal
from _typeshed import (
AnyPath,
OpenBinaryMode,
OpenBinaryModeReading,
OpenBinaryModeUpdating,
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
SupportsWrite,
)
if sys.version_info >= (3,):
from typing import SupportsBytes, SupportsRound

View File

@@ -1,10 +1,8 @@
import io
import sys
from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath
from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
_PathOrFile = Union[AnyPath, IO[bytes]]
_T = TypeVar("_T")

View File

@@ -1,7 +1,6 @@
import sys
from typing import Any, Callable, Dict, Optional, TypeVar, Union
from _typeshed import AnyPath
from typing import Any, Callable, Dict, Optional, TypeVar, Union
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(

View File

@@ -1,8 +1,7 @@
from _typeshed import AnyPath
from types import FrameType, TracebackType
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type
from _typeshed import AnyPath
_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
def reset() -> str: ... # undocumented

View File

@@ -20,7 +20,6 @@ from typing import (
Union,
overload,
)
from typing_extensions import Literal
# TODO: this only satisfies the most common interface, where

View File

@@ -1,7 +1,6 @@
import sys
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union
from _typeshed import AnyPath
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union
if sys.version_info >= (3, 8):
def input(

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import SupportsRead, SupportsReadline
from socket import socket
from ssl import SSLContext
from types import TracebackType
@@ -20,8 +21,6 @@ from typing import (
Union,
)
from _typeshed import SupportsRead, SupportsReadline
_T = TypeVar("_T")
_IntOrStr = Union[int, Text]

View File

@@ -1,11 +1,10 @@
# Stubs for hmac
import sys
from _typeshed import ReadableBuffer
from types import ModuleType
from typing import Any, AnyStr, Callable, Optional, Union, overload
from _typeshed import ReadableBuffer
_B = Union[bytes, bytearray]
# TODO more precise type for object of hashlib

View File

@@ -4,7 +4,6 @@ import time
from socket import socket as _socket
from ssl import SSLContext, SSLSocket
from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Text, Tuple, Type, Union
from typing_extensions import Literal
# TODO: Commands should use their actual return types, not this type alias.

View File

@@ -1,10 +1,9 @@
from _typeshed import StrPath
from lib2to3.pgen2.grammar import Grammar
from lib2to3.pytree import _NL, _Convert
from logging import Logger
from typing import IO, Any, Iterable, Optional, Text
from _typeshed import StrPath
class Driver:
grammar: Grammar
logger: Logger

View File

@@ -1,6 +1,5 @@
from typing import Dict, List, Optional, Text, Tuple, TypeVar
from _typeshed import StrPath
from typing import Dict, List, Optional, Text, Tuple, TypeVar
_P = TypeVar("_P")
_Label = Tuple[int, Optional[Text]]

View File

@@ -1,9 +1,8 @@
from _typeshed import StrPath
from lib2to3.pgen2 import grammar
from lib2to3.pgen2.tokenize import _TokenInfo
from typing import IO, Any, Dict, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
from _typeshed import StrPath
class PgenGrammar(grammar.Grammar): ...
class ParserGenerator:

View File

@@ -1,5 +1,6 @@
import sys
import threading
from _typeshed import StrPath
from string import Template
from time import struct_time
from types import FrameType, TracebackType
@@ -20,8 +21,6 @@ from typing import (
overload,
)
from _typeshed import StrPath
_SysExcInfoType = Union[Tuple[type, BaseException, Optional[TracebackType]], Tuple[None, None, None]]
if sys.version_info >= (3, 5):
_ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException]

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import AnyPath, StrPath
from threading import Thread
from typing import IO, Any, Callable, Dict, Optional, Union
from _typeshed import AnyPath, StrPath
if sys.version_info >= (3,):
from configparser import RawConfigParser
else:

View File

@@ -1,12 +1,11 @@
import datetime
import ssl
import sys
from _typeshed import StrPath
from logging import FileHandler, Handler, LogRecord
from socket import SocketType
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload
from _typeshed import StrPath
if sys.version_info >= (3, 7):
from queue import SimpleQueue, Queue
elif sys.version_info >= (3,):

View File

@@ -3,9 +3,8 @@
import os
import sys
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload
from _typeshed import AnyPath, BytesPath, StrPath
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload
if sys.version_info < (3, 8):
_T = TypeVar("_T")

View File

@@ -1,4 +1,5 @@
import email
from _typeshed import AnyPath
from types import TracebackType
from typing import (
IO,
@@ -21,11 +22,8 @@ from typing import (
Union,
overload,
)
from typing_extensions import Literal
from _typeshed import AnyPath
_T = TypeVar("_T")
_MessageType = TypeVar("_MessageType", bound=Message)
_MessageData = Union[email.message.Message, bytes, str, IO[str], IO[bytes]]

View File

@@ -1,7 +1,6 @@
import sys
from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload
from _typeshed import ReadableBuffer
from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload
ACCESS_DEFAULT: int
ACCESS_READ: int

View File

@@ -1,7 +1,6 @@
import sys
from types import ModuleType
from typing import Any, Container, Dict, Iterable, List, Optional, Sequence, Set, Tuple, Type, Union
from typing_extensions import Literal
if sys.platform == "win32":

View File

@@ -1,11 +1,10 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
from _typeshed import AnyPath, BytesPath, StrPath
_T = TypeVar("_T")
if sys.version_info >= (3, 6):

View File

@@ -1,8 +1,7 @@
from _typeshed import AnyPath
from types import CodeType
from typing import Any, List, Sequence, Text, Tuple
from _typeshed import AnyPath
def expr(source: Text) -> STType: ...
def suite(source: Text) -> STType: ...
def sequence2st(sequence: Sequence[Any]) -> STType: ...

View File

@@ -1,11 +1,10 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
from _typeshed import AnyPath, BytesPath, StrPath
_T = TypeVar("_T")
if sys.version_info >= (3, 6):

View File

@@ -1,6 +1,5 @@
from typing import Any, Callable, Dict, Optional, TypeVar, Union
from _typeshed import AnyPath
from typing import Any, Callable, Dict, Optional, TypeVar, Union
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(

View File

@@ -1,9 +1,8 @@
from _typeshed import AnyPath
from cProfile import Profile as _cProfile
from profile import Profile
from typing import IO, Any, Dict, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload
from _typeshed import AnyPath
_Selector = Union[str, float, int]
_T = TypeVar("_T", bound=Stats)

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import SupportsWrite
from types import FunctionType, MethodType, ModuleType, TracebackType
from typing import (
IO,
@@ -18,8 +19,6 @@ from typing import (
Union,
)
from _typeshed import SupportsWrite
if sys.version_info >= (3,):
from reprlib import Repr
else:

View File

@@ -1,8 +1,7 @@
import pyexpat.errors as errors
import pyexpat.model as model
from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union
from _typeshed import SupportsRead
from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union
EXPAT_VERSION: str # undocumented
version_info: Tuple[int, int, int] # undocumented

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import FileDescriptorLike
from types import TracebackType
from typing import Any, Iterable, List, Optional, Tuple, Type
from _typeshed import FileDescriptorLike
if sys.platform != "win32":
PIPE_BUF: int
POLLERR: int

View File

@@ -1,5 +1,6 @@
import os
import sys
from _typeshed import StrPath, SupportsRead, SupportsWrite
from typing import (
Any,
AnyStr,
@@ -18,8 +19,6 @@ from typing import (
overload,
)
from _typeshed import StrPath, SupportsRead, SupportsWrite
if sys.version_info >= (3, 6):
_AnyStr = str
_AnyPath = TypeVar("_AnyPath", str, os.PathLike[str])

View File

@@ -1,7 +1,6 @@
import sys
from typing import NamedTuple, Optional, Tuple, Union
from _typeshed import AnyPath
from typing import NamedTuple, Optional, Tuple, Union
if sys.version_info >= (3, 5):
class SndHeaders(NamedTuple):

View File

@@ -16,7 +16,6 @@ CPython C source: https://github.com/python/cpython/blob/master/Modules/socketmo
# adapted for Python 2.7 by Michal Pokorny
import sys
from typing import Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
# ----- Constants -----

View File

@@ -1,11 +1,9 @@
import enum
import socket
import sys
from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Type, Union, overload
from typing_extensions import Literal
from _typeshed import StrPath
from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Type, Union, overload
from typing_extensions import Literal
_PCTRTT = Tuple[Tuple[str, str], ...]
_PCTRTTT = Tuple[_PCTRTT, ...]

View File

@@ -1,6 +1,5 @@
from typing import Iterable, Tuple
from _typeshed import AnyPath
from typing import Iterable, Tuple
verbose: int
filename_only: int

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import AnyPath
from types import TracebackType
from typing import IO, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Set, Tuple, Type, Union
from _typeshed import AnyPath
# tar constants
NUL: bytes
BLOCKSIZE: int

View File

@@ -1,6 +1,5 @@
from typing import List, Union
from _typeshed import FileDescriptorLike
from typing import List, Union
_Attr = List[Union[int, List[bytes]]]

View File

@@ -1,7 +1,6 @@
import types
from typing import Any, Callable, Mapping, Optional, Sequence, Tuple, TypeVar, Union
from _typeshed import StrPath
from typing import Any, Callable, Mapping, Optional, Sequence, Tuple, TypeVar, Union
_T = TypeVar("_T")
_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]]

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import SupportsWrite
from types import FrameType, TracebackType
from typing import IO, Any, Dict, Generator, Iterable, Iterator, List, Mapping, Optional, Tuple, Type
from _typeshed import SupportsWrite
_PT = Tuple[str, int, str, Optional[str]]
def print_tb(tb: Optional[TracebackType], limit: Optional[int] = ..., file: Optional[IO[str]] = ...) -> None: ...

View File

@@ -1,7 +1,6 @@
import sys
from types import ModuleType, TracebackType
from typing import Any, List, NamedTuple, Optional, TextIO, Type, Union, overload
from typing_extensions import Literal
from _warnings import warn as warn, warn_explicit as warn_explicit

View File

@@ -1,6 +1,5 @@
import sys
from typing import Optional, Union, overload
from typing_extensions import Literal
if sys.platform == "win32":

View File

@@ -1,7 +1,6 @@
import sys
from typing import Any, Callable, Iterable, Iterator, NoReturn, Optional
from _typeshed.wsgi import ErrorStream, InputStream, WSGIApplication
from typing import Any, Callable, Iterable, Iterator, NoReturn, Optional
class WSGIWarning(Warning): ...

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import AnyPath, FileDescriptor, SupportsWrite
from typing import (
IO,
Any,
@@ -19,11 +20,8 @@ from typing import (
Union,
overload,
)
from typing_extensions import Literal
from _typeshed import AnyPath, FileDescriptor, SupportsWrite
VERSION: str
class ParseError(SyntaxError):

View File

@@ -1,11 +1,10 @@
import sys
from _typeshed import SupportsWrite
from codecs import StreamReaderWriter, StreamWriter
from io import RawIOBase, TextIOBase
from typing import Mapping, Optional, Text, TextIO, Union
from xml.sax import handler, xmlreader
from _typeshed import SupportsWrite
def escape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ...
def unescape(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ...
def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ...

View File

@@ -1,5 +1,6 @@
import io
import sys
from _typeshed import StrPath
from types import TracebackType
from typing import (
IO,
@@ -19,8 +20,6 @@ from typing import (
Union,
)
from _typeshed import StrPath
_SZI = Union[Text, ZipInfo]
_DT = Tuple[int, int, int, int, int, int]

View File

@@ -1,5 +1,4 @@
from typing import ClassVar, Iterable, NoReturn, Optional
from typing_extensions import Literal
class Quitter:

View File

@@ -1,6 +1,5 @@
import sys
from typing import Any, Dict, NoReturn, Optional, Sequence, Tuple, Union, overload
from typing_extensions import Literal
CREATE_NEW_CONSOLE: int

View File

@@ -9,7 +9,6 @@
import sys
import typing as _typing
from typing import Any, Iterator, Optional, TypeVar, Union, overload
from typing_extensions import Literal
from _ast import * # type: ignore

View File

@@ -1,5 +1,6 @@
import ssl
import sys
from _typeshed import FileDescriptorLike
from abc import ABCMeta
from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle
from asyncio.futures import Future
@@ -8,11 +9,8 @@ from asyncio.tasks import Task
from asyncio.transports import BaseTransport
from socket import _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import FileDescriptorLike
if sys.version_info >= (3, 7):
from contextvars import Context

View File

@@ -1,6 +1,5 @@
import contextvars
from typing import Callable, List, Sequence, Tuple
from typing_extensions import Literal
from . import futures

View File

@@ -1,8 +1,7 @@
from _typeshed import AnyPath
from types import FrameType
from typing import List, Optional
from _typeshed import AnyPath
from . import tasks
def _task_repr_info(task: tasks.Task) -> List[str]: ... # undocumented

View File

@@ -1,5 +1,6 @@
import ssl
import sys
from _typeshed import FileDescriptorLike
from abc import ABCMeta, abstractmethod
from asyncio.futures import Future
from asyncio.protocols import BaseProtocol
@@ -9,8 +10,6 @@ from asyncio.unix_events import AbstractChildWatcher
from socket import _Address, _RetAddress, socket
from typing import IO, Any, Awaitable, Callable, Dict, Generator, List, Optional, Sequence, Tuple, TypeVar, Union, overload
from _typeshed import FileDescriptorLike
if sys.version_info >= (3, 7):
from contextvars import Context

View File

@@ -1,6 +1,5 @@
from socket import socket
from typing import Any, Mapping, Optional
from typing_extensions import Literal
from . import base_events, constants, events, futures, streams, transports

View File

@@ -1,7 +1,6 @@
import ssl
import sys
from typing import Any, Callable, ClassVar, Deque, Dict, List, Optional, Tuple
from typing_extensions import Literal
from . import constants, events, futures, protocols, transports

View File

@@ -17,7 +17,6 @@ from typing import (
Union,
overload,
)
from typing_extensions import Literal
from .events import AbstractEventLoop

View File

@@ -1,7 +1,6 @@
import sys
from typing import Any, Optional, Pattern
from _typeshed import AnyPath
from typing import Any, Optional, Pattern
if sys.version_info < (3, 6):
_SuccessType = bool

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import AnyPath, StrPath
from typing import (
IO,
AbstractSet,
@@ -21,8 +22,6 @@ from typing import (
overload,
)
from _typeshed import AnyPath, StrPath
# Internal type aliases
_section = Mapping[str, str]
_parser = MutableMapping[str, _section]

View File

@@ -1,7 +1,6 @@
import sys
from types import TracebackType
from typing import Iterator, MutableMapping, Optional, Type, Union
from typing_extensions import Literal
_KeyType = Union[str, bytes]

View File

@@ -1,5 +1,4 @@
import sys
from _typeshed import FileDescriptorLike
def cancel_dump_traceback_later() -> None: ...

View File

@@ -1,10 +1,8 @@
from _typeshed import FileDescriptorLike
from array import array
from typing import Any, Union, overload
from typing_extensions import Literal
from _typeshed import FileDescriptorLike
FASYNC: int
FD_CLOEXEC: int
DN_ACCESS: int

View File

@@ -1,9 +1,7 @@
import sys
from typing import IO, Any, Container, Iterable, Optional, Sequence, Type, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import StrPath
from typing import IO, Any, Container, Iterable, Optional, Sequence, Type, TypeVar, Union, overload
from typing_extensions import Literal
class NullTranslations:
def __init__(self, fp: Optional[IO[str]] = ...) -> None: ...

View File

@@ -1,11 +1,9 @@
import _compression
import sys
import zlib
from typing import IO, Optional, TextIO, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath, ReadableBuffer
from typing import IO, Optional, TextIO, Union, overload
from typing_extensions import Literal
_OpenBinaryMode = Literal["r", "rb", "a", "ab", "w", "wb", "x", "xb"]
_OpenTextMode = Literal["rt", "at", "wt", "xt"]

View File

@@ -1,9 +1,8 @@
# Stubs for hashlib
import sys
from typing import AbstractSet, Optional, Union
from _typeshed import ReadableBuffer
from typing import AbstractSet, Optional, Union
class _Hash(object):
digest_size: int

View File

@@ -1,6 +1,5 @@
import sys
from enum import IntEnum
from typing_extensions import Literal
class HTTPStatus(IntEnum):

View File

@@ -1,6 +1,7 @@
import os
import sys
import types
from _typeshed import StrPath
from typing import IO, Any, List, Optional, Tuple, TypeVar, Union
from _imp import (
@@ -14,7 +15,6 @@ from _imp import (
lock_held as lock_held,
release_lock as release_lock,
)
from _typeshed import StrPath
_T = TypeVar("_T")

View File

@@ -1,12 +1,11 @@
import builtins
import codecs
import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from mmap import mmap
from types import TracebackType
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, List, Optional, TextIO, Tuple, Type, TypeVar, Union
from _typeshed import ReadableBuffer, WriteableBuffer
DEFAULT_BUFFER_SIZE: int
SEEK_SET: int

View File

@@ -1,7 +1,6 @@
import sys
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type, Union
from _typeshed import SupportsRead
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type, Union
from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder
from .encoder import JSONEncoder as JSONEncoder

View File

@@ -1,9 +1,7 @@
import io
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath, ReadableBuffer
from typing import IO, Any, Mapping, Optional, Sequence, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
_OpenTextWritingMode = Literal["wt", "xt", "at"]

View File

@@ -1,7 +1,7 @@
import sys
from ctypes import _CData
from logging import Logger
from multiprocessing import connection, pool, sharedctypes, spawn, synchronize, queues
from multiprocessing import connection, pool, queues, sharedctypes, spawn, synchronize
from multiprocessing.context import (
AuthenticationError as AuthenticationError,
BaseContext,
@@ -16,7 +16,6 @@ from multiprocessing.managers import SyncManager
from multiprocessing.process import active_children as active_children, current_process as current_process
from multiprocessing.spawn import freeze_support as freeze_support
from typing import Any, Callable, Iterable, List, Optional, Sequence, Tuple, Type, Union, overload
from typing_extensions import Literal
if sys.version_info >= (3, 8):

View File

@@ -4,7 +4,6 @@ from logging import Logger
from multiprocessing import queues, sharedctypes, synchronize
from multiprocessing.process import BaseProcess
from typing import Any, Callable, Iterable, List, Optional, Sequence, Type, Union, overload
from typing_extensions import Literal
_LockLike = Union[synchronize.Lock, synchronize.RLock]

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import AnyPath
from builtins import OSError as error
from io import TextIOWrapper as _TextIOWrapper
from posix import listdir as listdir, times_result
@@ -25,8 +26,6 @@ from typing import (
overload,
)
from _typeshed import AnyPath
from . import path as path
# We need to use something from path, or flake8 and pytype get unhappy

View File

@@ -1,11 +1,10 @@
# NB: path.pyi and stdlib/2 and stdlib/3 must remain consistent!
import os
import sys
from _typeshed import AnyPath, BytesPath, StrPath
from genericpath import exists as exists
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, overload
from _typeshed import AnyPath, BytesPath, StrPath
_T = TypeVar("_T")
if sys.version_info >= (3, 6):

View File

@@ -1,10 +1,9 @@
import os
import sys
from _typeshed import OpenBinaryMode, OpenTextMode
from types import TracebackType
from typing import IO, Any, BinaryIO, Generator, List, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union, overload
from _typeshed import OpenBinaryMode, OpenTextMode
_P = TypeVar("_P", bound=PurePath)
if sys.version_info >= (3, 6):

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import FileDescriptor, FileDescriptorLike
from abc import ABCMeta, abstractmethod
from typing import Any, List, Mapping, NamedTuple, Optional, Tuple
from _typeshed import FileDescriptor, FileDescriptorLike
_EventMask = int
EVENT_READ: _EventMask

View File

@@ -1,11 +1,9 @@
import sys
from _typeshed import AnyPath
from types import TracebackType
from typing import IO, Any, AnyStr, Callable, Generic, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath
# We prefer to annotate inputs to methods (eg subprocess.check_call) with these
# union types.
# For outputs we use laborious literal based overloads to try to determine

View File

@@ -2,7 +2,6 @@ import os
import sys
from types import TracebackType
from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List, Optional, Tuple, Type, TypeVar, Union, overload
from typing_extensions import Literal
# global variables

View File

@@ -1,9 +1,8 @@
import sys
from _typeshed import AnyPath
from types import SimpleNamespace
from typing import Optional, Sequence
from _typeshed import AnyPath
class EnvBuilder:
system_site_packages: bool
clear: bool

View File

@@ -3,14 +3,12 @@ import http.client
import io
import sys
import time
from _typeshed import SupportsRead, SupportsWrite
from datetime import datetime
from types import TracebackType
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Protocol, Tuple, Type, Union, overload
from typing_extensions import Literal
from _typeshed import SupportsRead, SupportsWrite
class _SupportsTimeTuple(Protocol):
def timetuple(self) -> time.struct_time: ...

View File

@@ -1,10 +1,9 @@
import os
import sys
from _typeshed import OpenBinaryMode, OpenTextMode
from types import TracebackType
from typing import IO, Any, BinaryIO, Generator, List, Optional, Sequence, TextIO, Tuple, Type, TypeVar, Union, overload
from _typeshed import OpenBinaryMode, OpenTextMode
_P = TypeVar("_P", bound=PurePath)
if sys.version_info >= (3, 6):

View File

@@ -1,7 +1,6 @@
import sys
from typing import IO, Any, AnyStr, Callable, ContextManager, Generic, Optional, Text, Type, Union
from _typeshed import AnyPath
from typing import IO, Any, AnyStr, Callable, ContextManager, Generic, Optional, Text, Type, Union
def replace_atomic(src: AnyStr, dst: AnyStr) -> None: ...
def move_atomic(src: AnyStr, dst: AnyStr) -> None: ...

View File

@@ -1,7 +1,6 @@
import sys
from logging import Logger
from typing import Dict, Optional, Pattern
from typing_extensions import TypedDict
class _FinalResultType(TypedDict):

View File

@@ -1,5 +1,4 @@
from datetime import date
from typing_extensions import Literal
EASTER_JULIAN: Literal[1]

View File

@@ -6,7 +6,6 @@ from typing import IO, Any, Iterable, Mapping, Optional, Text, TypeVar, Union
from click import BaseCommand
from click.testing import CliRunner, Result
from werkzeug.test import Client
def make_test_environ_builder(

View File

@@ -1,8 +1,7 @@
from _typeshed import AnyPath
from typing import IO, Any, Callable, Iterable, Optional, Protocol, Text, TypeVar, Union
from typing_extensions import Literal
from _typeshed import AnyPath
from markupsafe import Markup as Markup, escape as escape, soft_unicode as soft_unicode
missing: Any

View File

@@ -1,8 +1,7 @@
import datetime
import sys
from typing import IO, Any, List, Mapping, MutableMapping, Optional, Text, Type, Union
from _typeshed import StrPath, SupportsWrite
from typing import IO, Any, List, Mapping, MutableMapping, Optional, Text, Type, Union
if sys.version_info >= (3, 6):
_PathLike = StrPath

View File

@@ -1,6 +1,5 @@
from typing import Any, Iterable, List, Mapping, Optional, Sequence, Set, Text
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import Any, Iterable, List, Mapping, Optional, Sequence, Set, Text
from ..middleware.proxy_fix import ProxyFix as ProxyFix

View File

@@ -1,6 +1,5 @@
from typing import AnyStr, Generic, Tuple
from _typeshed import SupportsWrite
from typing import AnyStr, Generic, Tuple
from ..middleware.profiler import *

View File

@@ -1,4 +1,5 @@
import collections
from _typeshed import SupportsWrite
from typing import (
IO,
Any,
@@ -21,8 +22,6 @@ from typing import (
overload,
)
from _typeshed import SupportsWrite
_K = TypeVar("_K")
_V = TypeVar("_V")
_R = TypeVar("_R")

View File

@@ -1,7 +1,7 @@
import datetime
from _typeshed.wsgi import StartResponse, WSGIEnvironment
from typing import Any, Dict, Iterable, List, NoReturn, Optional, Protocol, Text, Tuple, Type, Union
from _typeshed.wsgi import StartResponse, WSGIEnvironment
from werkzeug.wrappers import Response
class _EnvironContainer(Protocol):

Some files were not shown because too many files have changed in this diff Show More