Restore stubtest 0.930 (#6663)

This commit is contained in:
Sebastian Rittau
2021-12-23 05:18:19 +01:00
committed by GitHub
parent 9bf2ceb963
commit 3fb2bcd4c1
51 changed files with 478 additions and 123 deletions

View File

@@ -34,10 +34,7 @@ jobs:
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: |
# Temporarily pin stubtest version
pip install mypy==0.921
pip install $(grep tomli== requirements-tests.txt) # $(grep mypy== requirements-tests.txt)
run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt)
- name: Run stubtest
run: python tests/stubtest_stdlib.py

View File

@@ -110,10 +110,7 @@ jobs:
- name: Update pip
run: python -m pip install -U pip
- name: Install dependencies
run: |
# Temporarily pin stubtest version
pip install mypy==0.921
pip install $(grep tomli== requirements-tests.txt) # $(grep mypy== requirements-tests.txt)
run: pip install $(grep tomli== requirements-tests.txt) $(grep mypy== requirements-tests.txt)
- name: Run stubtest
run: python tests/stubtest_stdlib.py

View File

@@ -11,6 +11,7 @@
"stdlib/lib2to3/refactor.pyi",
"stdlib/sqlite3/dbapi2.pyi",
"stdlib/tkinter",
"stdlib/unittest/mock.pyi",
"stdlib/xml/dom/NodeFilter.pyi",
"stdlib/xml/dom/expatbuilder.pyi",
"stdlib/xml/dom/minidom.pyi",

View File

@@ -1,10 +1,8 @@
from typing import Tuple
IMPORT_MAPPING: dict[str, str]
NAME_MAPPING: dict[tuple[str, str], tuple[str, str]]
PYTHON2_EXCEPTIONS: Tuple[str, ...]
MULTIPROCESSING_EXCEPTIONS: Tuple[str, ...]
PYTHON2_EXCEPTIONS: tuple[str, ...]
MULTIPROCESSING_EXCEPTIONS: tuple[str, ...]
REVERSE_IMPORT_MAPPING: dict[str, str]
REVERSE_NAME_MAPPING: dict[tuple[str, str], tuple[str, str]]
PYTHON3_OSERROR_EXCEPTIONS: Tuple[str, ...]
PYTHON3_IMPORTERROR_EXCEPTIONS: Tuple[str, ...]
PYTHON3_OSERROR_EXCEPTIONS: tuple[str, ...]
PYTHON3_IMPORTERROR_EXCEPTIONS: tuple[str, ...]

View File

@@ -1,7 +1,11 @@
import sys
import types
from importlib.machinery import ModuleSpec
from typing import Any
if sys.version_info >= (3, 7):
check_hash_based_pycs: str
def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ...
def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> None: ...
def acquire_lock() -> None: ...

View File

@@ -13,7 +13,7 @@ _INITPRE: str # undocumented
def _find_executable(executable: str, path: str | None = ...) -> str | None: ... # undocumented
if sys.version_info >= (3, 7):
if sys.version_info >= (3, 8):
def _read_output(commandstring: str, capture_stderr: bool = ...) -> str | None: ... # undocumented
else:

View File

@@ -5,14 +5,17 @@ from typing import IO, Any, Callable, ClassVar, NoReturn, Type
from . import events, futures, proactor_events, selector_events, streams, windows_utils
__all__ = [
"SelectorEventLoop",
"ProactorEventLoop",
"IocpProactor",
"DefaultEventLoopPolicy",
"WindowsSelectorEventLoopPolicy",
"WindowsProactorEventLoopPolicy",
]
if sys.version_info >= (3, 7):
__all__ = (
"SelectorEventLoop",
"ProactorEventLoop",
"IocpProactor",
"DefaultEventLoopPolicy",
"WindowsSelectorEventLoopPolicy",
"WindowsProactorEventLoopPolicy",
)
else:
__all__ = ["SelectorEventLoop", "ProactorEventLoop", "IocpProactor", "DefaultEventLoopPolicy"]
NULL: int
INFINITE: int

View File

@@ -1,5 +1,7 @@
from _curses import _CursesWindow
version: str
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the space in the class name)
def above(self) -> _Curses_Panel: ...
def below(self) -> _Curses_Panel: ...

View File

@@ -6,6 +6,8 @@ _T = TypeVar("_T")
_KeyType = Union[str, bytes]
_ValueType = Union[str, bytes]
open_flags: str
class error(OSError): ...
# Actual typename gdbm, not exposed by the implementation

View File

@@ -1,4 +1,5 @@
import numbers
import sys
from types import TracebackType
from typing import Any, Container, NamedTuple, Sequence, Tuple, Type, TypeVar, Union, overload
@@ -21,6 +22,8 @@ ROUND_UP: str
ROUND_HALF_DOWN: str
ROUND_05UP: str
if sys.version_info >= (3, 7):
HAVE_CONTEXTVAR: bool
HAVE_THREADS: bool
MAX_EMAX: int
MAX_PREC: int

View File

@@ -0,0 +1,40 @@
from . import (
bdist_dumb as bdist_dumb,
bdist_rpm as bdist_rpm,
build as build,
build_clib as build_clib,
build_ext as build_ext,
build_py as build_py,
build_scripts as build_scripts,
check as check,
clean as clean,
install as install,
install_data as install_data,
install_headers as install_headers,
install_lib as install_lib,
register as register,
sdist as sdist,
upload as upload,
)
__all__ = [
"build",
"build_py",
"build_ext",
"build_clib",
"build_scripts",
"clean",
"install",
"install_lib",
"install_headers",
"install_scripts",
"install_data",
"sdist",
"register",
"bdist",
"bdist_dumb",
"bdist_rpm",
"bdist_wininst",
"check",
"upload",
]

