Skip to content

Commit 7df870f

Browse files
authored
Run stubtest for Python 3.12 (#10253)
1 parent 03f1577 commit 7df870f

28 files changed

+711
-212
lines changed

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

tests/stubtest_allowlists/darwin-py310.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ _?curses.color_pair
1111
# ==========
1212
# Allowlist entries that cannot or should not be fixed
1313
# ==========
14-
15-
distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
_?curses.color_pair
2+
_curses.unget_wch
3+
_curses.window.get_wch
4+
_posixsubprocess.fork_exec
5+
_socket.ETHERTYPE_ARP
6+
_socket.ETHERTYPE_IP
7+
_socket.ETHERTYPE_IPV6
8+
_socket.ETHERTYPE_VLAN
9+
_socket.IP_ADD_SOURCE_MEMBERSHIP
10+
_socket.IP_BLOCK_SOURCE
11+
_socket.IP_DROP_SOURCE_MEMBERSHIP
12+
_socket.IP_PKTINFO
13+
_socket.IP_UNBLOCK_SOURCE
14+
curses.unget_wch
15+
curses.window.get_wch
16+
os.PRIO_DARWIN_BG
17+
os.PRIO_DARWIN_NONUI
18+
os.PRIO_DARWIN_PROCESS
19+
os.PRIO_DARWIN_THREAD
20+
posix.DirEntry.is_junction
21+
posix.PRIO_DARWIN_BG
22+
posix.PRIO_DARWIN_NONUI
23+
posix.PRIO_DARWIN_PROCESS
24+
posix.PRIO_DARWIN_THREAD
25+
socket.ETHERTYPE_ARP
26+
socket.ETHERTYPE_IP
27+
socket.ETHERTYPE_IPV6
28+
socket.ETHERTYPE_VLAN
29+
socket.IP_ADD_SOURCE_MEMBERSHIP
30+
socket.IP_BLOCK_SOURCE
31+
socket.IP_DROP_SOURCE_MEMBERSHIP
32+
socket.IP_PKTINFO
33+
socket.IP_UNBLOCK_SOURCE
34+
socket.TCP_CONNECTION_INFO
35+
syslog.LOG_MASK
36+
syslog.LOG_UPTO
37+
syslog.setlogmask
38+
tty.__all__
39+
tty.cfmakecbreak
40+
tty.cfmakeraw
41+
xxlimited.Xxo.x_exports
42+
43+
(dbm.gnu)?
44+
(locale.bind_textdomain_codeset)?
45+
(locale.bindtextdomain)?
46+
(locale.dcgettext)
47+
(locale.dgettext)?
48+
(locale.gettext)?
49+
(locale.textdomain)?

tests/stubtest_allowlists/darwin-py37.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ pwd.getpwnam
55
# Allowlist entries that cannot or should not be fixed
66
# ==========
77

8-
distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below
98
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154

tests/stubtest_allowlists/darwin-py38.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/stubtest_allowlists/darwin-py39.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/stubtest_allowlists/darwin.txt

Lines changed: 0 additions & 3 deletions
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-py310.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ signal.sigwaitinfo
1818
# ==========
1919
# Allowlist entries that cannot or should not be fixed
2020
# ==========
21-
22-
distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
_?curses.color_pair
2+
_posixsubprocess.fork_exec
3+
(os|posix).CLONE_FILES
4+
(os|posix).CLONE_FS
5+
(os|posix).CLONE_NEWCGROUP
6+
(os|posix).CLONE_NEWIPC
7+
(os|posix).CLONE_NEWNET
8+
(os|posix).CLONE_NEWNS
9+
(os|posix).CLONE_NEWPID
10+
(os|posix).CLONE_NEWUSER
11+
(os|posix).CLONE_NEWUTS
12+
(os|posix).CLONE_SIGHAND
13+
(os|posix).CLONE_SYSVSEM
14+
(os|posix).CLONE_THREAD
15+
(os|posix).CLONE_VM
16+
(os|posix).DirEntry.is_junction
17+
(os|posix).EFD_CLOEXEC
18+
(os|posix).EFD_NONBLOCK
19+
(os|posix).EFD_SEMAPHORE
20+
(os|posix).eventfd
21+
(os|posix).eventfd_read
22+
(os|posix).eventfd_write
23+
(os|posix).sendfile
24+
(os|posix).setns
25+
(os|posix).setresgid
26+
(os|posix).setresuid
27+
(os|posix).splice
28+
(os|posix).SPLICE_F_MORE
29+
(os|posix).SPLICE_F_MOVE
30+
(os|posix).SPLICE_F_NONBLOCK
31+
(os|posix).unshare
32+
fcntl.FICLONE
33+
fcntl.FICLONERANGE
34+
mmap.MAP_STACK
35+
resource.prlimit
36+
signal.sigtimedwait
37+
signal.sigwaitinfo
38+
ssl.OP_ENABLE_KTLS
39+
ssl.Options.OP_ENABLE_KTLS
40+
syslog.LOG_MASK
41+
syslog.LOG_UPTO
42+
syslog.setlogmask
43+
tty.__all__
44+
tty.cfmakecbreak
45+
tty.cfmakeraw
46+
xxlimited.Xxo.x_exports

0 commit comments

Comments
 (0)