Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c28a77a
Update stdlib stubs for Python 3.15
JelleZijlstra May 7, 2026
d38cf68
Fix Python 3.15 stubtest coverage
JelleZijlstra May 7, 2026
de50b34
Expand Python 3.15 stdlib coverage
JelleZijlstra May 7, 2026
938b345
Fix Python 3.15 stub review issues
JelleZijlstra May 7, 2026
7d58087
fixes
JelleZijlstra May 8, 2026
00892f3
more fixes
JelleZijlstra May 8, 2026
39788e6
fix more
JelleZijlstra May 8, 2026
cec3aca
not you
JelleZijlstra May 8, 2026
3a20644
no stubtest for now
JelleZijlstra May 8, 2026
16fbcb9
no commit
JelleZijlstra May 8, 2026
12371f1
Merge remote-tracking branch 'upstream/main' into python315
JelleZijlstra May 8, 2026
0db9084
stubtest
JelleZijlstra May 8, 2026
44d2e56
Add Python 3.15 test infrastructure
JelleZijlstra May 8, 2026
b594b7e
Merge branch 'codex/python315-testing' into python315
JelleZijlstra May 8, 2026
8fdc247
Fix Python 3.15 stubtest guards
JelleZijlstra May 8, 2026
1140f0b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 8, 2026
f5589f6
Fix older stdlib stubtest after 3.15 updates
JelleZijlstra May 8, 2026
7720c6a
Merge remote-tracking branch 'origin/python315' into python315
JelleZijlstra May 8, 2026
4e7b6d7
Allow platform-dependent hashlib exports
JelleZijlstra May 8, 2026
a278ef4
Fix platform 3.15 stubtest allowlists
JelleZijlstra May 8, 2026
ac88edb
Make 3.15 allowlist entries optional
JelleZijlstra May 8, 2026
3c10c06
Relax shared 3.15 allowlist entries
JelleZijlstra May 8, 2026
09ce903
Merge upstream main into python315
JelleZijlstra May 8, 2026
c3d6741
Merge remote-tracking branch 'upstream/main' into python315
JelleZijlstra May 9, 2026
689f19b
Fix Python 3.15 CI after merge
JelleZijlstra May 9, 2026
d8dda00
Complete profiling collector methods
JelleZijlstra May 9, 2026
49c1fd6
Remove covered profiling allowlist entries
JelleZijlstra May 9, 2026
f4770a2
Fix base profiling export parameter
JelleZijlstra May 9, 2026
6ec21e1
Allowlist profiling sampling internals
JelleZijlstra May 9, 2026
10bb878
Fix remaining Python 3.15 stubtest failures
JelleZijlstra May 9, 2026
cc2f7d5
Merge upstream/main into python315
JelleZijlstra May 11, 2026
ba00d28
Organize Python 3.15 stubtest allowlists
JelleZijlstra May 11, 2026
6df830a
Guard NODEV on Python 3.15
JelleZijlstra May 11, 2026
e5d6c98
Merge remote-tracking branch 'upstream/main' into python315
JelleZijlstra May 11, 2026
3bd8325
Tighten Python 3.15 allowlist entries
JelleZijlstra May 13, 2026
e3a4134
Guard ctypes complex type codes
JelleZijlstra May 13, 2026
4e42234
Merge branch 'main' into python315
JelleZijlstra May 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add Python 3.15 test infrastructure
  • Loading branch information