View File

@@ -7,6 +7,9 @@ from typing import Any, AnyStr, Callable, Union, overload
_Hash = Any
_DigestMod = Union[str, Callable[[], _Hash], ModuleType]
trans_5C: bytes
trans_36: bytes
digest_size: None
if sys.version_info >= (3, 8):

View File

@@ -53,6 +53,8 @@ CO_ITERABLE_COROUTINE: int
CO_ASYNC_GENERATOR: int
TPFLAGS_IS_ABSTRACT: int
modulesbyfile: dict[str, Any]
def getmembers(object: object, predicate: Callable[[Any], bool] | None = ...) -> list[tuple[str, Any]]: ...
def getmodulename(path: str) -> str | None: ...
def ismodule(object: object) -> TypeGuard[ModuleType]: ...

View File

@@ -1,4 +1,10 @@
from typing import Any, Callable, Iterator
from typing import Any, Callable, Iterator, Pattern
ESCAPE: Pattern[str]
ESCAPE_ASCII: Pattern[str]
HAS_UTF8: Pattern[bytes]
ESCAPE_DCT: dict[str, str]
INFINITY: float
def py_encode_basestring(s: str) -> str: ... # undocumented
def py_encode_basestring_ascii(s: str) -> str: ... # undocumented

View File

@@ -1,3 +1,5 @@
import sys
ENDMARKER: int
NAME: int
NUMBER: int
@@ -57,6 +59,8 @@ ATEQUAL: int
AWAIT: int
ASYNC: int
ERRORTOKEN: int
if sys.version_info >= (3, 7):
COLONEQUAL: int
N_TOKENS: int
NT_OFFSET: int
tok_name: dict[int, str]

View File

@@ -13,6 +13,7 @@ if sys.platform != "win32":
POLLOUT: int
POLLPRI: int
POLLRDBAND: int
POLLRDHUP: int
POLLRDNORM: int
POLLWRBAND: int
POLLWRNORM: int
@@ -118,6 +119,7 @@ if sys.platform == "linux":
@classmethod
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
EPOLLERR: int
EPOLLEXCLUSIVE: int
EPOLLET: int
EPOLLHUP: int
EPOLLIN: int
@@ -126,10 +128,12 @@ if sys.platform == "linux":
EPOLLOUT: int
EPOLLPRI: int
EPOLLRDBAND: int
EPOLLRDHUP: int
EPOLLRDNORM: int
EPOLLWRBAND: int
EPOLLWRNORM: int
EPOLL_RDHUP: int
EPOLL_CLOEXEC: int
if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32":
# Solaris only

View File

@@ -40,6 +40,8 @@ if sys.version_info >= (3, 7):
SQLITE_DELETE: int
SQLITE_DENY: int
SQLITE_DETACH: int
if sys.version_info >= (3, 7):
SQLITE_DONE: int
SQLITE_DROP_INDEX: int
SQLITE_DROP_TABLE: int
SQLITE_DROP_TEMP_INDEX: int

View File

@@ -1,18 +1,5 @@
from sre_constants import (
SRE_FLAG_ASCII as SRE_FLAG_ASCII,
SRE_FLAG_DEBUG as SRE_FLAG_DEBUG,
SRE_FLAG_DOTALL as SRE_FLAG_DOTALL,
SRE_FLAG_IGNORECASE as SRE_FLAG_IGNORECASE,
SRE_FLAG_LOCALE as SRE_FLAG_LOCALE,
SRE_FLAG_MULTILINE as SRE_FLAG_MULTILINE,
SRE_FLAG_TEMPLATE as SRE_FLAG_TEMPLATE,
SRE_FLAG_UNICODE as SRE_FLAG_UNICODE,
SRE_FLAG_VERBOSE as SRE_FLAG_VERBOSE,
SRE_INFO_CHARSET as SRE_INFO_CHARSET,
SRE_INFO_LITERAL as SRE_INFO_LITERAL,
SRE_INFO_PREFIX as SRE_INFO_PREFIX,
_NamedIntConstant,
)
from sre_constants import *
from sre_constants import _NamedIntConstant
from sre_parse import SubPattern
from typing import Any, Pattern

View File

@@ -1,6 +1,8 @@
import sys
from typing import Any
MAXGROUPS: int
MAGIC: int
class error(Exception):
@@ -20,6 +22,9 @@ OPCODES: list[_NamedIntConstant]
ATCODES: list[_NamedIntConstant]
CHCODES: list[_NamedIntConstant]
OP_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
if sys.version_info >= (3, 7):
OP_LOCALE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
OP_UNICODE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant]
AT_MULTILINE: dict[_NamedIntConstant, _NamedIntConstant]
AT_LOCALE: dict[_NamedIntConstant, _NamedIntConstant]
AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant]

View File

@@ -1,4 +1,5 @@
import sys
from sre_constants import *
from sre_constants import _NamedIntConstant as _NIC, error as _Error
from typing import Any, Iterable, List, Match, Optional, Pattern as _Pattern, Tuple, Union, overload
@@ -12,6 +13,8 @@ WHITESPACE: frozenset[str]
ESCAPES: dict[str, tuple[_NIC, int]]
CATEGORIES: dict[str, tuple[_NIC, _NIC] | tuple[_NIC, list[tuple[_NIC, _NIC]]]]
FLAGS: dict[str, int]
if sys.version_info >= (3, 7):
TYPE_FLAGS: int
GLOBAL_FLAGS: int
class Verbose(Exception): ...

View File

@@ -220,7 +220,7 @@ if sys.version_info >= (3, 7):
HAS_TLSv1: bool
HAS_TLSv1_1: bool
HAS_TLSv1_2: bool
HAS_TLSv1_3: bool
HAS_TLSv1_3: bool
HAS_ALPN: bool
HAS_ECDH: bool
HAS_SNI: bool

