Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 88c7f96

Browse files
authored
Run stubtest on py313 in CI (#11987)
1 parent e2e3750 commit 88c7f96

24 files changed

Lines changed: 1202 additions & 61 deletions

.github/workflows/daily.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ jobs:
5555
- name: Run stubtest
5656
run: python tests/stubtest_stdlib.py
5757

58+
stubtest-stdlib-py313:
59+
name: Check py313-linux stdlib with stubtest
60+
# TODO: get it passing on all platforms and add it to the main matrix
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-python@v5
65+
with:
66+
python-version: 3.13
67+
cache: pip
68+
cache-dependency-path: requirements-tests.txt
69+
allow-prereleases: true
70+
check-latest: true
71+
- name: Install dependencies
72+
run: pip install -r requirements-tests.txt
73+
- name: Run stubtest
74+
run: python tests/stubtest_stdlib.py
75+
5876
stubtest-third-party:
5977
name: Check third party stubs with stubtest
6078
if: ${{ github.repository == 'python/typeshed' || github.event_name == 'workflow_dispatch' }}

.github/workflows/stubtest_stdlib.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,21 @@ jobs:
5050
run: pip install -r requirements-tests.txt
5151
- name: Run stubtest
5252
run: python tests/stubtest_stdlib.py
53+
54+
stubtest-stdlib-py313:
55+
name: Check py313-linux stdlib with stubtest
56+
# TODO: get it passing on all platforms and add it to the main matrix
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: 3.13
63+
cache: pip
64+
cache-dependency-path: requirements-tests.txt
65+
allow-prereleases: true
66+
check-latest: true
67+
- name: Install dependencies
68+
run: pip install -r requirements-tests.txt
69+
- name: Run stubtest
70+
run: python tests/stubtest_stdlib.py

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ ipaddress._BaseAddress.is_unspecified
7575
ipaddress._BaseAddress.max_prefixlen
7676
ipaddress._BaseAddress.packed
7777
ipaddress._BaseNetwork.max_prefixlen
78-
lib2to3.pygram.pattern_symbols
79-
lib2to3.pygram.python_symbols
80-
lib2to3.pytree.Base.__new__
81-
lib2to3.pytree.Base.children
82-
lib2to3.pytree.Base.type
83-
lib2to3.pytree.BasePattern.__new__
84-
lib2to3.pytree.BasePattern.type
85-
lib2to3.pytree.NegatedPattern.match
86-
lib2to3.pytree.NegatedPattern.match_seq
8778
multiprocessing.JoinableQueue
8879
multiprocessing.Queue
8980
multiprocessing.SimpleQueue
@@ -118,9 +109,6 @@ tarfile.TarFile.errors # errors is initialized for some reason as None even tho
118109
tkinter.simpledialog.[A-Z_]+
119110
tkinter.simpledialog.TclVersion
120111
tkinter.simpledialog.TkVersion
121-
tkinter.tix.[A-Z_]+
122-
tkinter.tix.TclVersion
123-
tkinter.tix.TkVersion
124112
tkinter.Misc.after # we intentionally don't allow everything that "works" at runtime
125113
traceback.TracebackException.from_exception # explicitly expanding arguments going into TracebackException __init__
126114
typing(_extensions)?\.IO\.__next__ # Added because IO streams are iterable. See https://github.com/python/typeshed/commit/97bc450acd60c1bcdafef3ce8fbe3b95a9c0cac3
@@ -186,9 +174,6 @@ encodings.utf_7
186174
encodings.uu_codec
187175
encodings.zlib_codec
188176
json.scanner
189-
lib2to3.btm_utils
190-
lib2to3.fixer_util
191-
lib2to3.patcomp
192177
sqlite3.dump
193178
turtledemo
194179
turtledemo\..+
@@ -217,7 +202,6 @@ ctypes.ARRAY
217202
ctypes.SetPointerType
218203
ctypes.c_voidp
219204
ctypes.util.test
220-
lib2to3.pgen2.grammar.Grammar.loads
221205
mimetypes.MimeTypes.add_type
222206
modulefinder.test
223207
multiprocessing.managers.Server.accepter
@@ -250,22 +234,6 @@ multiprocessing.pool.ThreadPool.Process
250234
multiprocessing.synchronize.Semaphore.get_value
251235
tkinter.Misc.config
252236
tkinter.font.Font.counter
253-
tkinter.tix.CObjView
254-
tkinter.tix.DialogShell
255-
tkinter.tix.ExFileSelectDialog
256-
tkinter.tix.FileSelectDialog
257-
tkinter.tix.FileTypeList
258-
tkinter.tix.Grid
259-
tkinter.tix.NoteBookFrame
260-
tkinter.tix.OptionName
261-
tkinter.tix.ResizeHandle
262-
tkinter.tix.ScrolledGrid
263-
tkinter.tix.ScrolledHList
264-
tkinter.tix.ScrolledListBox
265-
tkinter.tix.ScrolledTList
266-
tkinter.tix.ScrolledText
267-
tkinter.tix.ScrolledWindow
268-
tkinter.tix.Shell
269237
turtle.TNavigator.speed
270238

271239
# Undocumented implementation details of a deprecated class
@@ -285,27 +253,13 @@ profile.Profile.trace_dispatch_i
285253
profile.Profile.trace_dispatch_l
286254
profile.Profile.trace_dispatch_mac
287255
profile.Profile.trace_dispatch_return
288-
cgi.FieldStorage.bufsize
289-
cgi.FieldStorage.read_binary
290-
cgi.FieldStorage.read_lines
291-
cgi.FieldStorage.read_lines_to_eof
292-
cgi.FieldStorage.read_lines_to_outerboundary
293-
cgi.FieldStorage.read_multi
294-
cgi.FieldStorage.read_single
295-
cgi.FieldStorage.read_urlencoded
296-
cgi.FieldStorage.skip_lines
297256
email.contentmanager.get_and_fixup_unknown_message_content
298257
email.contentmanager.get_message_content
299258
email.contentmanager.get_non_text_content
300259
email.contentmanager.get_text_content
301260
email.contentmanager.set_bytes_content
302261
email.contentmanager.set_message_content
303262
email.contentmanager.set_text_content
304-
pipes.Template.makepipeline
305-
pipes.Template.open_r
306-
pipes.Template.open_w
307-
sunau.Au_read.initfp
308-
sunau.Au_write.initfp
309263
turtle.ScrolledCanvas.adjustScrolls
310264
turtle.ScrolledCanvas.onResize
311265
wave.Wave_read.initfp
@@ -442,11 +396,9 @@ multiprocessing.managers.BaseListProxy.reverse
442396
multiprocessing.managers.BaseListProxy.sort
443397
multiprocessing.managers.DictProxy.__iter__
444398
multiprocessing.managers.DictProxy.__len__
445-
multiprocessing.managers.DictProxy.clear
446399
multiprocessing.managers.DictProxy.copy
447400
multiprocessing.managers.DictProxy.items
448401
multiprocessing.managers.DictProxy.keys
449-
multiprocessing.managers.DictProxy.popitem
450402
multiprocessing.managers.DictProxy.values
451403

452404
multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ # Any field can be set on Namespace
@@ -484,7 +436,6 @@ typing\.Protocol
484436
typing(_extensions)?\._TypedDict
485437

486438
# Special primitives
487-
typing_extensions\.Annotated
488439
typing_extensions\.Final
489440
typing_extensions\.NamedTuple
490441
typing_extensions\.LiteralString
@@ -564,9 +515,7 @@ sys.implementation # Actually SimpleNamespace but then you wouldn't have conven
564515

565516
# A factory function that returns 'most efficient lock'.
566517
# Marking it as a function will make it impossible for users to use the Lock type as an annotation.
567-
threading.Lock
568518
threading.RLock
569-
multiprocessing.dummy.Lock
570519
multiprocessing.dummy.RLock
571520

572521
# Dynamically created, has unnecessary *args
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
webbrowser.MacOSX.__init__
2+
3+
# Doesn't exist on macos:
4+
spwd
5+
msilib(.[a-z]+)?
6+
ossaudiodev

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
webbrowser.MacOSX.__init__
2+
13
# These entries looks like a `setup-python` bug:
24
(dbm.gnu)?
35
(_?locale.bind_textdomain_codeset)?
@@ -6,3 +8,8 @@
68
(_?locale.dgettext)?
79
(_?locale.gettext)?
810
(_?locale.textdomain)?
11+
12+
# Doesn't exist on macos:
13+
spwd
14+
msilib(.[a-z]+)?
15+
ossaudiodev

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
webbrowser.MacOSX.__init__
2+
13
# TODO: fix
24
_curses.unget_wch
35
_curses.window.get_wch
@@ -11,3 +13,8 @@ curses.window.get_wch
1113
(_?locale.dgettext)?
1214
(_?locale.gettext)?
1315
(_?locale.textdomain)?
16+
17+
# Doesn't exist on macos:
18+
spwd
19+
msilib(.[a-z]+)?
20+
ossaudiodev
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# new in py313
2+
fcntl.F_GETNOSIGPIPE
3+
fcntl.F_OFD_GETLK
4+
fcntl.F_OFD_SETLK
5+
fcntl.F_OFD_SETLKW
6+
fcntl.F_RDAHEAD
7+
fcntl.F_SETNOSIGPIPE
8+
mmap.MAP_HASSEMAPHORE
9+
mmap.MAP_JIT
10+
mmap.MAP_NOCACHE
11+
mmap.MAP_NOEXTEND
12+
mmap.MAP_RESILIENT_CODESIGN
13+
mmap.MAP_RESILIENT_MEDIA
14+
mmap.MAP_TPRO
15+
mmap.MAP_TRANSLATED_ALLOW_EXECUTE
16+
mmap.MAP_UNIX03
17+
os.waitid
18+
os.waitid_result
19+
posix.waitid
20+
posix.waitid_result
21+
time.CLOCK_MONOTONIC_RAW_APPROX
22+
time.CLOCK_UPTIME_RAW_APPROX
23+
webbrowser.MacOSX
24+
_curses.A_ITALIC
25+
curses.A_ITALIC
26+
_decimal.DecimalTuple.__replace__
27+
28+
# TODO: fix
29+
_curses.unget_wch
30+
_curses.window.get_wch
31+
curses.window.get_wch
32+
33+
# These entries looks like a `setup-python` bug:
34+
(dbm.gnu)?
35+
(_?locale.bind_textdomain_codeset)?
36+
(_?locale.bindtextdomain)?
37+
(_?locale.dcgettext)?
38+
(_?locale.dgettext)?
39+
(_?locale.gettext)?
40+
(_?locale.textdomain)?
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
webbrowser.MacOSX.__init__
2+
3+
# Doesn't exist on macos:
4+
spwd
5+
msilib(.[a-z]+)?
6+
ossaudiodev
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
webbrowser.MacOSX.__init__
2+
3+
# Doesn't exist on macos:
4+
spwd
5+
msilib(.[a-z]+)?
6+
ossaudiodev

stdlib/@tests/stubtest_allowlists/darwin.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ _ctypes.dlclose
2727
_ctypes.dlopen
2828
_ctypes.dlsym
2929

30-
webbrowser.MacOSX.__init__
31-
3230
# ==========
3331
# Allowlist entries that cannot or should not be fixed
3432
# ==========
@@ -38,13 +36,10 @@ _msi
3836
_winapi
3937
asyncio.windows_events
4038
asyncio.windows_utils
41-
msilib(.[a-z]+)?
4239
msvcrt
4340
nt
4441
winreg
4542
winsound
46-
ossaudiodev
47-
spwd
4843

4944
# multiprocessing.popen_spawn_win32 exists on Darwin but fail to import
5045
multiprocessing.popen_spawn_win32

0 commit comments

Comments
 (0)