Skip to content

Commit ba00d28

Browse files
committed
Organize Python 3.15 stubtest allowlists
1 parent cc2f7d5 commit ba00d28

6 files changed

Lines changed: 170 additions & 133 deletions

File tree

stdlib/@tests/stubtest_allowlists/darwin-py315.txt

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
1-
# ============================================
2-
# TODO: Allowlist entries that should be fixed
3-
# ============================================
1+
# =============================================================
2+
# Allowlist entries that cannot or should not be fixed; >= 3.15
3+
# =============================================================
44

5-
_pyrepl.fancy_termios
6-
_pyrepl.unix_console
7-
_pyrepl.unix_eventqueue
5+
# Depends on the ncurses version used to build Python.
86
(_curses.BUTTON5_CLICKED)?
97
(_curses.BUTTON5_DOUBLE_CLICKED)?
108
(_curses.BUTTON5_PRESSED)?
119
(_curses.BUTTON5_RELEASED)?
1210
(_curses.BUTTON5_TRIPLE_CLICKED)?
11+
12+
# Platform/build availability differs across Darwin builds.
1313
(_socket.SO_BINDTODEVICE)?
14+
(errno.ENOTCAPABLE)?
15+
16+
# Runtime metadata for new ctypes complex types is not useful for static checking.
1417
ctypes.c_double_complex._type_
1518
ctypes.c_float_complex._type_
1619
ctypes.c_longdouble_complex._type_
17-
(errno.ENOTCAPABLE)?
18-
os.NODEV
19-
os.__all__
20-
posix.NODEV
21-
readline.get_pre_input_hook
22-
2320

24-
# =============================================================
25-
# Allowlist entries that cannot or should not be fixed; >= 3.15
26-
# =============================================================
21+
# Depends on how readline was built.
22+
readline.get_pre_input_hook
2723

2824
# Internal implementation details of the sampling profiler.
2925
profiling.sampling.live_collector

stdlib/@tests/stubtest_allowlists/linux-py315.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,10 @@
22
# TODO: Allowlist entries that should be fixed
33
# ============================================
44

5-
# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
6-
# decimal falls back to _pydecimal with different runtime signatures.
7-
decimal\..*
8-
_decimal
9-
_pyrepl.fancy_termios
10-
_pyrepl.unix_console
11-
_pyrepl.unix_eventqueue
12-
ctypes.c_double_complex._type_
13-
ctypes.c_float_complex._type_
14-
ctypes.c_longdouble_complex._type_
155
os.AT_NO_AUTOMOUNT
166
os.AT_STATX_DONT_SYNC
177
os.AT_STATX_FORCE_SYNC
188
os.AT_STATX_SYNC_AS_STAT
19-
os.NODEV
209
os.STATX_ATIME
2110
os.STATX_BASIC_STATS
2211
os.STATX_BLOCKS
@@ -41,7 +30,6 @@ posix.AT_NO_AUTOMOUNT
4130
posix.AT_STATX_DONT_SYNC
4231
posix.AT_STATX_FORCE_SYNC
4332
posix.AT_STATX_SYNC_AS_STAT
44-
posix.NODEV
4533
posix.STATX_ATIME
4634
posix.STATX_BASIC_STATS
4735
posix.STATX_BLOCKS
@@ -59,13 +47,25 @@ posix.STATX_SIZE
5947
posix.STATX_TYPE
6048
posix.STATX_UID
6149
posix.statx
62-
readline.get_pre_input_hook
6350

6451

6552
# =============================================================
6653
# Allowlist entries that cannot or should not be fixed; >= 3.15
6754
# =============================================================
6855

56+
# GitHub Actions' Python 3.15 Linux build currently lacks _decimal, so
57+
# decimal falls back to _pydecimal with different runtime signatures.
58+
decimal\..*
59+
_decimal
60+
61+
# Runtime metadata for new ctypes complex types is not useful for static checking.
62+
ctypes.c_double_complex._type_
63+
ctypes.c_float_complex._type_
64+
ctypes.c_longdouble_complex._type_
65+
66+
# Depends on how readline was built.
67+
readline.get_pre_input_hook
68+
6969
# Internal implementation details of the sampling profiler.
7070
profiling.sampling.live_collector
7171
profiling.sampling.live_collector.collector

stdlib/@tests/stubtest_allowlists/py315.txt