View File

@@ -64,9 +64,8 @@ UF_IMMUTABLE: int
UF_APPEND: int
UF_OPAQUE: int
UF_NOUNLINK: int
if sys.platform == "darwin":
UF_COMPRESSED: int # OS X 10.6+ only
UF_HIDDEN: int # OX X 10.5+ only
UF_COMPRESSED: int # OS X 10.6+ only
UF_HIDDEN: int # OX X 10.5+ only
SF_ARCHIVED: int
SF_IMMUTABLE: int
SF_APPEND: int

View File

@@ -1,3 +1,11 @@
b1_set: set[int]
b3_exceptions: dict[int, str]
c22_specials: set[int]
c6_set: set[int]
c7_set: set[int]
c8_set: set[int]
c9_set: set[int]
def in_table_a1(code: str) -> bool: ...
def in_table_b1(code: str) -> bool: ...
def map_table_b3(code: str) -> str: ...

View File

@@ -1,3 +1,5 @@
import sys
single_input: int
file_input: int
eval_input: int
@@ -84,5 +86,13 @@ comp_if: int
encoding_decl: int
yield_expr: int
yield_arg: int
if sys.version_info >= (3, 7):
sync_comp_for: int
if sys.version_info >= (3, 8):
func_body_suite: int
func_type: int
func_type_input: int
namedexpr_test: int
typelist: int
sym_name: dict[int, str]

View File

@@ -1,7 +1,9 @@
from typing import overload
from typing_extensions import Literal
LOG_ALERT: int
LOG_AUTH: int
LOG_AUTHPRIV: Literal[80]
LOG_CONS: int
LOG_CRIT: int
LOG_CRON: int
@@ -25,6 +27,7 @@ LOG_NDELAY: int
LOG_NEWS: int
LOG_NOTICE: int
LOG_NOWAIT: int
LOG_ODELAY: Literal[4]
LOG_PERROR: int
LOG_PID: int
LOG_SYSLOG: int

View File

@@ -10,15 +10,25 @@ from .case import (
skipIf as skipIf,
skipUnless as skipUnless,
)
from .loader import (
TestLoader as TestLoader,
defaultTestLoader as defaultTestLoader,
findTestCases as findTestCases,
getTestCaseNames as getTestCaseNames,
makeSuite as makeSuite,
)
from .main import TestProgram as TestProgram, main as main
from .result import TestResult as TestResult
from .runner import TextTestResult as TextTestResult, TextTestRunner as TextTestRunner
from .signals import (
installHandler as installHandler,
registerResult as registerResult,
removeHandler as removeHandler,
removeResult as removeResult,
)
from .suite import BaseTestSuite as BaseTestSuite, TestSuite as TestSuite
if sys.version_info >= (3, 8):
from .case import addModuleCleanup as addModuleCleanup
from unittest.loader import *
from unittest.main import *
from unittest.result import TestResult as TestResult
from unittest.runner import *
from unittest.signals import *
from unittest.suite import *
def load_tests(loader: TestLoader, tests: TestSuite, pattern: str | None) -> TestSuite: ...

View File

@@ -32,6 +32,8 @@ if sys.version_info >= (3, 9):
_E = TypeVar("_E", bound=BaseException)
_FT = TypeVar("_FT", bound=Callable[..., Any])
DIFF_OMITTED: str
class _BaseTestCaseContext:
def __init__(self, test_case: TestCase) -> None: ...

View File

@@ -3,11 +3,13 @@ import unittest.case
import unittest.result
import unittest.suite
from types import ModuleType
from typing import Any, Callable, List, Sequence, Type
from typing import Any, Callable, List, Pattern, Sequence, Type
_SortComparisonMethod = Callable[[str, str], int]
_SuiteClass = Callable[[List[unittest.case.TestCase]], unittest.suite.TestSuite]
VALID_MODULE_NAME: Pattern[str]
class TestLoader:
errors: list[Type[BaseException]]
testMethodPrefix: str

View File

@@ -6,6 +6,9 @@ import unittest.suite
from types import ModuleType
from typing import Any, Iterable, Protocol, Type
MAIN_EXAMPLES: str
MODULE_EXAMPLES: str
class _TestRunner(Protocol):
def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ...

View File

