diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 6bb49384d..6dafad073 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -31,7 +31,7 @@ jobs: matrix: # tkinter doesn't import on macOS-12 os: ["ubuntu-latest", "windows-latest", "macos-11"] - python-version: ["3.7", "3.8", "3.9", "3.10.8", "3.11.0"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] fail-fast: false steps: diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index 5ccc68cea..f465c21ca 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -32,7 +32,7 @@ jobs: matrix: # tkinter doesn't import on macOS 12 os: ["ubuntu-latest", "windows-latest", "macos-11"] - python-version: ["3.7", "3.8", "3.9", "3.10.8", "3.11.0"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] fail-fast: false steps: diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index 3ccac7e6b..4fbefc33a 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -184,6 +184,7 @@ if sys.platform == "win32": def PeekNamedPipe(__handle: int, __size: int = ...) -> tuple[int, int] | tuple[bytes, int, int]: ... if sys.version_info >= (3, 10): def LCMapStringEx(locale: str, flags: int, src: str) -> str: ... + def UnmapViewOfFile(__address: int) -> None: ... @overload def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index e4cedef1b..47535499a 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import Self -from collections.abc import Awaitable, Callable, Iterable, Mapping, Sequence +from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping, Sequence from contextlib import _GeneratorContextManager from types import TracebackType from typing import Any, Generic, TypeVar, overload @@ -9,6 +9,8 @@ from typing_extensions import Literal, TypeAlias _T = TypeVar("_T") _TT = TypeVar("_TT", bound=type[Any]) _R = TypeVar("_R") +_F = TypeVar("_F", bound=Callable[..., Any]) +_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]]) if sys.version_info >= (3, 8): __all__ = ( @@ -258,6 +260,10 @@ class _patch_dict: clear: Any def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ... def __call__(self, f: Any) -> Any: ... + if sys.version_info >= (3, 10): + def decorate_callable(self, f: _F) -> _F: ... + def decorate_async_callable(self, f: _AF) -> _AF: ... + def decorate_class(self, klass: Any) -> Any: ... def __enter__(self) -> Any: ... def __exit__(self, *args: object) -> Any: ... diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 6b214f924..06e391048 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -13,12 +13,6 @@ builtins.float.__setformat__ # Internal method for CPython test suite builtins.property.__set_name__ # Doesn't actually exist contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ -# Missing from distutils module (deprecated, to be removed in 3.12) -distutils.core.DEBUG -distutils.core.USAGE -distutils.core.extension_keywords -distutils.core.gen_usage -distutils.core.setup_keywords fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve gettext.install gettext.translation @@ -33,7 +27,6 @@ pickle.Pickler.reducer_override # implemented in C pickler # platform.uname_result's processor field is now dynamically made to exist platform.uname_result.__match_args__ platform.uname_result.__new__ -platform.uname_result._fields platform.uname_result.processor sys.UnraisableHookArgs # Not exported from sys tkinter.Tk.split @@ -54,6 +47,10 @@ typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update +# Runtime has *args, **kwargs, but will error if any are supplied +unittest.TestCase.__init_subclass__ +unittest.case.TestCase.__init_subclass__ + # stubtest complains that in 3.10 the default argument is inconsistent with the annotation, # but in 3.10+ calling the function without the default argument is in fact deprecated, # so it's better to ignore stubtest diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index e7b27930a..3c8da1fbb 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -16,6 +16,9 @@ argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this configparser.LegacyInterpolation.__init__ enum.Enum.__init__ +# TODO: The stub for enum is nothing like the implementation +enum.auto.__init__ +enum.auto.value fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve ftplib.FTP.trust_server_pasv_ipv4_address ipaddress.IPv4Interface.hostmask @@ -32,7 +35,6 @@ multiprocessing.spawn._main # platform.uname_result's processor field is now dynamically made to exist platform.uname_result.__match_args__ platform.uname_result.__new__ -platform.uname_result._fields platform.uname_result.processor queue.SimpleQueue.__init__ sys.UnraisableHookArgs # Not exported from sys @@ -41,6 +43,10 @@ typing.NewType.__call__ typing.NewType.__mro_entries__ weakref.WeakValueDictionary.update +# Runtime has *args, **kwargs, but will error if any are supplied +unittest.TestCase.__init_subclass__ +unittest.case.TestCase.__init_subclass__ + # stubtest complains that in 3.10 the default argument is inconsistent with the annotation, # but in 3.10+ calling the function without the default argument is in fact deprecated, # so it's better to ignore stubtest