Lines changed: 129 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -12,140 +12,41 @@ _frozen_importlib_external.SourceFileLoader.source_to_code
1212
_frozen_importlib_external.SourceLoader.source_to_code
1313
_frozen_importlib_external._LoaderBasics.load_module
1414
_frozen_importlib_external.cache_from_source
15-
_pyrepl.base_eventqueue
16-
_pyrepl.commands
17-
_pyrepl.completing_reader
18-
_pyrepl.console
19-
_pyrepl.content
20-
_pyrepl.fancycompleter
21-
_pyrepl.historical_reader
22-
_pyrepl.input
23-
_pyrepl.keymap
24-
_pyrepl.layout
25-
_pyrepl.main
26-
_pyrepl.pager
27-
_pyrepl.reader
28-
_pyrepl.readline
29-
_pyrepl.render
30-
_pyrepl.simple_interact
31-
_pyrepl.terminfo
32-
_pyrepl.trace
33-
_pyrepl.types
34-
_pyrepl.utils
35-
_pyrepl.windows_console
36-
_pyrepl.windows_eventqueue
3715
_struct.Struct.pack_into
3816
_struct.pack
3917
_struct.pack_into
4018
_thread.RLock.__exit__
4119
_thread.lock.__exit__
42-
annotationlib.ForwardRef.__arg__
43-
annotationlib.ForwardRef.__ast_node__
44-
annotationlib.ForwardRef.__cell__
45-
annotationlib.ForwardRef.__code__
46-
annotationlib.ForwardRef.__extra_names__
47-
annotationlib.ForwardRef.__globals__
48-
annotationlib.ForwardRef.__init_subclass__
49-
annotationlib.ForwardRef.__owner__
50-
annotationlib.ForwardRef.__stringifier_dict__
51-
ast.type_param.__init__
52-
# base64.b64decode uses a private sentinel list as the default for parameters whose public types are bool/buffer.
53-
base64.b64decode
54-
codecs.backslashreplace_errors
55-
codecs.ignore_errors
56-
codecs.namereplace_errors
57-
codecs.replace_errors
58-
codecs.strict_errors
59-
codecs.xmlcharrefreplace_errors
60-
concurrent.interpreters._crossinterp.UNBOUND_ERROR
61-
concurrent.interpreters._crossinterp.UNBOUND_REMOVE
62-
concurrent.interpreters._crossinterp.UnboundItem.singleton
63-
concurrent.interpreters._crossinterp.classonly
64-
concurrent.interpreters._crossinterp.classonly.__class_getitem__
65-
concurrent.interpreters._crossinterp.classonly.__func__
66-
concurrent.interpreters._crossinterp.classonly.__get__
67-
concurrent.interpreters._crossinterp.classonly.__init__
68-
concurrent.interpreters._crossinterp.classonly.__isabstractmethod__
69-
concurrent.interpreters._crossinterp.classonly.__set_name__
70-
concurrent.interpreters._crossinterp.classonly.__wrapped__
7120
copy.deepcopy
7221
dataclasses._MISSING_TYPE
7322
dataclasses.MISSING
7423
dataclasses.field
7524
doctest.DocTestRunner.report_skip
7625
enum.__all__
77-
enum.auto.__init__
78-
enum.auto.value
79-
functools.partialmethod.__new__
80-
http.HTTPMethod.description
8126
importlib._abc.Loader.load_module
8227
importlib._bootstrap_external.NamespacePath
8328
importlib.abc.InspectLoader.source_to_code
8429
importlib.abc.MetaPathFinder.discover
8530
importlib.abc.PathEntryFinder.discover
86-
importlib.resources._common.files
8731
importlib.resources._common.package_to_anchor
88-
importlib.resources.abc.Traversable.open
89-
inspect._ParameterKind.description
90-
io.Reader.__class_getitem__
91-
io.Reader.read
92-
io.Writer.__class_getitem__
93-
io.Writer.write
9432
mailbox.Mailbox.__enter__
9533
mailbox.Mailbox.__exit__
9634
mailbox._ProxyFile.__class_getitem__
97-
multiprocessing.managers.BaseListProxy.clear
98-
multiprocessing.managers.BaseListProxy.copy
99-
multiprocessing.managers._BaseDictProxy.__iter__
100-
multiprocessing.managers._BaseDictProxy.__len__
101-
multiprocessing.managers._BaseDictProxy.__reversed__
102-
multiprocessing.managers._BaseDictProxy.clear
103-
multiprocessing.managers._BaseDictProxy.copy
104-
multiprocessing.managers._BaseDictProxy.items
105-
multiprocessing.managers._BaseDictProxy.keys
106-
multiprocessing.managers._BaseDictProxy.popitem
107-
multiprocessing.managers._BaseDictProxy.values
108-
multiprocessing.managers._BaseSetProxy.__iter__
109-
multiprocessing.managers._BaseSetProxy.__len__
110-
multiprocessing.managers._BaseSetProxy.clear
111-
multiprocessing.managers._BaseSetProxy.copy
112-
multiprocessing.managers._BaseSetProxy.pop
11335
multiprocessing.process.BaseProcess.__init__
114-
sys.__jit
115-
sys._monitoring
116-
sys.last_exc
11736
threading.Condition.locked
11837
tkinter.Image.__iter__
11938
tkinter.Misc.__iter__
12039
tkinter.font.Font.__iter__
12140
tkinter.simpledialog.__all__
122-
types.MappingProxyType.get
123-
types.SimpleNamespace.__delattr__
124-
types.SimpleNamespace.__setattr__
125-
types.UnionType.__class_getitem__
126-
types.UnionType.__mro_entries__
127-
types.UnionType.__name__
128-
types.UnionType.__qualname__
129-
typing.LiteralString
130-
typing.NewType.__mro_entries__
131-
typing.ParamSpec.__mro_entries__
132-
typing.ParamSpecArgs.__mro_entries__
133-
typing.ParamSpecKwargs.__mro_entries__
134-
typing.SupportsAbs.__type_params__
135-
typing.SupportsRound.__type_params__
136-
typing.TypeVar.__mro_entries__
137-
typing.TypeVarTuple.__mro_entries__
138-
typing.Union
139-
typing._SpecialForm.__mro_entries__
14041
typing_extensions.__all__
141-
typing_extensions.Protocol
14242
xml.etree.ElementTree.__all__
14343

