Skip to content

stubtest: test against 3.11 #7845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
matrix:
# macos-11 does not have tcl/tk installed, needed for stubtesting tkinter
os: ["ubuntu-latest", "windows-latest", "macos-10.15"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
fail-fast: false

steps:
Expand Down
6 changes: 4 additions & 2 deletions tests/stubtest_allowlists/darwin-py310.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
_?curses.A_ITALIC
_curses.color_pair
curses.color_pair
_?curses.color_pair
webbrowser.MacOSXOSAScript.__init__

distutils.command.bdist_msi # msi is only available on windows

# Exists at runtime, but missing from stubs
mmap.MADV_FREE
Expand Down
15 changes: 15 additions & 0 deletions tests/stubtest_allowlists/darwin-py311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
_?curses.A_ITALIC
_?curses.color_pair
asyncio.SelectorEventLoop.create_unix_connection
asyncio.SelectorEventLoop.create_unix_server
asyncio.unix_events.SelectorEventLoop.create_unix_connection
asyncio.unix_events.SelectorEventLoop.create_unix_server
asyncio.unix_events._UnixSelectorEventLoop.create_unix_connection
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
termios.tcgetwinsize
termios.tcsetwinsize
xxlimited.Xxo.x_exports

# Exists at runtime, but missing from stubs
mmap.MADV_FREE
distutils.util.__warningregistry__
4 changes: 4 additions & 0 deletions tests/stubtest_allowlists/darwin-py36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pwd.getpwnam
ssl.PROTOCOL_SSLv3 # Depends on openssl compilation
ssl.RAND_egd # Depends on openssl compilation

distutils.command.bdist_msi # msi is only available on windows

webbrowser.MacOSXOSAScript.__init__

# Exists at runtime, but missing from stubs
ntpath.splitunc
posix.stat_float_times
Expand Down
3 changes: 3 additions & 0 deletions tests/stubtest_allowlists/darwin-py37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ _?curses.A_ITALIC
ctypes.wintypes
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
pwd.getpwnam
webbrowser.MacOSXOSAScript.__init__

distutils.command.bdist_msi # msi is only available on windows
3 changes: 3 additions & 0 deletions tests/stubtest_allowlists/darwin-py38.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
_?curses.A_ITALIC
webbrowser.MacOSXOSAScript.__init__

distutils.command.bdist_msi # msi is only available on windows

# Exists at runtime, but missing from stubs
mmap.MADV_FREE
3 changes: 3 additions & 0 deletions tests/stubtest_allowlists/darwin-py39.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
_?curses.A_ITALIC
webbrowser.MacOSXOSAScript.__init__

distutils.command.bdist_msi # msi is only available on windows

# Exists at runtime, but missing from stubs
mmap.MADV_FREE
6 changes: 0 additions & 6 deletions tests/stubtest_allowlists/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ curses.COLORS # Initialized after start_color
curses.COLOR_PAIRS # Initialized after start_color
curses.COLS # Initialized only after initscr call.
curses.LINES # Initialized only after initscr call.
distutils.command.bdist_msi # msi is only available on windows
os.EX_NOTFOUND
os.SF_MNOWAIT
os.SF_NODISKIO
Expand Down Expand Up @@ -39,10 +38,6 @@ posix.SCHED_[A-Z_]+
# Some of these exist on non-windows, but they are useless and this is not intended
stat.FILE_ATTRIBUTE_[A-Z_]+

# Loadable SQLite extensions are disabled on GitHub runners
(sqlite3(.dbapi2)?.Connection.enable_load_extension)?
(sqlite3(.dbapi2)?.Connection.load_extension)?

# Methods that come from __getattr__() at runtime
tkinter.Tk.createfilehandler
tkinter.Tk.deletefilehandler
Expand All @@ -63,4 +58,3 @@ posix.error.characters_written
resource.error.characters_written
select.POLLRDHUP
webbrowser.MacOSX.__init__
webbrowser.MacOSXOSAScript.__init__
28 changes: 12 additions & 16 deletions tests/stubtest_allowlists/linux-py310.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
_curses.color_pair
curses.color_pair
(os|posix).EFD_CLOEXEC
(os|posix).EFD_NONBLOCK
(os|posix).EFD_SEMAPHORE
(os|posix).SPLICE_F_MORE
(os|posix).SPLICE_F_MOVE
(os|posix).SPLICE_F_NONBLOCK
(os|posix).posix_fadvise
(os|posix).posix_fallocate
(os|posix).sched_getaffinity
Expand All @@ -13,25 +19,15 @@ curses.color_pair
(os|posix).setresuid
(os|posix).waitid
(os|posix).sendfile
(os|posix).eventfd
(os|posix).eventfd_read
(os|posix).eventfd_write
(os|posix).splice
signal.sigtimedwait
signal.sigwaitinfo
select.epoll.register

distutils.command.bdist_msi # msi is only available on windows

# Exists at runtime, but missing from stubs
distutils.command.build_ext.__warningregistry__
os.EFD_CLOEXEC
os.EFD_NONBLOCK
os.EFD_SEMAPHORE
os.SPLICE_F_MORE
os.SPLICE_F_MOVE
os.SPLICE_F_NONBLOCK
os.eventfd
os.eventfd_read
os.eventfd_write
os.splice
posix.EFD_[A-Z]+
posix.SPLICE_[A-Z_]+
posix.eventfd
posix.eventfd_read
posix.eventfd_write
posix.splice
52 changes: 52 additions & 0 deletions tests/stubtest_allowlists/linux-py311.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
_?curses.color_pair
asyncio.SelectorEventLoop.create_unix_connection
asyncio.SelectorEventLoop.create_unix_server
asyncio.unix_events.SelectorEventLoop.create_unix_connection
asyncio.unix_events.SelectorEventLoop.create_unix_server
asyncio.unix_events._UnixSelectorEventLoop.create_unix_connection
asyncio.unix_events._UnixSelectorEventLoop.create_unix_server
distutils.command.build_ext.__warningregistry__
mmap.MAP_STACK
(os|posix).EFD_CLOEXEC
(os|posix).EFD_NONBLOCK
(os|posix).EFD_SEMAPHORE
(os|posix).SPLICE_F_MORE
(os|posix).SPLICE_F_MOVE
(os|posix).SPLICE_F_NONBLOCK
(os|posix).posix_fadvise
(os|posix).posix_fallocate
(os|posix).sched_getaffinity
(os|posix).sched_getparam
(os|posix).sched_getscheduler
(os|posix).sched_rr_get_interval
(os|posix).sched_setaffinity
(os|posix).sched_setparam
(os|posix).sched_setscheduler
(os|posix).setresgid
(os|posix).setresuid
(os|posix).waitid
(os|posix).sendfile
(os|posix).eventfd
(os|posix).eventfd_read
(os|posix).eventfd_write
(os|posix).splice
signal.SIGSTKFLT
signal.Signals.SIGSTKFLT
signal.sigtimedwait
signal.sigwaitinfo
select.epoll.register
sqlite3.Connection.deserialize
sqlite3.Connection.serialize
sqlite3.SQLITE_BUSY_TIMEOUT
sqlite3.SQLITE_CORRUPT_INDEX
sqlite3.SQLITE_IOERR_CORRUPTFS
sqlite3.SQLITE_IOERR_DATA
sqlite3.dbapi2.Connection.deserialize
sqlite3.dbapi2.Connection.serialize
sqlite3.dbapi2.SQLITE_BUSY_TIMEOUT
sqlite3.dbapi2.SQLITE_CORRUPT_INDEX
sqlite3.dbapi2.SQLITE_IOERR_CORRUPTFS
sqlite3.dbapi2.SQLITE_IOERR_DATA
termios.tcgetwinsize
termios.tcsetwinsize
xxlimited.Xxo.x_exports
2 changes: 2 additions & 0 deletions tests/stubtest_allowlists/linux-py36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ posix.stat_float_times
ssl.OP_ENABLE_MIDDLEBOX_COMPAT
ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT
uuid.lib

distutils.command.bdist_msi # msi is only available on windows
2 changes: 2 additions & 0 deletions tests/stubtest_allowlists/linux-py37.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ctypes.wintypes
ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154
pwd.getpwnam

distutils.command.bdist_msi # msi is only available on windows
2 changes: 2 additions & 0 deletions tests/stubtest_allowlists/linux-py38.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
select.epoll.register

distutils.command.bdist_msi # msi is only available on windows
2 changes: 2 additions & 0 deletions tests/stubtest_allowlists/linux-py39.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
(os|posix).sendfile
select.epoll.register

distutils.command.bdist_msi # msi is only available on windows
5 changes: 0 additions & 5 deletions tests/stubtest_allowlists/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ curses.COLORS # Initialized after start_color
curses.COLOR_PAIRS # Initialized after start_color
curses.COLS # Initialized only after initscr call.
curses.LINES # Initialized only after initscr call.
distutils.command.bdist_msi # msi is only available on windows
os.EX_NOTFOUND
os.SF_MNOWAIT
os.SF_NODISKIO
Expand Down Expand Up @@ -43,10 +42,6 @@ posix.SCHED_[A-Z_]+
# Some of these exist on non-windows, but they are useless and this is not intended
stat.FILE_ATTRIBUTE_[A-Z_]+

# Loadable SQLite extensions are disabled on GitHub runners
(sqlite3(.dbapi2)?.Connection.enable_load_extension)?
(sqlite3(.dbapi2)?.Connection.load_extension)?

# Methods that come from __getattr__() at runtime
tkinter.Tk.createfilehandler
tkinter.Tk.deletefilehandler
Expand Down
25 changes: 25 additions & 0 deletions tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ ssl.PROTOCOL_SSLv3 # Depends on ssl compilation
ssl.RAND_egd # Depends on openssl compilation
symtable.SymbolTable.has_exec
sys.UnraisableHookArgs # Not exported from sys
tkinter.Tk.split
types.ClassMethodDescriptorType.__get__
types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime
types.GenericAlias.__getattr__
Expand Down Expand Up @@ -128,6 +129,13 @@ tkinter.EventType.__new__
ssl.SSLContext.__new__
ssl._create_unverified_context

# SpooledTemporaryFile implements IO except these methods before Python 3.11
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918
tempfile.SpooledTemporaryFile.__next__
tempfile.SpooledTemporaryFile.readable
tempfile.SpooledTemporaryFile.seekable
tempfile.SpooledTemporaryFile.writable

# Exists at runtime, but missing from stubs
_ast.Tuple.dims
_codecs.unregister
Expand All @@ -150,6 +158,8 @@ distutils.dist.DistributionMetadata.set_keywords
distutils.dist.DistributionMetadata.set_platforms
distutils.util.get_host_platform
functools.partial.__vectorcalloffset__ # undocumented implementation detail
inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this
inspect.Signature.from_function # Removed in 3.11, can add if someone needs this
multiprocessing.managers.SharedMemoryServer.create
multiprocessing.managers.SharedMemoryServer.list_segments
multiprocessing.managers.SharedMemoryServer.public
Expand All @@ -163,3 +173,18 @@ unicodedata.UCD.is_normalized
xml.parsers.expat.XMLParserType.SkippedEntityHandler
xml.parsers.expat.XMLParserType.intern
xml.sax.handler.LexicalHandler

# Side effects from module initialization
_compat_pickle.excname
email.contentmanager.maintype
email.contentmanager.subtype
inspect.k
inspect.mod_dict
inspect.v
json.encoder.i
lib2to3.pgen2.grammar.line
lib2to3.pgen2.grammar.name
lib2to3.pgen2.grammar.op
pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522
Loading