Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 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
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
3 changes: 3 additions & 0 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,9 @@ unittest.runner._WritelnDecorator.write # Methods that come from __getattr__()
urllib.response.addbase.write # Methods that come from __getattr__() at runtime
urllib.response.addbase.writelines # Methods that come from __getattr__() at runtime

(hashlib.__all__)? # scrypt depends on how OpenSSL was built.
(pydoc.Doc.getdocloc)? # Runtime default is an installation-specific stdlib path.

_?weakref\.CallableProxyType\.__getattr__ # Should have all attributes of proxy
_?weakref\.(ref|ReferenceType)\.__init__ # C implementation has incorrect signature
_?weakref\.(ref|ReferenceType)\.__call__ # C function default annotation is wrong
Expand Down
31 changes: 17 additions & 14 deletions stdlib/@tests/stubtest_allowlists/darwin-py315.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# ============================================
# TODO: Allowlist entries that should be fixed
# ============================================
# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.15
# =============================================================

_pyrepl.fancy_termios
_pyrepl.unix_console
_pyrepl.unix_eventqueue
# Depends on the ncurses version used to build Python.
(_curses.BUTTON5_CLICKED)?
(_curses.BUTTON5_DOUBLE_CLICKED)?
(_curses.BUTTON5_PRESSED)?
(_curses.BUTTON5_RELEASED)?
(_curses.BUTTON5_TRIPLE_CLICKED)?

# Platform/build availability differs across Darwin builds.
(_socket.SO_BINDTODEVICE)?
(errno.ENOTCAPABLE)?

# Runtime metadata for new ctypes complex types is not useful for static checking.
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
os.NODEV
os.__all__
posix.NODEV
readline.get_pre_input_hook


# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.15
# =============================================================
# Depends on how readline was built.
readline.get_pre_input_hook

# Internal implementation details of the sampling profiler.
profiling.sampling.live_collector
Expand Down
1 change: 1 addition & 0 deletions stdlib/@tests/stubtest_allowlists/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ tkinter.Tk.deletefilehandler # Methods that come from __getattr__() at runtime

# These entries looks like a `setup-python` bug:
(dbm.gnu)?
(mmap.mmap.resize)?
(_?locale.bind_textdomain_codeset)?
(_?locale.bindtextdomain)?
(_?locale.dcgettext)?
Expand Down
26 changes: 13 additions & 13 deletions stdlib/@tests/stubtest_allowlists/linux-py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,10 @@
# 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
_pyrepl.fancy_termios
_pyrepl.unix_console
_pyrepl.unix_eventqueue
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_
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
Expand All @@ -41,7 +30,6 @@ 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
Expand All @@ -59,13 +47,25 @@ posix.STATX_SIZE
posix.STATX_TYPE
posix.STATX_UID
posix.statx
readline.get_pre_input_hook


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

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

# Runtime metadata for new ctypes complex types is not useful for static checking.
ctypes.c_double_complex._type_
ctypes.c_float_complex._type_
ctypes.c_longdouble_complex._type_

# Depends on how readline was built.
readline.get_pre_input_hook

