8000 stubtest_stdlib: get rid of --ignore-missing-stub (#6491) · python/typeshed@24afb53 · GitHub
[go: up one dir, main page]

Skip to content

Commit 24afb53

Browse files
authored
stubtest_stdlib: get rid of --ignore-missing-stub (#6491)
* get rid of --ignore-missing-stub * update allowlists based on github actions logs, with script import re platforms = ["linux", "win32", "darwin"] versions = ["py36", "py37", "py38", "py39", "py310"] entries_by_pv = {} for p in platforms: for v in versions: p_name = {"linux": "ubuntu", "darwin": "macos", "win32": "windows"}[p] v_name = "3." + v.replace("py3", "") if v_name == "3.9": v_name = "3.9.7" entries = set() with open(f"la/Check stdlib with stubtest ({p_name}-latest, {v_name})/6_Run stubtest.txt") as file: for line in file: m = re.search(r"error: (.*) is not present in stub$", line.strip()) if m: entries.add(m.group(1)) entries_by_pv[p, v] = entries def remove_intersection(sets): sets = list(sets) result = set(sets[0]) for s in sets[1:]: result &= s for s in sets: for r in result: s.remove(r) return result common_to_all = remove_intersection(entries_by_pv.values()) common_to_version = {} for v in versions: common_to_version[v] = remove_intersection([ entries for (p, v2), entries in entries_by_pv.items() if v == v2 ]) common_to_platform = {} for p in platforms: common_to_platform[p] = remove_intersection([ entries for (p2, v), entries in entries_by_pv.items() if p == p2 ]) def write(fname, entries): with open(f"tests/stubtest_allowlists/{fname}.txt", "a") as file: file.write("\n# Exists at runtime, but missing from stubs\n") for i in sorted(entries): file.write(i + "\n") write("py3_common", common_to_all) for v, entries in common_to_version.items(): write(v, entries) for p, entries in common_to_platform.items(): write(p, entries) for (p, v), entries in entries_by_pv.items(): write(p + "-" + v, entries) * Manually combine __main__ attributes into a single entry * move and comment entries manually
1 parent f105c79 commit 24afb53

27 files changed

+1376
-11
lines changed

stdlib/_csv.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
from typing import Any, Iterable, Iterator, List, Protocol, Type, Union
22

3-
# __version__ is deliberately not defined here or in csv.pyi,
4-
# as it appears to have been hardcoded at "1.0" for a very long time!
5-
63
QUOTE_ALL: int
74
QUOTE_MINIMAL: int
85
QUOTE_NONE: int

stdlib/csv.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ if sys.version_info >= (3, 8):
2525
else:
2626
from collections import OrderedDict as _DictReadMapping
2727

28-
# __version__ is deliberately not defined here or in _csv.pyi,
29-
# as it appears to have been hardcoded at "1.0" for a very long time!
30-
3128
_T = TypeVar("_T")
3229

3330
class excel(Dialect):
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
_?curses.A_ITALIC
22
_curses.color_pair
33
curses.color_pair
4+
5+
# Exists at runtime, but missing from stubs
6+
_curses.get_escdelay
7+
_curses.get_tabsize
8+
_curses.set_escdelay
9+
_curses.set_tabsize
10+
asyncio.PidfdChildWatcher
11+
asyncio.unix_events.PidfdChildWatcher
12+
os.CLD_KILLED
13+
os.CLD_STOPPED
14+
os.POSIX_SPAWN_CLOSE
15+
os.POSIX_SPAWN_DUP2
16+
os.POSIX_SPAWN_OPEN
17+
posix.register_at_fork
18+
posix.waitstatus_to_exitcode

tests/stubtest_allowlists/darwin-py36.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@ ctypes.wintypes
22
pwd.getpwnam
33
ssl.PROTOCOL_SSLv3 # Depends on openssl compilation
44
ssl.RAND_egd # Depends on openssl compilation
5+
6+
# Exists at runtime, but missing from stubs
7+
ftplib.FTP.trust_server_pasv_ipv4_address
8+
ntpath.splitunc
9+
posix.stat_float_times
10+
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
11+
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
_?curses.A_ITALIC
22
ctypes.wintypes
33
pwd.getpwnam
4+
5+
# Exists at runtime, but missing from stubs
6+
ftplib.FTP.trust_server_pasv_ipv4_address
7+
posix.register_at_fork
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
_?curses.A_ITALIC
2+
3+
# Exists at runtime, but missing from stubs
4+
os.POSIX_SPAWN_CLOSE
5+
os.POSIX_SPAWN_DUP2
6+
os.POSIX_SPAWN_OPEN
7+
posix.register_at_fork
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
11
_?curses.A_ITALIC
2+
3+
# Exists at runtime, but missing from stubs
4+
_curses.get_escdelay
5+
_curses.get_tabsize
6+
_curses.set_escdelay
7+
_curses.set_tabsize
8+
asyncio.PidfdChildWatcher
9+
asyncio.unix_events.PidfdChildWatcher
10+
os.CLD_KILLED
11+
os.CLD_STOPPED
12+
os.POSIX_SPAWN_CLOSE
13+
os.POSIX_SPAWN_DUP2
14+
os.POSIX_SPAWN_OPEN
15+
posix.register_at_fork
16+
posix.waitstatus_to_exitcode

tests/stubtest_allowlists/darwin.txt

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,156 @@ posix.SCHED_[A-Z_]+
4646
# Loadable SQLite extensions are disabled on GitHub runners
4747
(sqlite3(.dbapi2)?.Connection.enable_load_extension)?
4848
(sqlite3(.dbapi2)?.Connection.load_extension)?
49+
50+
# Exists at runtime, but missing from stubs
51+
distutils.msvccompiler.MSVCCompiler.get_msvc_paths
52+
distutils.msvccompiler.MSVCCompiler.set_path_env_var
53+
distutils.msvccompiler.MacroExpander
54+
grp.struct_group.n_fields
55+
grp.struct_group.n_sequence_fields
56+
grp.struct_group.n_unnamed_fields
57+
mimetypes.MimeTypes.read_windows_registry
58+
os.ST_NOSUID
59+
os.ST_RDONLY
60+
os.uname_result.n_fields
61+
os.uname_result.n_sequence_fields
62+
os.uname_result.n_unnamed_fields
63+
posix.DirEntry
64+
posix.abort
65+
posix.access
66+
posix.chdir
67+
posix.chflags
68+
posix.chmod
69+
posix.chown
70+
posix.chroot
71+
posix.close
72+
posix.closerange
73+
posix.confstr
74+
posix.cpu_count
75+
posix.ctermid
76+
posix.device_encoding
77+
posix.dup
78+
posix.dup2
79+
posix.execv
80+
posix.execve
81+
posix.fchdir
82+
posix.fchmod
83+
posix.fchown
84+
posix.fork
85+
posix.forkpty
86+
posix.fpathconf
87+
posix.fspath
88+
posix.fstat
89+
posix.fstatvfs
90+
posix.fsync
91+
posix.ftruncate
92+
posix.get_blocking
93+
posix.get_inheritable
94+
posix.get_terminal_size
95+
posix.getcwd
96+
posix.getcwdb
97+
posix.getegid
98+
posix.geteuid
99+
posix.getgid
100+
posix.getgrouplist
101+
posix.getgroups
102+
posix.getloadavg
103+
posix.getlogin
104+
posix.getpgid
105+
posix.getpgrp
106+
posix.getpid
107+
posix.getppid
108+
posix.getpriority
109+
posix.getsid
110+
posix.getuid
111+
posix.initgroups
112+
posix.isatty
113+
posix.kill
114+
posix.killpg
115+
posix.lchflags
116+
posix.lchmod
117+
posix.lchown
118+
posix.link
119+
posix.lockf
120+
posix.lseek
121+
posix.lstat
122+
posix.major
123+
posix.makedev
124+
posix.minor
125+
posix.mkdir
126+
posix.mkfifo
127+
posix.mknod
128+
posix.nice
129+
posix.open
130+
posix.openpty
131+
posix.pathconf
132+
posix.pipe
133+
posix.pread
134+
posix.putenv
135+
posix.pwrite
136+
posix.read
137+
posix.readlink
138+
posix.readv
139+
posix.remove
140+
posix.rename
141+
posix.replace
142+
posix.rmdir
143+
posix.scandir
144+
posix.sched_get_priority_max
145+
posix.sched_get_priority_min
146+
posix.sched_yield
147+
posix.sendfile
148+
posix.set_blocking
149+
posix.set_inheritable
150+
posix.setegid
151+
posix.seteuid
152+
posix.setgid
153+
posix.setgroups
154+
posix.setpgid
155+
posix.setpgrp
156+
posix.setpriority
157+
posix.setregid
158+
posix.setreuid
159+
posix.setsid
160+
posix.setuid
161+
posix.stat
162+
posix.stat_result.n_fields
163+
posix.stat_result.n_sequence_fields
164+
posix.stat_result.n_unnamed_fields
165+
posix.statvfs
166+
posix.strerror
167+
posix.symlink
168+
posix.sync
169+
posix.sysconf
170+
posix.system
171+
posix.tcgetpgrp
172+
posix.tcsetpgrp
173+
posix.times
174+
posix.times_result.n_fields
175+
posix.times_result.n_sequence_fields
176+
posix.times_result.n_unnamed_fields
177+
posix.truncate
178+
posix.ttyname
179+
posix.umask
180+
posix.uname
181+
posix.uname_result.n_fields
182+
posix.uname_result.n_sequence_fields
183+
posix.uname_result.n_unnamed_fields
184+
posix.unlink
185+
posix.unsetenv
186+
posix.urandom
187+
posix.utime
188+
posix.wait
189+
posix.wait3
190+
posix.wait4
191+
posix.waitpid
192+
posix.write
193+
posix.writev
194+
resource.struct_rusage.n_fields
195+
resource.struct_rusage.n_sequence_fields
196+
resource.struct_rusage.n_unnamed_fields
197+
selectors.DefaultSelector.fileno
198+
socket.AddressInfo.AI_DEFAULT
199+
socket.AddressInfo.AI_MASK
200+
socket.AddressInfo.AI_V4MAPPED_CFG
201+
socket.MsgFlag.MSG_EOF

tests/stubtest_allowlists/linux-py310.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,48 @@ os.sendfile
1717
signal.sigtimedwait
1818
signal.sigwaitinfo
1919
select.epoll.register
20+
21+
# Exists at runtime, but missing from stubs
22+
_curses.get_escdelay
23+
_curses.get_tabsize
24+
_curses.set_escdelay
25+
_curses.set_tabsize
26+
asyncio.PidfdChildWatcher
27+
asyncio.unix_events.PidfdChildWatcher
28+
os.CLD_KILLED
29+
os.CLD_STOPPED
30+
os.EFD_CLOEXEC
31+
os.EFD_NONBLOCK
32+
os.EFD_SEMAPHORE
33+
os.POSIX_SPAWN_CLOSE
34+
os.POSIX_SPAWN_DUP2
35+
os.POSIX_SPAWN_OPEN
36+
os.P_PIDFD
37+
os.RWF_APPEND
38+
os.RWF_DSYNC
39+
os.RWF_HIPRI
40+
os.RWF_NOWAIT
41+
os.RWF_SYNC
42+
os.SPLICE_F_MORE
43+
os.SPLICE_F_MOVE
44+
os.SPLICE_F_NONBLOCK
45+
os.copy_file_range
46+
os.eventfd
47+
os.eventfd_read
48+
os.eventfd_write
49+
os.pidfd_open
50+
os.preadv
51+
os.pwritev
52+
os.splice
53+
posix.copy_file_range
54+
posix.eventfd
55+
posix.eventfd_read
56+
posix.eventfd_write
57+
posix.memfd_create
58+
posix.pidfd_open
59+
posix.preadv
60+
posix.pwritev
61+
posix.register_at_fork
62+
posix.splice
63+
posix.waitstatus_to_exitcode
64+
time.pthread_getcpuclockid

tests/stubtest_allowlists/linux-py36.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,10 @@ ctypes.wintypes
22
pwd.getpwnam
33
ssl.PROTOCOL_SSLv3 # Depends on openssl compilation
44
ssl.RAND_egd # Depends on openssl compilation
5+
6+
# Exists at runtime, but missing from stubs
7+
ftplib.FTP.trust_server_pasv_ipv4_address
8+
ntpath.splitunc
9+
posix.stat_float_times
10+
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
11+
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT

0 commit comments

Comments
 (0)
0