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

Skip to content

Commit dccc4e1

Browse files
authored
Run stubtest on py313 with macos and Windows in CI (#12020)
1 parent 0444284 commit dccc4e1

12 files changed

Lines changed: 139 additions & 79 deletions

File tree

.github/workflows/daily.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
# tkinter doesn't import on macOS-12
3838
os: ["ubuntu-latest", "windows-latest", "macos-11"]
3939
# TODO unpin the 3.11 and 3.12 micro versions
40-
python-version: ["3.8", "3.9", "3.10", "3.11.8", "3.12.2"]
40+
python-version: ["3.8", "3.9", "3.10", "3.11.8", "3.12.2", "3.13"]
4141
fail-fast: false
4242

4343
steps:
@@ -57,26 +57,6 @@ jobs:
5757
- name: Run stubtest
5858
run: python tests/stubtest_stdlib.py
5959

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

.github/workflows/stubtest_stdlib.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
# tkinter doesn't import on macOS 12
3434
os: ["ubuntu-latest", "windows-latest", "macos-11"]
3535
# TODO unpin 3.11 and 3.12 micro versions
36-
python-version: ["3.8", "3.9", "3.10", "3.11.8", "3.12.2"]
36+
python-version: ["3.8", "3.9", "3.10", "3.11.8", "3.12.2", "3.13"]
3737
fail-fast: false
3838

3939
steps:
@@ -52,23 +52,3 @@ jobs:
5252
run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada
5353
- name: Run stubtest
5454
run: python tests/stubtest_stdlib.py
55-
56-
stubtest-stdlib-py313:
57-
name: Check py313-linux stdlib with stubtest
58-
# TODO: get it passing on all platforms and add it to the main matrix
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v4
62-
- uses: actions/setup-python@v5
63-
with:
64-
python-version: 3.13
65-
cache: pip
66-
cache-dependency-path: requirements-tests.txt
67-
allow-prereleases: true
68-
check-latest: true
69-
- name: Install dependencies
70-
run: pip install -r requirements-tests.txt
71-
- name: Install mypy from git
72-
run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada
73-
- name: Run stubtest
74-
run: python tests/stubtest_stdlib.py

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
11
# new in py313
2+
_pyrepl.curses
3+
_pyrepl.fancy_termios
4+
_pyrepl.readline
5+
_pyrepl.simple_interact
6+
_pyrepl.unix_console
7+
_pyrepl.unix_eventqueue
8+
asyncio.unix_events.EventLoop
9+
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
10+
asyncio.unix_events.__all__
211
fcntl.F_GETNOSIGPIPE
3-
fcntl.F_OFD_GETLK
4-
fcntl.F_OFD_SETLK
5-
fcntl.F_OFD_SETLKW
612
fcntl.F_RDAHEAD
713
fcntl.F_SETNOSIGPIPE
814
mmap.MAP_HASSEMAPHORE
915
mmap.MAP_JIT
1016
mmap.MAP_NOCACHE
1117
mmap.MAP_NOEXTEND
18+
mmap.MAP_NORESERVE
1219
mmap.MAP_RESILIENT_CODESIGN
1320
mmap.MAP_RESILIENT_MEDIA
14-
mmap.MAP_TPRO
1521
mmap.MAP_TRANSLATED_ALLOW_EXECUTE
1622
mmap.MAP_UNIX03
23+
os.grantpt
24+
os.posix_openpt
25+
os.ptsname
26+
os.unlockpt
1727
os.waitid
1828
os.waitid_result
29+
pathlib.Path.group
30+
pathlib.Path.owner
31+
posix.grantpt
32+
posix.posix_openpt
33+
posix.ptsname
34+
posix.unlockpt
1935
posix.waitid
2036
posix.waitid_result
37+
readline.backend
38+
time.clock_gettime_ns
2139
time.CLOCK_MONOTONIC_RAW_APPROX
2240
time.CLOCK_UPTIME_RAW_APPROX
2341
webbrowser.MacOSX
24-
_curses.A_ITALIC
25-
curses.A_ITALIC
2642

2743
# TODO: fix
2844
_curses.unget_wch

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# TODO: triage these (new in py313)
22
_decimal
3+
_pyrepl.curses
4+
_pyrepl.fancy_termios
5+
_pyrepl.readline
6+
_pyrepl.simple_interact
7+
_pyrepl.unix_console
8+
_pyrepl.unix_eventqueue
39
_stat.SF_SETTABLE
410
_stat.SF_SUPPORTED
511
_stat.SF_SYNTHETIC
12+
asyncio.unix_events.EventLoop
13+
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
14+
asyncio.unix_events.__all__
615
decimal.Context.abs
716
decimal.Context.add
817
decimal.Context.canonical
@@ -115,26 +124,39 @@ fcntl.RWH_WRITE_LIFE_MEDIUM
115124
fcntl.RWH_WRITE_LIFE_NONE
116125
fcntl.RWH_WRITE_LIFE_NOT_SET
117126
fcntl.RWH_WRITE_LIFE_SHORT
127+
mmap.MAP_32BIT
128+
mmap.MAP_NORESERVE
118129
os.POSIX_SPAWN_CLOSEFROM
119130
os.TFD_CLOEXEC
120131
os.TFD_NONBLOCK
121132
os.TFD_TIMER_ABSTIME
122133
os.TFD_TIMER_CANCEL_ON_SET
134+
os.grantpt
135+
os.posix_openpt
136+
os.ptsname
123137
os.timerfd_create
124138
os.timerfd_gettime
125139
os.timerfd_gettime_ns
126140
os.timerfd_settime
127141
os.timerfd_settime_ns
142+
os.unlockpt
143+
pathlib.Path.group
144+
pathlib.Path.owner
128145
posix.POSIX_SPAWN_CLOSEFROM
129146
posix.TFD_CLOEXEC
130147
posix.TFD_NONBLOCK
131148
posix.TFD_TIMER_ABSTIME
132149
posix.TFD_TIMER_CANCEL_ON_SET
150+
posix.grantpt
151+
posix.posix_openpt
152+
posix.ptsname
133153
posix.timerfd_create
134154
posix.timerfd_gettime
135155
posix.timerfd_gettime_ns
136156
posix.timerfd_settime
137157
posix.timerfd_settime_ns
158+
posix.unlockpt
159+
readline.backend
138160
stat.SF_SETTABLE
139161
stat.SF_SUPPORTED
140162
stat.SF_SYNTHETIC
@@ -143,6 +165,7 @@ syslog.LOG_LAUNCHD
143165
syslog.LOG_NETINFO
144166
syslog.LOG_RAS
145167
syslog.LOG_REMOTEAUTH
168+
time.clock_gettime_ns
146169

147170
# Exists on some Linux builds, and is documented,
148171
# but is unavailable in Github Actions on Linux with Python 3.12

stdlib/@tests/stubtest_allowlists/py313.txt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,13 @@ _json.encode_basestring_ascii
1515
_pyrepl.commands
1616
_pyrepl.completing_reader
1717
_pyrepl.console
18-
_pyrepl.curses
19-
_pyrepl.fancy_termios
2018
_pyrepl.historical_reader
2119
_pyrepl.input
2220
_pyrepl.keymap
2321
_pyrepl.pager
2422
_pyrepl.reader
25-
_pyrepl.readline
26-
_pyrepl.simple_interact
2723
_pyrepl.trace
2824
_pyrepl.types
29-
_pyrepl.unix_console
30-
_pyrepl.unix_eventqueue
3125
_pyrepl.utils
3226
_thread.interrupt_main
3327
_thread.lock
@@ -61,9 +55,6 @@ asyncio.queues.Queue.shutdown
6155
asyncio.queues.QueueShutDown
6256
asyncio.queues.__all__
6357
asyncio.streams.StreamWriter.__del__
64-
asyncio.unix_events.EventLoop
65-
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
66-
asyncio.unix_events.__all__
6758
bdb.Bdb.dispatch_opcode
6859
bdb.Bdb.set_stepinstr
6960
bdb.Bdb.user_opcode
@@ -160,24 +151,16 @@ math.fma
160151
mimetypes.MimeTypes.guess_file_type
161152
mimetypes.__all__
162153
mimetypes.guess_file_type
163-
mmap.MAP_32BIT
164154
mmap.mmap.seekable
165-
mmap.MAP_NORESERVE
166155
multiprocessing.managers.DictProxy.__class_getitem__
167156
multiprocessing.managers.ListProxy.__class_getitem__
168157
multiprocessing.shared_memory.SharedMemory.__init__
169-
os.grantpt
170-
os.posix_openpt
171-
os.ptsname
172-
os.unlockpt
173158
pathlib.Path.__enter__
174159
pathlib.Path.__exit__
175160
pathlib.Path.from_uri
176161
pathlib.Path.glob
177-
pathlib.Path.group
178162
pathlib.Path.is_dir
179163
pathlib.Path.is_file
180-
pathlib.Path.owner
181164
pathlib.Path.read_text
182165
pathlib.Path.rglob
183166
pathlib.PurePath.parser
@@ -197,10 +180,6 @@ platform.AndroidVer
197180
platform.IOSVersionInfo
198181
platform.android_ver
199182
platform.ios_ver
200-
posix.grantpt
201-
posix.posix_openpt
202-
posix.ptsname
203-
posix.unlockpt
204183
pstats.FunctionProfile.__replace__
205184
pstats.StatsProfile.__replace__
206185
pydoc.HTMLDoc.docdata
@@ -217,7 +196,6 @@ pydoc.pipepager
217196
pydoc.plainpager
218197
pydoc.tempfilepager
219198
pydoc.ttypager
220-
readline.backend
221199
site.gethistoryfile
222200
site.register_readline
223201
sqlite3.Connection.iterdump
@@ -227,7 +205,6 @@ sre_constants.SRE_FLAG_TEMPLATE
227205
sre_parse.SRE_FLAG_TEMPLATE
228206
tarfile.TarFile.__init__
229207
threading.stack_size
230-
time.clock_gettime_ns
231208
tkinter.Misc.after_info
232209
tkinter.Misc.busy
233210
tkinter.Misc.busy_cget

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ tarfile.TarInfo.replace
44
# so are omitted from the stub
55
pathlib.Path.is_mount
66
pathlib.WindowsPath.is_mount
7+
8+
# pathlib functions that rely on modules that don't exist on Windows
9+
pathlib.Path.owner
10+
pathlib.Path.group
11+
12+
# Modules that don't exist on Windows
13+
crypt
14+
nis
15+
ossaudiodev
16+
spwd

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22
# so are omitted from the stub
33
pathlib.Path.is_mount
44
pathlib.WindowsPath.is_mount
5+
6+
# pathlib functions that rely on modules that don't exist on Windows
7+
pathlib.Path.owner
8+
pathlib.Path.group
9+
10+
# Modules that don't exist on Windows
11+
crypt
12+
nis
13+
ossaudiodev
14+
spwd

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@
22
# (Hard to add types for unless we add stubs for the undocumented _overlapped module...)
33
asyncio.IocpProactor.finish_socket_func
44
asyncio.windows_events.IocpProactor.finish_socket_func
5+
6+
# pathlib functions that rely on modules that don't exist on Windows
7+
pathlib.Path.owner
8+
pathlib.Path.group
9+
10+
# Modules that don't exist on Windows
11+
crypt
12+
nis
13+
ossaudiodev
14+
spwd

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
# New in py313 (triage these!)
2+
_msi
3+
_stat.SF_SETTABLE
4+
_stat.SF_SUPPORTED
5+
_stat.SF_SYNTHETIC
6+
_winapi.BatchedWaitForMultipleObjects
7+
_winapi.CreateEventW
8+
_winapi.CreateMutexW
9+
_winapi.GetLongPathName
10+
_winapi.GetShortPathName
11+
_winapi.OpenEventW
12+
_winapi.OpenMutexW
13+
_winapi.ReleaseMutex
14+
_winapi.ResetEvent
15+
_winapi.STARTF_FORCEOFFFEEDBACK
16+
_winapi.STARTF_FORCEONFEEDBACK
17+
_winapi.STARTF_PREVENTPINNING
18+
_winapi.STARTF_RUNFULLSCREEN
19+
_winapi.STARTF_TITLEISAPPID
20+
_winapi.STARTF_TITLEISLINKNAME
21+
_winapi.STARTF_UNTRUSTEDSOURCE
22+
_winapi.STARTF_USECOUNTCHARS
23+
_winapi.STARTF_USEFILLATTRIBUTE
24+
_winapi.STARTF_USEHOTKEY
25+
_winapi.STARTF_USEPOSITION
26+
_winapi.STARTF_USESIZE
27+
_winapi.SetEvent
28+
asyncio.windows_events.__all__
29+
asyncio.windows_events.EventLoop
30+
ctypes._endian.oledll
31+
ctypes._endian.windll
32+
nt.fchmod
33+
nt.lchmod
34+
os.fchmod
35+
os.lchmod
36+
stat.SF_SETTABLE
37+
stat.SF_SUPPORTED
38+
stat.SF_SYNTHETIC
39+
subprocess.__all__
40+
subprocess.STARTF_FORCEOFFFEEDBACK
41+
subprocess.STARTF_FORCEONFEEDBACK
42+
143
# Undocumented internal method, not really for public consumption.
244
# (Hard to add types for unless we add stubs for the undocumented _overlapped module...)
345
asyncio.IocpProactor.finish_socket_func

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ pathlib.Path.is_mount
1010
pathlib.WindowsPath.group
1111
pathlib.WindowsPath.owner
1212
pathlib.WindowsPath.is_mount
13+
14+
# pathlib functions that rely on modules that don't exist on Windows
15+
pathlib.Path.owner
16+
pathlib.Path.group
17+
18+
# Modules that don't exist on Windows
19+
crypt
20+
nis
21+
ossaudiodev
22+
spwd

0 commit comments

Comments
 (0)