14444
# =============================================================
145-
# Allowlist entries that cannot or should not be fixed; >=3.15
45+
# Allowlist entries that cannot or should not be fixed; >= 3.15
14646
# =============================================================
14747

14848
# runtime default is a list object used as a sentinel
49+
base64.b64decode
14950
urllib.parse.urlunparse
15051
urllib.parse.urlunsplit
15152

@@ -184,3 +85,130 @@ profiling.sampling.sample
18485
tkinter.Grid.content
18586
tkinter.Pack.content
18687
tkinter.Place.content
88+
89+
90+
# =============================================================
91+
# Allowlist entries that cannot or should not be fixed; >= 3.14
92+
# =============================================================
93+
94+
# Undocumented private attributes
95+
.*\.ForwardRef\.__arg__
96+
.*\.ForwardRef\.__ast_node__
97+
.*\.ForwardRef\.__cell__
98+
.*\.ForwardRef\.__code__
99+
.*\.ForwardRef\.__extra_names__
100+
.*\.ForwardRef\.__globals__
101+
.*\.ForwardRef\.__init_subclass__
102+
.*\.ForwardRef\.__owner__
103+
.*\.ForwardRef\.__stringifier_dict__
104+
105+
# Runtime AST node runtime constructor behaviour is too loose.
106+
# For static typing, the loose behaviour is undesirable (https://github.com/python/typeshed/issues/8378).
107+
# For the runtime, the loose behaviour is deprecated in Python 3.13 (https://github.com/python/cpython/issues/105858).
108+
_?ast.type_param.__init__
109+
110+
# Decorator approximated by classmethod
111+
concurrent.interpreters._crossinterp.classonly.*
112+
# Method using this decorator
113+
concurrent.interpreters._crossinterp.UnboundItem.singleton
114+
115+
# object() sentinels at runtime represented by NewTypes in the stubs
116+
concurrent.interpreters._crossinterp.UNBOUND_ERROR
117+
concurrent.interpreters._crossinterp.UNBOUND_REMOVE
118+
119+
# Assigning `__new__` causes `func` not to get recognized.
120+
functools.partialmethod.__new__
121+
122+
# These protocols use ABC hackery at runtime.
123+
(io|typing_extensions)\.Reader\.__class_getitem__
124+
(io|typing_extensions)\.Reader\.read
125+
(io|typing_extensions)\.Writer\.__class_getitem__
126+
(io|typing_extensions)\.Writer\.write
127+
128+
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
129+
# but have more precise (accurate) signatures in the stub.
130+
multiprocessing.managers.BaseListProxy.clear
131+
multiprocessing.managers.BaseListProxy.copy
132+
multiprocessing.managers._BaseDictProxy.__reversed__
133+
multiprocessing.managers._BaseSetProxy.__iter__
134+
multiprocessing.managers._BaseSetProxy.__len__
135+
multiprocessing.managers._BaseSetProxy.clear
136+
multiprocessing.managers._BaseSetProxy.copy
137+
multiprocessing.managers._BaseSetProxy.pop
138+
139+
# Union and UnionType are aliases in 3.14 but type checkers need some changes.
140+
typing.Union
141+
types.UnionType.__class_getitem__
142+
types.UnionType.__mro_entries__
143+
types.UnionType.__name__
144+
types.UnionType.__qualname__
145+
146+
147+
# =============================================================
148+
# Allowlist entries that cannot or should not be fixed; >= 3.13
149+
# =============================================================
150+
151+
_pyrepl\..+ # The internal implementation of the REPL on py313+; not for public consumption
152+
codecs.backslashreplace_errors # Runtime incorrectly has `self`
153+
codecs.ignore_errors # Runtime incorrectly has `self`
154+
codecs.namereplace_errors # Runtime incorrectly has `self`
155+
codecs.replace_errors # Runtime incorrectly has `self`
156+
codecs.strict_errors # Runtime incorrectly has `self`
157+
codecs.xmlcharrefreplace_errors # Runtime incorrectly has `self`
158+
159+
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
160+
# but have more precise (accurate) signatures in the stub.
161+
multiprocessing.managers._BaseDictProxy.__iter__
162+
multiprocessing.managers._BaseDictProxy.__len__
163+
multiprocessing.managers._BaseDictProxy.clear
164+
multiprocessing.managers._BaseDictProxy.copy
165+
multiprocessing.managers._BaseDictProxy.items
166+
multiprocessing.managers._BaseDictProxy.keys
167+
multiprocessing.managers._BaseDictProxy.popitem
168+
multiprocessing.managers._BaseDictProxy.values
169+
170+
# To match `dict`, we lie about the runtime, but use overloads to match the correct behavior.
171+
types.MappingProxyType.get
172+
173+
typing_extensions.Protocol # Super-special typing primitive
174+
175+
176+
# =============================================================
177+
# Allowlist entries that cannot or should not be fixed; >= 3.12
178+
# =============================================================
179+
180+
# Deprecated argument is supported at runtime by renaming it through a decorator.
181+
importlib.resources._common.files
182+
183+
sys._monitoring # Doesn't really exist. See comments in the stub.
184+
sys.__jit # Similar to sys._monitoring
185+
sys.last_exc # Not always defined.
186+
187+
# Types that require `__setattr__` and `__delattr__` for typing purposes.
188+
types.SimpleNamespace.__delattr__
189+
types.SimpleNamespace.__setattr__
190+
191+
# These only exist to give a better error message if you try to subclass an instance.
192+
typing.ParamSpec.__mro_entries__
193+
typing.ParamSpecArgs.__mro_entries__
194+
typing.ParamSpecKwargs.__mro_entries__
195+
typing.TypeVar.__mro_entries__
196+
typing.TypeVarTuple.__mro_entries__
197+
198+
# These exist at runtime because the protocol uses PEP 695 syntax in CPython.
199+
typing.SupportsAbs.__type_params__
200+
typing.SupportsRound.__type_params__
201+
202+
203+
# =============================================================
204+
# Allowlist entries that cannot or should not be fixed; >= 3.11
205+
# =============================================================
206+
207+
enum.auto.__init__ # The stub for enum.auto is nothing like the implementation
208+
enum.auto.value # The stub for enum.auto is nothing like the implementation
209+
http.HTTPMethod.description # Mutable instance attribute at runtime but we pretend it's a property
210+
importlib.resources.abc.Traversable.open # Problematic protocol signature at runtime, see source code comments.
211+
inspect._ParameterKind.description # Still exists, but stubtest can't see it
212+
typing.LiteralString # Super-special typing primitive
213+
typing.NewType.__mro_entries__ # Only exists for an error message.
214+
typing._SpecialForm.__mro_entries__ # Super-special typing primitive