# Internal implementation details of the sampling profiler.
profiling.sampling.live_collector
profiling.sampling.live_collector.collector
Expand Down
233 changes: 129 additions & 104 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,143 +12,41 @@ _frozen_importlib_external.SourceFileLoader.source_to_code
_frozen_importlib_external.SourceLoader.source_to_code
_frozen_importlib_external._LoaderBasics.load_module
_frozen_importlib_external.cache_from_source
_pyrepl.base_eventqueue
_pyrepl.commands
_pyrepl.completing_reader
_pyrepl.console
_pyrepl.content
_pyrepl.fancycompleter
_pyrepl.historical_reader
_pyrepl.input
_pyrepl.keymap
_pyrepl.layout
_pyrepl.main
_pyrepl.pager
_pyrepl.reader
_pyrepl.readline
_pyrepl.render
_pyrepl.simple_interact
_pyrepl.terminfo
_pyrepl.trace
_pyrepl.types
_pyrepl.utils
_pyrepl.windows_console
_pyrepl.windows_eventqueue
_struct.Struct.pack_into
_struct.pack
_struct.pack_into
_thread.RLock.__exit__
_thread.lock.__exit__
annotationlib.ForwardRef.__arg__
annotationlib.ForwardRef.__ast_node__
annotationlib.ForwardRef.__cell__
annotationlib.ForwardRef.__code__
annotationlib.ForwardRef.__extra_names__
annotationlib.ForwardRef.__globals__
annotationlib.ForwardRef.__init_subclass__
annotationlib.ForwardRef.__owner__
annotationlib.ForwardRef.__stringifier_dict__
ast.type_param.__init__
# base64.b64decode uses a private sentinel list as the default for parameters whose public types are bool/buffer.
base64.b64decode
codecs.backslashreplace_errors
codecs.ignore_errors
codecs.namereplace_errors
codecs.replace_errors
codecs.strict_errors
codecs.xmlcharrefreplace_errors
concurrent.interpreters._crossinterp.UNBOUND_ERROR
concurrent.interpreters._crossinterp.UNBOUND_REMOVE
concurrent.interpreters._crossinterp.UnboundItem.singleton
concurrent.interpreters._crossinterp.classonly
concurrent.interpreters._crossinterp.classonly.__class_getitem__
concurrent.interpreters._crossinterp.classonly.__func__
concurrent.interpreters._crossinterp.classonly.__get__
concurrent.interpreters._crossinterp.classonly.__init__
concurrent.interpreters._crossinterp.classonly.__isabstractmethod__
concurrent.interpreters._crossinterp.classonly.__set_name__
concurrent.interpreters._crossinterp.classonly.__wrapped__
copy.deepcopy
dataclasses._MISSING_TYPE
dataclasses.MISSING
dataclasses.field
doctest.DocTestRunner.report_skip
enum.__all__
enum.auto.__init__
enum.auto.value
functools.partialmethod.__new__
http.HTTPMethod.description
importlib._abc.Loader.load_module
importlib._bootstrap_external.NamespacePath
importlib.abc.InspectLoader.source_to_code
importlib.abc.MetaPathFinder.discover
importlib.abc.PathEntryFinder.discover
importlib.resources._common.files
importlib.resources._common.package_to_anchor
importlib.resources.abc.Traversable.open
inspect._ParameterKind.description
io.Reader.__class_getitem__
io.Reader.read
io.Writer.__class_getitem__
io.Writer.write
mailbox.Mailbox.__enter__
mailbox.Mailbox.__exit__
mailbox._ProxyFile.__class_getitem__
multiprocessing.managers.BaseListProxy.clear
multiprocessing.managers.BaseListProxy.copy
multiprocessing.managers._BaseDictProxy.__iter__
multiprocessing.managers._BaseDictProxy.__len__
multiprocessing.managers._BaseDictProxy.__reversed__
multiprocessing.managers._BaseDictProxy.clear
multiprocessing.managers._BaseDictProxy.copy
multiprocessing.managers._BaseDictProxy.items
multiprocessing.managers._BaseDictProxy.keys
multiprocessing.managers._BaseDictProxy.popitem
multiprocessing.managers._BaseDictProxy.values
multiprocessing.managers._BaseSetProxy.__iter__
multiprocessing.managers._BaseSetProxy.__len__
multiprocessing.managers._BaseSetProxy.clear
multiprocessing.managers._BaseSetProxy.copy
multiprocessing.managers._BaseSetProxy.pop
multiprocessing.process.BaseProcess.__init__
sre_compile
sre_constants
sre_parse
sys.__jit
sys._monitoring
sys.last_exc
threading.Condition.locked
tkinter.Image.__iter__
tkinter.Misc.__iter__
tkinter.font.Font.__iter__
tkinter.simpledialog.__all__
types.MappingProxyType.get
types.SimpleNamespace.__delattr__
types.SimpleNamespace.__setattr__
types.UnionType.__class_getitem__
types.UnionType.__mro_entries__
types.UnionType.__name__
types.UnionType.__qualname__
typing.LiteralString
typing.NewType.__mro_entries__
typing.ParamSpec.__mro_entries__
typing.ParamSpecArgs.__mro_entries__
typing.ParamSpecKwargs.__mro_entries__
typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__
typing.TypeVar.__mro_entries__
typing.TypeVarTuple.__mro_entries__
typing.Union
typing._SpecialForm.__mro_entries__
typing_extensions.__all__
typing_extensions.Protocol
xml.etree.ElementTree.__all__

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

# runtime default is a list object used as a sentinel
base64.b64decode
urllib.parse.urlunparse
urllib.parse.urlunsplit

Expand Down Expand Up @@ -191,3 +89,130 @@ tkinter.Pack.content
tkinter.Pack.pack_content
tkinter.Place.content
tkinter.Place.place_content


# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.14
# =============================================================

