Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
29 changes: 29 additions & 0 deletions stdlib/@tests/stubtest_allowlists/darwin-py315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# ============================================
# TODO: Allowlist entries that should be fixed
# ============================================

_decimal.SPEC_VERSION
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a TODO comment to all new allowlists?

_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
133 changes: 133 additions & 0 deletions stdlib/@tests/stubtest_allowlists/linux-py315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# ============================================
# TODO: Allowlist entries that should be fixed
# ============================================

# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
# decimal falls back to _pydecimal with different runtime signatures.
decimal\..*
_decimal
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently Ubuntu 3.15 on CI doesn't have the C version of decimal which seems a bit concerning.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python versions on GitHub are sometimes a bit concerning ...

_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_
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
Loading
Loading