stdlib/@tests/stubtest_allowlists/win32-py315.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# TODO: Allowlist entries that should be fixed
33
# ============================================
44

5-
(_decimal.SPEC_VERSION)?
65
_winapi.DeregisterEventSource
76
_winapi.EVENTLOG_AUDIT_FAILURE
87
_winapi.EVENTLOG_AUDIT_SUCCESS
@@ -13,6 +12,17 @@ _winapi.EVENTLOG_WARNING_TYPE
1312
_winapi.GetOEMCP
1413
_winapi.RegisterEventSource
1514
_winapi.ReportEvent
16-
asyncio.windows_events.IocpProactor.finish_socket_func
17-
(decimal.SPEC_VERSION)?
1815
winreg.DeleteTree
16+
17+
18+
# =============================================================
19+
# Allowlist entries that cannot or should not be fixed; >= 3.15
20+
# =============================================================
21+
22+
# Depends on whether the C _decimal extension or pure-Python fallback is used.
23+
(_decimal.SPEC_VERSION)?
24+
(decimal.SPEC_VERSION)?
25+
26+
# Undocumented internal method, not really for public consumption.
27+
# Hard to add types for unless we add stubs for the undocumented _overlapped module.
28+
asyncio.windows_events.IocpProactor.finish_socket_func

0 commit comments

Comments
 (0)