# Undocumented private attributes
.*\.ForwardRef\.__arg__
.*\.ForwardRef\.__ast_node__
.*\.ForwardRef\.__cell__
.*\.ForwardRef\.__code__
.*\.ForwardRef\.__extra_names__
.*\.ForwardRef\.__globals__
.*\.ForwardRef\.__init_subclass__
.*\.ForwardRef\.__owner__
.*\.ForwardRef\.__stringifier_dict__

# Runtime AST node runtime constructor behaviour is too loose.
# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378).
# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858).
_?ast.type_param.__init__

# Decorator approximated by classmethod
concurrent.interpreters._crossinterp.classonly.*
# Method using this decorator
concurrent.interpreters._crossinterp.UnboundItem.singleton

# object() sentinels at runtime represented by NewTypes in the stubs
concurrent.interpreters._crossinterp.UNBOUND_ERROR
concurrent.interpreters._crossinterp.UNBOUND_REMOVE

# Assigning `__new__` causes `func` not to get recognized.
functools.partialmethod.__new__

# These protocols use ABC hackery at runtime.
(io|typing_extensions)\.Reader\.__class_getitem__
(io|typing_extensions)\.Reader\.read
(io|typing_extensions)\.Writer\.__class_getitem__
(io|typing_extensions)\.Writer\.write

# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
# but have more precise (accurate) signatures in the stub.
multiprocessing.managers.BaseListProxy.clear
multiprocessing.managers.BaseListProxy.copy
multiprocessing.managers._BaseDictProxy.__reversed__
multiprocessing.managers._BaseSetProxy.__iter__
multiprocessing.managers._BaseSetProxy.__len__
multiprocessing.managers._BaseSetProxy.clear
multiprocessing.managers._BaseSetProxy.copy
multiprocessing.managers._BaseSetProxy.pop

# Union and UnionType are aliases in 3.14 but type checkers need some changes.
typing.Union
types.UnionType.__class_getitem__
types.UnionType.__mro_entries__
types.UnionType.__name__
types.UnionType.__qualname__


# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.13
# =============================================================

_pyrepl\..+ # The internal implementation of the REPL on py313+; not for public consumption
codecs.backslashreplace_errors # Runtime incorrectly has `self`
codecs.ignore_errors # Runtime incorrectly has `self`
codecs.namereplace_errors # Runtime incorrectly has `self`
codecs.replace_errors # Runtime incorrectly has `self`
codecs.strict_errors # Runtime incorrectly has `self`
codecs.xmlcharrefreplace_errors # Runtime incorrectly has `self`

# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
# but have more precise (accurate) signatures in the stub.
multiprocessing.managers._BaseDictProxy.__iter__
multiprocessing.managers._BaseDictProxy.__len__
multiprocessing.managers._BaseDictProxy.clear
multiprocessing.managers._BaseDictProxy.copy
multiprocessing.managers._BaseDictProxy.items
multiprocessing.managers._BaseDictProxy.keys
multiprocessing.managers._BaseDictProxy.popitem
multiprocessing.managers._BaseDictProxy.values

# To match `dict`, we lie about the runtime, but use overloads to match the correct behavior.
types.MappingProxyType.get

typing_extensions.Protocol # Super-special typing primitive


# =============================================================
# Allowlist entries that cannot or should not be fixed; >= 3.12
# =============================================================

# Deprecated argument is supported at runtime by renaming it through a decorator.
importlib.resources._common.files

sys._monitoring # Doesn't really exist. See comments in the stub.
sys.__jit # Similar to sys._monitoring
sys.last_exc # Not always defined.

# Types that require `__setattr__` and `__delattr__` for typing purposes.
types.SimpleNamespace.__delattr__
types.SimpleNamespace.__setattr__

# These only exist to give a better error message if you try to subclass an instance.
typing.ParamSpec.__mro_entries__
typing.ParamSpecArgs.__mro_entries__
typing.ParamSpecKwargs.__mro_entries__
typing.TypeVar.__mro_entries__
typing.TypeVarTuple.__mro_entries__

# These exist at runtime because the protocol uses PEP 695 syntax in CPython.
typing.SupportsAbs.__type_params__
typing.SupportsRound.__type_params__


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

enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
enum.auto.value # The stub for enum.auto is nothing like the implementation
http.HTTPMethod.description # Mutable instance attribute at runtime but we pretend it's a property
importlib.resources.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
inspect._ParameterKind.description # Still exists, but stubtest can't see it
typing.LiteralString # Super-special typing primitive
typing.NewType.__mro_entries__ # Only exists for an error message.
typing._SpecialForm.__mro_entries__ # Super-special typing primitive
Loading
Loading