JelleZijlstra committed May 8, 2026
commit 44d2e5686c4af75240b17fdb56e74af5f0ad619c
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
exclude:
# https://github.com/python/typeshed/issues/15694
- os: "windows-latest"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stubtest_stdlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
exclude:
# https://github.com/python/typeshed/issues/15694
- os: "windows-latest"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
strategy:
matrix:
platform: ["linux", "win32", "darwin"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"]
fail-fast: false
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -71,7 +71,9 @@ jobs:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
python-version: "3.15"
allow-prereleases: true
check-latest: true
- uses: astral-sh/setup-uv@v7
with:
version-file: "requirements-tests.txt"
Expand All @@ -83,6 +85,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: Add 3.15 once pyright CI can avoid installing third-party
# runtime dependency stacks that do not support Python 3.15 yet.
python-platform: ["Linux", "Windows", "Darwin"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
fail-fast: false
Expand Down
20 changes: 20 additions & 0 deletions lib/ts_utils/py315.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Helpers for Python 3.15 test infrastructure."""

# These stubs require runtime dependencies that do not install cleanly on Python 3.15 yet.
PY315_INCOMPATIBLE_RUNTIME_DEPENDENCIES = {
# Depend on numpy, which does not provide Python 3.15 wheels yet.
"JACK-Client",
"geopandas",
"hnswlib",
"networkx",
"pycocotools",
"resampy",
"shapely",
"tensorflow",
# Depends on referencing, which depends on rpds-py. rpds-py currently uses
# PyO3, which rejects Python 3.15.
"jsonschema",
# Depends on matplotlib, which depends on contourpy. contourpy does not
# provide Python 3.15 wheels yet.
"seaborn",
}
9 changes: 5 additions & 4 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ pyright==1.1.409

# Libraries used by our various scripts.
aiohttp==3.13.5
grpcio-tools>=1.76.0 # For grpc_tools.protoc
mypy-protobuf==5.0.0
grpcio-tools>=1.76.0; python_version < "3.15" # For grpc_tools.protoc
mypy-protobuf==5.0.0; python_version < "3.15"
packaging==26.0
pathspec>=1.1.1
pre-commit
# Required by create_baseline_stubs.py. Must match .pre-commit-config.yaml.
# Required by create_baseline_stubs.py.
# stubdefaulter depends on libcst, which does not yet install cleanly on Python 3.15.
ruff==0.15.8
stubdefaulter==0.1.0
stubdefaulter==0.1.0; python_version < "3.15"
termcolor>=2.3
tomli==2.4.1; python_version < "3.11"
tomlkit==0.14.0
Expand Down
10 changes: 6 additions & 4 deletions scripts/sync_protobuf/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@
import sys
from collections.abc import Iterable
from http.client import HTTPResponse
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path
from typing import TYPE_CHECKING
from urllib.request import urlopen
from zipfile import ZipFile

from mypy_protobuf.main import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
__version__ as mypy_protobuf__version__,
)
try:
_mypy_protobuf_version = version("mypy-protobuf")
except PackageNotFoundError:
_mypy_protobuf_version = "unavailable"

if TYPE_CHECKING:
from _typeshed import StrOrBytesPath, StrPath

MYPY_PROTOBUF_VERSION = mypy_protobuf__version__
MYPY_PROTOBUF_VERSION = _mypy_protobuf_version


def download_file(url: str, destination: Path) -> None:
Expand Down
18 changes: 0 additions & 18 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

importlib.abc.MetaPathFinder.find_spec # Not defined on the actual class, but expected to exist.
importlib.abc.PathEntryFinder.find_spec # Not defined on the actual class, but expected to exist.
tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion
tarfile.TarInfo.__slots__ # it's a big dictionary at runtime and the dictionary values are a bit long


Expand Down Expand Up @@ -457,17 +454,6 @@ typing(_extensions)?\.TextIO\.newlines
typing(_extensions)?\.IO\.__iter__
typing(_extensions)?\.IO\.__next__

# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
# to mark these as positional-only for compatibility with existing sub-classes.
typing(_extensions)?\.BinaryIO\.write
typing(_extensions)?\.IO\.read
typing(_extensions)?\.IO\.readline
typing(_extensions)?\.IO\.readlines
typing(_extensions)?\.IO\.seek
typing(_extensions)?\.IO\.truncate
typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines

types.MethodType.__closure__ # read-only but not actually a property; stubtest thinks it doesn't exist.
types.MethodType.__code__ # read-only but not actually a property; stubtest thinks it doesn't exist.
types.MethodType.__defaults__ # read-only but not actually a property; stubtest thinks it doesn't exist.
Expand Down Expand Up @@ -499,7 +485,3 @@ xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signatur
# Iterable classes that don't define __iter__ at runtime (usually iterable via __getitem__)
# These would ideally be special-cased by type checkers; see https://github.com/python/mypy/issues/2220
xml.etree.ElementTree.Element.__iter__

# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
posixpath.join
ntpath.join
25 changes: 25 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
_decimal.SPEC_VERSION
_pyrepl.fancy_termios
_pyrepl.unix_console
_pyrepl.unix_eventqueue
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
decimal.SPEC_VERSION
mmap.MS_ASYNC
mmap.MS_INVALIDATE
mmap.MS_SYNC
mmap.mmap.madvise
mmap.mmap.resize
os.NODEV
os.__all__
posix.NODEV
profiling.sampling.live_collector
profiling.sampling.live_collector.collector
profiling.sampling.live_collector.constants
profiling.sampling.live_collector.display
profiling.sampling.live_collector.trend_tracker
profiling.sampling.live_collector.widgets
readline.get_pre_input_hook
resource.RLIM_SAVED_CUR
resource.RLIM_SAVED_MAX
129 changes: 129 additions & 0 deletions stdlib/@tests/stubtest_allowlists/linux-py315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
_decimal
_pyrepl.fancy_termios
_pyrepl.unix_console
_pyrepl.unix_eventqueue
_socket.CAN_ISOTP_CHK_PAD_DATA
_socket.CAN_ISOTP_CHK_PAD_LEN
_socket.CAN_ISOTP_DEFAULT_EXT_ADDRESS
_socket.CAN_ISOTP_DEFAULT_FLAGS
_socket.CAN_ISOTP_DEFAULT_FRAME_TXTIME
_socket.CAN_ISOTP_DEFAULT_LL_MTU
_socket.CAN_ISOTP_DEFAULT_LL_TX_DL
_socket.CAN_ISOTP_DEFAULT_LL_TX_FLAGS
_socket.CAN_ISOTP_DEFAULT_PAD_CONTENT
_socket.CAN_ISOTP_DEFAULT_RECV_BS
_socket.CAN_ISOTP_DEFAULT_RECV_STMIN
_socket.CAN_ISOTP_DEFAULT_RECV_WFTMAX
_socket.CAN_ISOTP_EXTEND_ADDR
_socket.CAN_ISOTP_FORCE_RXSTMIN
_socket.CAN_ISOTP_FORCE_TXSTMIN
_socket.CAN_ISOTP_HALF_DUPLEX
_socket.CAN_ISOTP_LISTEN_MODE
_socket.CAN_ISOTP_LL_OPTS
_socket.CAN_ISOTP_OPTS
_socket.CAN_ISOTP_RECV_FC
_socket.CAN_ISOTP_RX_EXT_ADDR
_socket.CAN_ISOTP_RX_PADDING
_socket.CAN_ISOTP_RX_STMIN
_socket.CAN_ISOTP_SF_BROADCAST
_socket.CAN_ISOTP_TX_PADDING
_socket.CAN_ISOTP_TX_STMIN
_socket.CAN_ISOTP_WAIT_TX_DONE
_socket.IPV6_HDRINCL
_socket.SOL_CAN_ISOTP
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
# decimal falls back to _pydecimal with different runtime signatures.
decimal\..*
mmap.MS_ASYNC
mmap.MS_INVALIDATE
mmap.MS_SYNC
mmap.mmap.madvise
os.AT_NO_AUTOMOUNT
os.AT_STATX_DONT_SYNC
os.AT_STATX_FORCE_SYNC
os.AT_STATX_SYNC_AS_STAT
os.NODEV
os.STATX_ATIME
os.STATX_BASIC_STATS
os.STATX_BLOCKS
os.STATX_BTIME
os.STATX_CTIME
os.STATX_DIOALIGN
os.STATX_GID
os.STATX_INO
os.STATX_MNT_ID
os.STATX_MNT_ID_UNIQUE
os.STATX_MODE
os.STATX_MTIME
os.STATX_NLINK
os.STATX_SIZE
os.STATX_TYPE
os.STATX_UID
os.__all__
os._clearenv
os.statx
os.statx_result
posix.AT_NO_AUTOMOUNT
posix.AT_STATX_DONT_SYNC
posix.AT_STATX_FORCE_SYNC
posix.AT_STATX_SYNC_AS_STAT
posix.NODEV
posix.STATX_ATIME
posix.STATX_BASIC_STATS
posix.STATX_BLOCKS
posix.STATX_BTIME
posix.STATX_CTIME
posix.STATX_DIOALIGN
posix.STATX_GID
posix.STATX_INO
posix.STATX_MNT_ID
posix.STATX_MNT_ID_UNIQUE
posix.STATX_MODE
posix.STATX_MTIME
posix.STATX_NLINK
posix.STATX_SIZE
posix.STATX_TYPE
posix.STATX_UID
posix.statx
profiling.sampling.live_collector
profiling.sampling.live_collector.collector
profiling.sampling.live_collector.constants
profiling.sampling.live_collector.display
profiling.sampling.live_collector.trend_tracker
profiling.sampling.live_collector.widgets
readline.get_pre_input_hook
resource.RLIM_SAVED_CUR
resource.RLIM_SAVED_MAX
socket.CAN_ISOTP_CHK_PAD_DATA
socket.CAN_ISOTP_CHK_PAD_LEN
socket.CAN_ISOTP_DEFAULT_EXT_ADDRESS
socket.CAN_ISOTP_DEFAULT_FLAGS
socket.CAN_ISOTP_DEFAULT_FRAME_TXTIME
socket.CAN_ISOTP_DEFAULT_LL_MTU
socket.CAN_ISOTP_DEFAULT_LL_TX_DL
socket.CAN_ISOTP_DEFAULT_LL_TX_FLAGS
socket.CAN_ISOTP_DEFAULT_PAD_CONTENT
socket.CAN_ISOTP_DEFAULT_RECV_BS
socket.CAN_ISOTP_DEFAULT_RECV_STMIN
socket.CAN_ISOTP_DEFAULT_RECV_WFTMAX
socket.CAN_ISOTP_EXTEND_ADDR
socket.CAN_ISOTP_FORCE_RXSTMIN
socket.CAN_ISOTP_FORCE_TXSTMIN
socket.CAN_ISOTP_HALF_DUPLEX
socket.CAN_ISOTP_LISTEN_MODE
socket.CAN_ISOTP_LL_OPTS
socket.CAN_ISOTP_OPTS
socket.CAN_ISOTP_RECV_FC
socket.CAN_ISOTP_RX_EXT_ADDR
socket.CAN_ISOTP_RX_PADDING
socket.CAN_ISOTP_RX_STMIN
socket.CAN_ISOTP_SF_BROADCAST
socket.CAN_ISOTP_TX_PADDING
socket.CAN_ISOTP_TX_STMIN
socket.CAN_ISOTP_WAIT_TX_DONE
socket.IPV6_HDRINCL
socket.SOL_CAN_ISOTP
socket.__all__
30 changes: 29 additions & 1 deletion stdlib/@tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# New errors in Python 3.10
# =========================


# =========
# 3.10 only
# =========
Expand Down Expand Up @@ -134,6 +133,35 @@ importlib.abc.Traversable.open # Problematic protocol signature at runtime, see
typing_extensions.TypeAliasType.__call__


# =====
# <3.15
# =====

tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion


# =============================================================
# Allowlist entries that cannot or should not be fixed; <3.15
# =============================================================

# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
# to mark these as positional-only for compatibility with existing sub-classes.
typing(_extensions)?\.BinaryIO\.write
typing(_extensions)?\.IO\.read
typing(_extensions)?\.IO\.readline
typing(_extensions)?\.IO\.readlines
typing(_extensions)?\.IO\.seek
typing(_extensions)?\.IO\.truncate
typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines

# These have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
posixpath.join
ntpath.join


# ===============================================================
# Allowlist entries that cannot or should not be fixed; 3.10 only
# ===============================================================
Expand Down
30 changes: 29 additions & 1 deletion stdlib/@tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# New errors in Python 3.11
# =========================


# =======
# >= 3.11
# =======
Expand Down Expand Up @@ -108,6 +107,35 @@ typing_extensions.TypeAliasType.__call__
enum.Enum.__init__


# =====
# <3.15
# =====

tkinter.simpledialog.[A-Z_]+
tkinter.simpledialog.TclVersion
tkinter.simpledialog.TkVersion


# =============================================================
# Allowlist entries that cannot or should not be fixed; <3.15
# =============================================================

# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer
# to mark these as positional-only for compatibility with existing sub-classes.
typing(_extensions)?\.BinaryIO\.write
typing(_extensions)?\.IO\.read
typing(_extensions)?\.IO\.readline
typing(_extensions)?\.IO\.readlines
typing(_extensions)?\.IO\.seek
typing(_extensions)?\.IO\.truncate
typing(_extensions)?\.IO\.write
typing(_extensions)?\.IO\.writelines

# These have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812
posixpath.join
ntpath.join


# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.11
# =============================================================
Expand Down
Loading
Loading