@@ -5,23 +5,57 @@ _T = TypeVar("_T")
_TT = TypeVar("_TT", bound=Type[Any])
_R = TypeVar("_R")
__all__ = [
"Mock",
"MagicMock",
"patch",
"sentinel",
"DEFAULT",
"ANY",
"call",
"create_autospec",
"AsyncMock",
"FILTER_DIR",
"NonCallableMock",
"NonCallableMagicMock",
"mock_open",
"PropertyMock",
"seal",
]
if sys.version_info >= (3, 8):
__all__ = (
"Mock",
"MagicMock",
"patch",
"sentinel",
"DEFAULT",
"ANY",
"call",
"create_autospec",
"AsyncMock",
"FILTER_DIR",
"NonCallableMock",
"NonCallableMagicMock",
"mock_open",
"PropertyMock",
"seal",
)
elif sys.version_info >= (3, 7):
__all__ = (
"Mock",
"MagicMock",
"patch",
"sentinel",
"DEFAULT",
"ANY",
"call",
"create_autospec",
"FILTER_DIR",
"NonCallableMock",
"NonCallableMagicMock",
"mock_open",
"PropertyMock",
"seal",
)
else:
__all__ = (
"Mock",
"MagicMock",
"patch",
"sentinel",
"DEFAULT",
"ANY",
"call",
"create_autospec",
"FILTER_DIR",
"NonCallableMock",
"NonCallableMagicMock",
"mock_open",
"PropertyMock",
)
__version__: str
FILTER_DIR: Any
@@ -39,7 +73,7 @@ class _Sentinel:
sentinel: Any
DEFAULT: Any
class _Call(Tuple[Any, ...]):
class _Call(tuple[Any, ...]):
def __new__(
cls, value: Any = ..., name: Any | None = ..., parent: Any | None = ..., two: bool = ..., from_kall: bool = ...
) -> Any: ...
@@ -53,6 +87,11 @@ class _Call(Tuple[Any, ...]):
__ne__: Any
def __call__(self, *args: Any, **kwargs: Any) -> _Call: ...
def __getattr__(self, attr: Any) -> Any: ...
if sys.version_info >= (3, 8):
@property
def args(self): ...
@property
def kwargs(self): ...
def call_list(self) -> Any: ...
call: _Call
@@ -60,12 +99,6 @@ call: _Call
class _CallList(List[_Call]):
def __contains__(self, value: Any) -> bool: ...
class _MockIter:
obj: Any
def __init__(self, obj: Any) -> None: ...
def __iter__(self) -> Any: ...
def __next__(self) -> Any: ...
class Base:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
@@ -141,7 +174,10 @@ class CallableMixin(Base):
_new_parent: Any | None = ...,
**kwargs: Any,
) -> None: ...
def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ...
if sys.version_info >= (3, 8):
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
else:
def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ...
class Mock(CallableMixin, NonCallableMock): ...
@@ -160,23 +196,41 @@ class _patch(Generic[_T]):
additional_patchers: Any
# If new==DEFAULT, self is _patch[Any]. Ideally we'd be able to add an overload for it so that self is _patch[MagicMock],
# but that's impossible with the current type system.
def __init__(
self: _patch[_T],
getter: Callable[[], Any],
attribute: str,
new: _T,
spec: Any | None,
create: bool,
spec_set: Any | None,
autospec: Any | None,
new_callable: Any | None,
kwargs: Mapping[str, Any],
) -> None: ...
if sys.version_info >= (3, 10):
def __init__(
self: _patch[_T],
getter: Callable[[], Any],
attribute: str,
new: _T,
spec: Any | None,
create: bool,
spec_set: Any | None,
autospec: Any | None,
new_callable: Any | None,
kwargs: Mapping[str, Any],
*,
unsafe: bool = ...,
) -> None: ...
else:
def __init__(
self: _patch[_T],
getter: Callable[[], Any],
attribute: str,
new: _T,
spec: Any | None,
create: bool,
spec_set: Any | None,
autospec: Any | None,
new_callable: Any | None,
kwargs: Mapping[str, Any],
) -> None: ...
def copy(self) -> _patch[_T]: ...
@overload
def __call__(self, func: _TT) -> _TT: ...
@overload
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
if sys.version_info >= (3, 8):
def decoration_helper(self, patched, args, keywargs): ...
def decorate_class(self, klass: _TT) -> _TT: ...
def decorate_callable(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
if sys.version_info >= (3, 8):
@@ -357,10 +411,11 @@ if sys.version_info >= (3, 8):
class MagicProxy:
name: Any
parent: Any
def __init__(self, name: Any, parent: Any) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def create_mock(self) -> Any: ...
def __get__(self, obj: Any, _type: Any | None = ...) -> Any: ...
def __init__(self, name, parent) -> None: ...
if sys.version_info < (3, 8):
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def create_mock(self): ...
def __get__(self, obj, _type: Any | None = ...): ...
class _ANY:
def __eq__(self, other: Any) -> bool: ...

View File

@@ -6,6 +6,9 @@ _SysExcInfoType = Union[Tuple[Type[BaseException], BaseException, TracebackType]
_F = TypeVar("_F", bound=Callable[..., Any])
STDOUT_LINE: str
STDERR_LINE: str
# undocumented
def failfast(method: _F) -> _F: ...

View File

@@ -3,6 +3,9 @@ from _typeshed import StrOrBytesPath
from types import SimpleNamespace
from typing import Sequence
if sys.version_info >= (3, 9):
CORE_VENV_DEPS: tuple[str, ...]
class EnvBuilder:
system_site_packages: bool
clear: bool

View File

@@ -6,6 +6,9 @@ XINCLUDE: str
XINCLUDE_INCLUDE: str
XINCLUDE_FALLBACK: str
if sys.version_info >= (3, 9):
DEFAULT_MAX_INCLUSION_DEPTH: int
class FatalIncludeError(SyntaxError): ...
def default_loader(href: str | bytes | int, parse: str, encoding: str | None = ...) -> str | Element: ...

View File

@@ -1,12 +1,16 @@
from array import array
from typing import Any
from typing_extensions import Literal
DEFLATED: int
DEF_MEM_LEVEL: int
MAX_WBITS: int
ZLIB_VERSION: str
Z_NO_COMPRESSION: Literal[0]
Z_PARTIAL_FLUSH: Literal[1]
Z_BEST_COMPRESSION: int
Z_BEST_SPEED: int
Z_BLOCK: Literal[5]
Z_DEFAULT_COMPRESSION: int
Z_DEFAULT_STRATEGY: int
Z_FILTERED: int
@@ -17,6 +21,7 @@ Z_HUFFMAN_ONLY: int
Z_NO_FLUSH: int
Z_RLE: int
Z_SYNC_FLUSH: int
Z_TREES: Literal[6]
DEF_BUF_SIZE: int
ZLIB_RUNTIME_VERSION: str

View File

@@ -20,6 +20,7 @@ select.epoll.register
# Exists at runtime, but missing from stubs
asyncio.PidfdChildWatcher
asyncio.unix_events.PidfdChildWatcher
mmap.MAP_POPULATE
os.CLD_KILLED
os.CLD_STOPPED
os.EFD_CLOEXEC
@@ -45,6 +46,13 @@ os.pidfd_open
os.preadv
os.pwritev
os.splice
posix.CLD_KILLED
posix.CLD_STOPPED
posix.EFD_[A-Z]+
posix.P_PIDFD
posix.POSIX_SPAWN_[A-Z0-9]+
posix.RWF_[A-Z]+
posix.SPLICE_[A-Z_]+
posix.copy_file_range
posix.eventfd
posix.eventfd_read

View File

@@ -9,3 +9,4 @@ ntpath.splitunc
posix.stat_float_times
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
uuid.lib

View File

@@ -9,6 +9,7 @@ os.RWF_NOWAIT
os.RWF_SYNC
os.preadv
os.pwritev
posix.RWF_[A-Z]+
posix.preadv
posix.pwritev
time.pthread_getcpuclockid

View File

@@ -11,6 +11,8 @@ os.RWF_SYNC
os.copy_file_range
os.preadv
os.pwritev
posix.POSIX_SPAWN_[A-Z0-9]+
posix.RWF_[A-Z]+
posix.copy_file_range
posix.preadv
posix.pwritev

View File

@@ -18,6 +18,11 @@ os.copy_file_range
os.pidfd_open
os.preadv
os.pwritev
posix.CLD_KILLED
posix.CLD_STOPPED
posix.P_PIDFD
posix.POSIX_SPAWN_[A-Z0-9]+
posix.RWF_[A-Z]+
posix.copy_file_range
posix.pidfd_open
posix.preadv

View File

@@ -11,6 +11,7 @@ os.SF_NODISKIO
os.SF_SYNC
os.plock
posix.EX_NOTFOUND
posix.NGROUPS_MAX
select.EPOLL_RDHUP
selectors.KqueueSelector
signal.SIGEMT

View File

@@ -156,7 +156,6 @@ distutils.dist.DistributionMetadata.set_classifiers
distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.util.get_host_platform
lib2to3.pgen2.tokenize.COLONEQUAL
multiprocessing.managers.SharedMemoryServer.create
multiprocessing.managers.SharedMemoryServer.list_segments
multiprocessing.managers.SharedMemoryServer.public

View File

@@ -21,6 +21,11 @@ collections.AsyncGenerator.ag_running
collections.Callable
collections.UserString.maketrans
contextlib._GeneratorContextManager.__init__
datetime.datetime_CAPI
distutils.cygwinccompiler.RE_VERSION
distutils.dist.command_re
distutils.fancy_getopt.longopt_re
distutils.fancy_getopt.neg_alias_re
enum.Enum._generate_next_value_
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve
hmac.HMAC.__init__
@@ -38,6 +43,7 @@ pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - funct
random.Random.randrange # missing undocumented arg _int
random.randrange # missing undocumented arg _int
sched.Event.__doc__ # __slots__ is overridden
stringprep.unicodedata # re-exported from unicodedata
sre_compile.dis
typing.AsyncGenerator.ag_await
typing.AsyncGenerator.ag_code
@@ -64,11 +70,26 @@ typing\.\w+\.__new__
unittest._log # New in Python 3.9
unittest.async_case # Added in Python 3.8
uuid.UUID.int
uuid.libname
xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495
xml.etree.cElementTree.TreeBuilder.start # bpo-39495
xml.parsers.expat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args
# These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt
tkinter.EventType.__new__
tkinter.commondialog.[A-Z_]+
tkinter.commondialog.TclVersion
tkinter.commondialog.TkVersion
tkinter.commondialog.wantobjects
tkinter.dialog.[A-Z_]+
tkinter.dialog.TclVersion
tkinter.dialog.TkVersion
tkinter.dialog.wantobjects
tkinter.filedialog.[A-Z_]+
tkinter.filedialog.TclVersion
tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
builtins.memoryview.__iter__ # C type that implements __getitem__
builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only

View File

@@ -91,6 +91,7 @@ _imp.source_hash
asyncio.BufferedProtocol.eof_received
asyncio.protocols.BufferedProtocol.eof_received
contextvars.ContextVar.__class_getitem__
datetime.datetime_CAPI
distutils.command.bdist_wininst
distutils.command.bdist_wininst.bdist_wininst
distutils.dist.DistributionMetadata.set_classifiers
@@ -98,6 +99,10 @@ distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.cygwinccompiler.RE_VERSION
distutils.dist.command_re
distutils.fancy_getopt.longopt_re
distutils.fancy_getopt.neg_alias_re
dummy_threading.Barrier
dummy_threading.BoundedSemaphore
dummy_threading.BrokenBarrierError
@@ -120,7 +125,6 @@ dummy_threading.setprofile
dummy_threading.settrace
dummy_threading.stack_size
html.parser.HTMLParser.unescape
lib2to3.pgen2.tokenize.COLONEQUAL
platform.popen
plistlib.Data.asBase64
plistlib.Data.fromBase64
@@ -128,12 +132,27 @@ ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.SSLObject.verify_client_post_handshake
ssl.SSLSocket.verify_client_post_handshake
stringprep.unicodedata # re-exported from unicodedata
sys.callstats
sys.get_coroutine_wrapper
sys.set_coroutine_wrapper
tempfile.SpooledTemporaryFile.softspace
tkinter.commondialog.[A-Z_]+
tkinter.commondialog.TclVersion
tkinter.commondialog.TkVersion
tkinter.commondialog.wantobjects
tkinter.dialog.[A-Z_]+
tkinter.dialog.TclVersion
tkinter.dialog.TkVersion
tkinter.dialog.wantobjects
tkinter.dnd.Icon
tkinter.dnd.Tester
tkinter.dnd.test
tkinter.filedialog.[A-Z_]+
tkinter.filedialog.TclVersion
tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
types.CoroutineType.cr_origin
typing._SpecialForm.__call__

View File

@@ -103,6 +103,7 @@ _imp.source_hash
asyncio.BufferedProtocol.eof_received
asyncio.protocols.BufferedProtocol.eof_received
contextvars.ContextVar.__class_getitem__
datetime.datetime_CAPI
distutils.command.bdist_wininst
distutils.command.bdist_wininst.bdist_wininst
distutils.dist.DistributionMetadata.set_classifiers
@@ -111,6 +112,10 @@ distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.util.get_host_platform
distutils.cygwinccompiler.RE_VERSION
distutils.dist.command_re
distutils.fancy_getopt.longopt_re
distutils.fancy_getopt.neg_alias_re
dummy_threading.Barrier
dummy_threading.BoundedSemaphore
dummy_threading.BrokenBarrierError
@@ -135,7 +140,6 @@ dummy_threading.setprofile
dummy_threading.settrace
dummy_threading.stack_size
html.parser.HTMLParser.unescape
lib2to3.pgen2.tokenize.COLONEQUAL
multiprocessing.managers.SharedMemoryServer.create
multiprocessing.managers.SharedMemoryServer.list_segments
multiprocessing.managers.SharedMemoryServer.public
@@ -146,11 +150,26 @@ plistlib.Data.asBase64
plistlib.Data.fromBase64
pyexpat.XMLParserType.SkippedEntityHandler
pyexpat.XMLParserType.intern
stringprep.unicodedata # re-exported from unicodedata
sys.callstats
tempfile.SpooledTemporaryFile.softspace
tkinter.commondialog.[A-Z_]+
tkinter.commondialog.TclVersion
tkinter.commondialog.TkVersion
tkinter.commondialog.wantobjects
tkinter.dialog.[A-Z_]+
tkinter.dialog.TclVersion
tkinter.dialog.TkVersion
tkinter.dialog.wantobjects
tkinter.dnd.Icon
tkinter.dnd.Tester
tkinter.dnd.test
tkinter.filedialog.[A-Z_]+
tkinter.filedialog.TclVersion
tkinter.filedialog.TkVersion
tkinter.filedialog.wantobjects
tkinter.simpledialog.wantobjects
tkinter.tix.wantobjects
types.CoroutineType.cr_origin
typing._SpecialForm.__call__
unicodedata.UCD.is_normalized

View File

@@ -138,10 +138,13 @@ distutils.dist.DistributionMetadata.set_platforms
distutils.sysconfig.expand_makefile_vars
distutils.sysconfig.get_python_version
distutils.util.get_host_platform
distutils.cygwinccompiler.RE_VERSION
distutils.dist.command_re
distutils.fancy_getopt.longopt_re
distutils.fancy_getopt.neg_alias_re
hmac.HMAC.digest_cons
hmac.HMAC.inner
hmac.HMAC.outer
lib2to3.pgen2.tokenize.COLONEQUAL
multiprocessing.managers.SharedMemoryServer.create
multiprocessing.managers.SharedMemoryServer.list_segments
multiprocessing.managers.SharedMemoryServer.public
@@ -153,6 +156,7 @@ pstats.Stats.get_stats_profile
pstats.StatsProfile
pyexpat.XMLParserType.SkippedEntityHandler
pyexpat.XMLParserType.intern
stringprep.unicodedata # re-exported from unicodedata
types.CoroutineType.cr_origin
typing._SpecialForm.__call__
unicodedata.UCD.is_normalized

View File

@@ -1,4 +1,9 @@
_collections_abc.Callable # Some typecheckers need this as specialform
# ==========
# Allowlist entries that should be fixed
# ==========
# Please keep sorted alphabetically
# Coroutine and Generator properties are added programmatically
_collections_abc.Coroutine.cr_await
_collections_abc.Coroutine.cr_code
@@ -13,7 +18,6 @@ _collections_abc.Sequence.index # Supporting None in end is not mandatory
_csv.Dialect.__init__ # C __init__ signature is inaccurate
_socket.*
_threading_local.local.__new__
_typeshed.* # Utility types for typeshed, doesn't exist at runtime
_weakref.ref.__call__
abc.abstractclassmethod # Deprecated, unsupported by mypy, hard to fix. #6552
abc.abstractstaticmethod # Deprecated, unsupported by mypy, hard to fix. #6552
@@ -25,8 +29,6 @@ argparse.Namespace.__getattr__ # The whole point of this class is its attribute
asynchat.async_chat.encoding # Removal planned for 3.12, can add if someone needs this
asynchat.async_chat.use_encoding # Removal planned for 3.12, can add if someone needs this
asynchat.find_prefix_at_end # Removal planned for 3.12, can add if someone needs this
asyncore.dispatcher.addr # Removal planned for 3.12, can add if someone needs this
asyncore.dispatcher.handle_accepted # Removal planned for 3.12, can add if someone needs this
asyncio.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them
# Condition functions are exported in __init__
asyncio.Condition.acquire
@@ -169,6 +171,7 @@ pickle.Unpickler.persistent_load # C unpickler persistent_load is an attribute
pickle._Unpickler\..* # Best effort typing for undocumented internals
pickle._Pickler\..* # Best effort typing for undocumented internals
poplib.POP3_SSL.stls # bad declaration of inherited function. See poplib.pyi
pyexpat.expat_CAPI
select.poll # Depends on configuration
selectors.DevpollSelector # Depends on configuration
socketserver.BaseServer.fileno # implemented in derived classes
@@ -180,6 +183,7 @@ ssl._ASN1Object.__new__ # You cannot override __new__ in NamedTuple and runtime
subprocess.Popen.__init__
sys.gettotalrefcount # Available on python debug builds
sys.implementation # Actually SimpleNamespace but then you wouldn't have convenient attributes
sys.thread_info
tarfile.TarFile.errors # errors is initialized for some reason as None even though it really only accepts str
# SpooledTemporaryFile implements IO except these methods
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
@@ -189,6 +193,12 @@ tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable
threading.Condition.acquire # Condition functions are exported in __init__
threading.Condition.release # Condition functions are exported in __init__
tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion
tkinter.tix.[A-Z_]+
tkinter.tix.TclVersion
tkinter.tix.TkVersion
multiprocessing.dummy.Condition.acquire
multiprocessing.dummy.Condition.release
threading.Lock # A factory function that returns 'most efficient lock'. Marking it as a function will make it harder for users to mark the Lock type.
@@ -226,6 +236,7 @@ webbrowser.UnixBrowser.remote_action # always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newtab # always overridden in inheriting class
webbrowser.UnixBrowser.remote_action_newwin # always overridden in inheriting class
wsgiref.types # Doesn't exist, see comments in file
xml.parsers.expat.expat_CAPI
# ==========
# Allowlist entries that cannot or should not be fixed
@@ -239,9 +250,6 @@ builtins.exit
builtins.help
builtins.license
builtins.quit
# Builtins that mypy pretends exist
builtins.reveal_locals
builtins.reveal_type
# GetSetDescriptor that always raises AttributeError
builtins.OSError.characters_written
# Aliases for OSError
@@ -282,6 +290,26 @@ codecs.StreamReaderWriter.\w+
codecs.StreamRecoder.\w+
urllib.response.addbase.\w+
# Unnecessary re-exports
asyncore\.E[A-Z]+ # re-exported from errno
asyncore.errorcode # re-exported from errno
email._header_value_parser.hexdigits
logging.handlers.ST_[A-Z]+
xml.dom.expatbuilder.EMPTY_NAMESPACE
xml.dom.expatbuilder.EMPTY_PREFIX
xml.dom.expatbuilder.XMLNS_NAMESPACE
xml.dom.minidom.EMPTY_NAMESPACE
xml.dom.minidom.EMPTY_PREFIX
xml.dom.minidom.XMLNS_NAMESPACE
xml.dom.minidom.StringTypes
# Typing-related weirdness
_collections_abc.Callable
_typeshed.* # Utility types for typeshed, doesn't exist at runtime
# Builtins that type checkers pretends exist
builtins.reveal_locals
builtins.reveal_type
# Platform differences that cannot be captured by the type system
errno.[A-Z0-9]+
os.O_[A-Z_]+
@@ -364,10 +392,28 @@ email.contentmanager.set_bytes_content
email.contentmanager.set_message_content
email.contentmanager.set_text_content
# Side effects from module initialization
_compat_pickle.excname
email.contentmanager.maintype
email.contentmanager.subtype
inspect.k
inspect.mod_dict
inspect.v
json.encoder.i
lib2to3.pgen2.grammar.line
lib2to3.pgen2.grammar.name
lib2to3.pgen2.grammar.op
# ==========
# Missing from distutils module (deprecated, to be removed in 3.12)
# Missing from deprecated modules
# Any of these can be added if someone needs them
# ==========
# Removal planned for 3.12
asyncore.dispatcher.addr
asyncore.dispatcher.handle_accepted
# Missing from distutils module (deprecated, to be removed in 3.12)
distutils.archive_util.ARCHIVE_FORMATS
distutils.archive_util.check_archive_formats
distutils.bcppcompiler.BCPPCompiler.compiler_type
distutils.bcppcompiler.BCPPCompiler.exe_extension
@@ -392,28 +438,19 @@ distutils.ccompiler.CCompiler.shared_lib_format
distutils.ccompiler.CCompiler.src_extensions
distutils.ccompiler.CCompiler.static_lib_extension
distutils.ccompiler.CCompiler.static_lib_format
distutils.ccompiler.compiler_class
distutils.cmd.Command.dump_options
distutils.cmd.Command.ensure_finalized
distutils.command.bdist
distutils.command.bdist_dumb
distutils.command.bdist_rpm
distutils.command.build
distutils.command.build_clib
distutils.command.build_ext
distutils.command.build_py
distutils.command.build_scripts
distutils.command.check
distutils.command.clean
distutils.command.install
distutils.command.install_data
distutils.command.install_headers
distutils.command.install_lib
distutils.command.install_scripts
distutils.command.register
distutils.command.sdist
distutils.command.upload
distutils.command.bdist_rpm.DEBUG
distutils.command.build_ext.USER_BASE
distutils.command.build_scripts.ST_MODE
distutils.command.install.*
distutils.command.install_scripts.ST_MODE
distutils.core.Command.dump_options
distutils.core.Command.ensure_finalized
distutils.core.DEBUG
distutils.core.USAGE
distutils.core.Distribution.announce
distutils.core.Distribution.common_usage
distutils.core.Distribution.display_option_names
@@ -441,7 +478,13 @@ distutils.core.Distribution.print_commands
distutils.core.Distribution.reinitialize_command
distutils.core.Distribution.run_command
distutils.core.Distribution.run_commands
distutils.core.extension_keywords
distutils.core.gen_usage
distutils.core.setup_keywords
distutils.cygwinccompiler.CONFIG_H_NOTOK
distutils.cygwinccompiler.CONFIG_H_OK
distutils.cygwinccompiler.CONFIG_H_UNCERTAIN
distutils.cygwinccompiler.PIPE
distutils.cygwinccompiler.CygwinCCompiler.compiler_type
distutils.cygwinccompiler.CygwinCCompiler.exe_extension
distutils.cygwinccompiler.CygwinCCompiler.obj_extension
@@ -455,6 +498,7 @@ distutils.cygwinccompiler.get_msvcr
distutils.cygwinccompiler.get_versions
distutils.cygwinccompiler.is_cygwingcc
distutils.dir_util.ensure_relative
distutils.dist.DEBUG
distutils.dist.Distribution.announce
distutils.dist.Distribution.common_usage
distutils.dist.Distribution.display_option_names
@@ -484,6 +528,7 @@ distutils.dist.Distribution.run_command
distutils.dist.Distribution.run_commands
distutils.dist.fix_help_options
distutils.extension.read_setup_file
distutils.fancy_getopt.WS_TRANS
distutils.fancy_getopt.FancyGetopt.add_option
distutils.fancy_getopt.FancyGetopt.get_attr_name
distutils.fancy_getopt.FancyGetopt.has_option
@@ -491,6 +536,8 @@ distutils.fancy_getopt.FancyGetopt.print_help
distutils.fancy_getopt.FancyGetopt.set_aliases
distutils.fancy_getopt.FancyGetopt.set_negative_aliases
distutils.fancy_getopt.FancyGetopt.set_option_table
distutils.fancy_getopt.longopt_pat
distutils.fancy_getopt.longopt_xlate
distutils.fancy_getopt.translate_longopt
distutils.msvccompiler.MSVCCompiler.compiler_type
distutils.msvccompiler.MSVCCompiler.exe_extension
@@ -510,8 +557,14 @@ distutils.msvccompiler.get_build_version
distutils.msvccompiler.normalize_and_reduce_paths
distutils.msvccompiler.read_keys
distutils.msvccompiler.read_values
distutils.spawn.DEBUG
distutils.sysconfig.BASE_EXEC_PREFIX
distutils.sysconfig.BASE_PREFIX
distutils.sysconfig.build_flags
distutils.sysconfig.parse_config_h
distutils.sysconfig.parse_makefile
distutils.sysconfig.project_base
distutils.sysconfig.python_build
distutils.text_file.TextFile.default_options
distutils.text_file.TextFile.error
distutils.text_file.TextFile.gen_error

View File

@@ -1,3 +1,15 @@
_stat.IO_REPARSE_TAG_[A-Z_]+
_winapi.[A-Z_]+_PRIORITY_CLASS
_winapi.CREATE_[A-Z_]+
_winapi.DETACHED_PROCESS
_winapi.FILE_MAP_[A-Z_]+
_winapi.FILE_TYPE_[A-Z]+
_winapi.INVALID_HANDLE_VALUE
_winapi.MEM_[A-Z_]+
_winapi.PAGE_[A-Z_]+
_winapi.SEC_[A-Z_]+
_winapi.SYNCHRONIZE
_msi.CreateRecord
_msi.FCICreate
_msi.OpenDatabase

View File

@@ -1,3 +1,8 @@
_winapi.[A-Z_]+_PRIORITY_CLASS
_winapi.CREATE_[A-Z_]+
_winapi.DETACHED_PROCESS
_winapi.FILE_TYPE_[A-Z]+
# The following methods were changed in point releases from Python 3.6 to 3.9
# as part of a security fix. These excludes can be removed when the GitHub
# action workflow uses Python versions that include the fix (adding a

View File

@@ -1,3 +1,14 @@
_stat.IO_REPARSE_TAG_[A-Z_]+
_winapi.[A-Z_]+_PRIORITY_CLASS
_winapi.CREATE_[A-Z_]+
_winapi.DETACHED_PROCESS
_winapi.FILE_MAP_[A-Z_]+
_winapi.FILE_TYPE_[A-Z]+
_winapi.INVALID_HANDLE_VALUE
_winapi.MEM_[A-Z_]+
_winapi.PAGE_[A-Z_]+
_winapi.SEC_[A-Z_]+
_winapi.SYNCHRONIZE
# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping

View File

@@ -1,3 +1,14 @@
_stat.IO_REPARSE_TAG_[A-Z_]+
_winapi.[A-Z_]+_PRIORITY_CLASS
_winapi.CREATE_[A-Z_]+
_winapi.DETACHED_PROCESS
_winapi.FILE_MAP_[A-Z_]+
_winapi.FILE_TYPE_[A-Z]+
_winapi.INVALID_HANDLE_VALUE
_winapi.MEM_[A-Z_]+
_winapi.PAGE_[A-Z_]+
_winapi.SEC_[A-Z_]+
_winapi.SYNCHRONIZE
# Exists at runtime, but missing from stubs
_winapi.CreateFileMapping

View File

@@ -1,9 +1,23 @@
_msi.MSI[A-Z_]+
_msi.PID_[A-Z_]+
_stat.FILE_ATTRIBUTE_[A-Z_]+
ctypes.GetLastError # Is actually a pointer
distutils.archive_util.getgrnam
distutils.archive_util.getpwnam
distutils.msvccompiler.HKEYS
locale.[A-Z0-9_]+ # Constants that should be moved to _locale and re-exported conditionally
locale.nl_langinfo # Function that should be moved to _locale and re-exported conditionally
mmap.PAGESIZE
msilib.MSI[A-Z_]+
msilib.text.dirname
msilib.PID_[A-Z_]+
msvcrt.CRT_ASSEMBLY_VERSION
msvcrt.SEM_[A-Z]+
selectors.KqueueSelector
signal.SIGEMT
signal.SIGINFO
locale.[A-Z0-9_]+ # Constants that should be moved to _locale and re-exported conditionally
locale.nl_langinfo # Function that should be moved to _locale and re-exported conditionally
winsound.SND_APPLICATION
xmlrpc.server.fcntl
# ==========
# Allowlist entries that cannot or should not be fixed