Skip to content

Commit 691f316

Browse files
committed
Run stubtest for Python 3.12
1 parent c1a857a commit 691f316

20 files changed

+584
-156
lines changed

.github/workflows/stubtest_stdlib.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
matrix:
3333
# tkinter doesn't import on macOS 12
3434
os: ["ubuntu-latest", "windows-latest", "macos-11"]
35-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
35+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
3636
fail-fast: false
3737

3838
steps:

stdlib/builtins.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ from typing import ( # noqa: Y022
5353
overload,
5454
type_check_only,
5555
)
56-
from typing_extensions import (
56+
from typing_extensions import ( # type: ignore
5757
Concatenate,
5858
Literal,
5959
LiteralString,
@@ -465,7 +465,7 @@ class str(Sequence[str]):
465465
@overload
466466
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
467467
@overload
468-
def format(self, *args: object, **kwargs: object) -> str: ...
468+
def format(self, *args: object, **kwargs: object) -> str: ... # type: ignore
469469
def format_map(self, map: _FormatMapMapping) -> str: ...
470470
def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
471471
def isalnum(self) -> bool: ...
@@ -595,7 +595,7 @@ class str(Sequence[str]):
595595
@overload
596596
def __mod__(self: LiteralString, __value: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ...
597597
@overload
598-
def __mod__(self, __value: Any) -> str: ...
598+
def __mod__(self, __value: Any) -> str: ... # type: ignore
599599
@overload
600600
def __mul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ...
601601
@overload
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_?curses.color_pair
2+
xxlimited.Xxo.x_exports
3+
4+
# Exists at runtime, missing from stub
5+
socket.TCP_CONNECTION_INFO
6+
7+
(dbm.gnu)?
8+
(locale.bind_textdomain_codeset)?
9+
(locale.bindtextdomain)?
10+
(locale.dcgettext)
11+
(locale.dgettext)?
12+
(locale.gettext)?
13+
(locale.textdomain)?

tests/stubtest_allowlists/darwin.txt

-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ select.POLLMSG # system dependent
2727
(termios.[A-Z0-9_]+)?
2828

2929
# Exists at runtime, but missing from stubs
30-
distutils.msvccompiler.MSVCCompiler.get_msvc_paths
31-
distutils.msvccompiler.MSVCCompiler.set_path_env_var
32-
distutils.msvccompiler.MacroExpander
3330
mimetypes.MimeTypes.read_windows_registry
3431
selectors.DefaultSelector.fileno
3532
socket.PF_SYSTEM

tests/stubtest_allowlists/linux.txt

-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ socket.[A-Z0-9_]+
1515
errno.[A-Z0-9]+
1616

1717
# Exists at runtime, but missing from stubs
18-
distutils.msvccompiler.MSVCCompiler.get_msvc_paths
19-
distutils.msvccompiler.MSVCCompiler.set_path_env_var
20-
distutils.msvccompiler.MacroExpander
2118
mimetypes.MimeTypes.read_windows_registry
2219
selectors.DefaultSelector.fileno
2320
spwd.struct_spwd.sp_nam

tests/stubtest_allowlists/py310.txt

+6
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,9 @@ typing.NewType.__call__
183183
typing_extensions\.Final
184184
typing\.NamedTuple
185185
typing\.Annotated
186+
187+
# Removed in 3.12
188+
distutils\..*
189+
asyncore.dispatcher.addr
190+
asyncore.dispatcher.handle_accepted
191+
asynchat.find_prefix_at_end

tests/stubtest_allowlists/py311.txt

+6
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,9 @@ dataclasses.KW_ONLY
149149
typing.ParamSpec(Args|Kwargs).__origin__
150150
typing\.TypeVar\.__.*__
151151
typing\.ParamSpec\.__.*__
152+
153+
# Removed in 3.12
154+
distutils\..*
155+
asyncore.dispatcher.addr
156+
asyncore.dispatcher.handle_accepted
157+
asynchat.find_prefix_at_end

0 commit comments

Comments
 (0)