-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Run stubtest for Python 3.12 #10253
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
Run stubtest for Python 3.12 #10253
Changes from all commits
691f316
89a97e9
d8b3a15
6824284
3503936
90e7851
d182195
da35cf5
92aec67
4caa20b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
_?curses.color_pair | ||
_curses.unget_wch | ||
_curses.window.get_wch | ||
_posixsubprocess.fork_exec | ||
_socket.ETHERTYPE_ARP | ||
_socket.ETHERTYPE_IP | ||
_socket.ETHERTYPE_IPV6 | ||
_socket.ETHERTYPE_VLAN | ||
_socket.IP_ADD_SOURCE_MEMBERSHIP | ||
_socket.IP_BLOCK_SOURCE | ||
_socket.IP_DROP_SOURCE_MEMBERSHIP | ||
_socket.IP_PKTINFO | ||
_socket.IP_UNBLOCK_SOURCE | ||
curses.unget_wch | ||
curses.window.get_wch | ||
os.PRIO_DARWIN_BG | ||
os.PRIO_DARWIN_NONUI | ||
os.PRIO_DARWIN_PROCESS | ||
os.PRIO_DARWIN_THREAD | ||
posix.DirEntry.is_junction | ||
posix.PRIO_DARWIN_BG | ||
posix.PRIO_DARWIN_NONUI | ||
posix.PRIO_DARWIN_PROCESS | ||
posix.PRIO_DARWIN_THREAD | ||
socket.ETHERTYPE_ARP | ||
socket.ETHERTYPE_IP | ||
socket.ETHERTYPE_IPV6 | ||
socket.ETHERTYPE_VLAN | ||
socket.IP_ADD_SOURCE_MEMBERSHIP | ||
socket.IP_BLOCK_SOURCE | ||
socket.IP_DROP_SOURCE_MEMBERSHIP | ||
socket.IP_PKTINFO | ||
socket.IP_UNBLOCK_SOURCE | ||
socket.TCP_CONNECTION_INFO | ||
syslog.LOG_MASK | ||
syslog.LOG_UPTO | ||
syslog.setlogmask | ||
tty.__all__ | ||
tty.cfmakecbreak | ||
tty.cfmakeraw | ||
xxlimited.Xxo.x_exports | ||
|
||
(dbm.gnu)? | ||
(locale.bind_textdomain_codeset)? | ||
(locale.bindtextdomain)? | ||
(locale.dcgettext) | ||
(locale.dgettext)? | ||
(locale.gettext)? | ||
(locale.textdomain)? |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
_?curses.color_pair | ||
_posixsubprocess.fork_exec | ||
(os|posix).CLONE_FILES | ||
(os|posix).CLONE_FS | ||
(os|posix).CLONE_NEWCGROUP | ||
(os|posix).CLONE_NEWIPC | ||
(os|posix).CLONE_NEWNET | ||
(os|posix).CLONE_NEWNS | ||
(os|posix).CLONE_NEWPID | ||
(os|posix).CLONE_NEWUSER | ||
(os|posix).CLONE_NEWUTS | ||
(os|posix).CLONE_SIGHAND | ||
(os|posix).CLONE_SYSVSEM | ||
(os|posix).CLONE_THREAD | ||
(os|posix).CLONE_VM | ||
(os|posix).DirEntry.is_junction | ||
(os|posix).EFD_CLOEXEC | ||
(os|posix).EFD_NONBLOCK | ||
(os|posix).EFD_SEMAPHORE | ||
(os|posix).eventfd | ||
(os|posix).eventfd_read | ||
(os|posix).eventfd_write | ||
(os|posix).sendfile | ||
(os|posix).setns | ||
(os|posix).setresgid | ||
(os|posix).setresuid | ||
(os|posix).splice | ||
(os|posix).SPLICE_F_MORE | ||
(os|posix).SPLICE_F_MOVE | ||
(os|posix).SPLICE_F_NONBLOCK | ||
(os|posix).unshare | ||
fcntl.FICLONE | ||
fcntl.FICLONERANGE | ||
mmap.MAP_STACK | ||
resource.prlimit | ||
signal.sigtimedwait | ||
signal.sigwaitinfo | ||
ssl.OP_ENABLE_KTLS | ||
ssl.Options.OP_ENABLE_KTLS | ||
syslog.LOG_MASK | ||
syslog.LOG_UPTO | ||
syslog.setlogmask | ||
tty.__all__ | ||
tty.cfmakecbreak | ||
tty.cfmakeraw | ||
xxlimited.Xxo.x_exports |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,18 @@ asyncio.Future.__init__ # Usually initialized from c object | |
asyncio.futures.Future.__init__ # Usually initialized from c object | ||
builtins.float.__setformat__ # Internal method for CPython test suite | ||
builtins.property.__set_name__ # Doesn't actually exist | ||
bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set | ||
configparser.ParsingError.filename | ||
contextlib.AbstractAsyncContextManager.__class_getitem__ | ||
contextlib.AbstractContextManager.__class_getitem__ | ||
enum.Enum._generate_next_value_ | ||
fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve | ||
functools.cached_property.__set__ # Stub is a white lie; see comments in the stub | ||
functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically | ||
gettext.install | ||
gettext.translation | ||
hmac.new # Stub is a white lie; see comments in the stub | ||
importlib.abc.Finder.find_module | ||
importlib.metadata._meta.SimplePath.__truediv__ # See comments in the stub | ||
ipaddress.IPv4Interface.hostmask | ||
ipaddress.IPv6Interface.hostmask | ||
|
@@ -50,6 +54,13 @@ typing._TypedDict.update | |
typing._TypedDict.values | ||
weakref.ProxyType.__reversed__ # Doesn't really exist | ||
weakref.WeakValueDictionary.update | ||
typing_extensions\.get_original_bases | ||
|
||
# Exist at runtime for internal reasons, no need to put them in the stub | ||
typing_extensions\.TypeAliasType\.__call__ | ||
typing_extensions\.TypeAliasType\.__init_subclass__ | ||
# We call them read-only properties, runtime implementation is slightly different | ||
typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ | ||
|
||
# Runtime has *args, **kwargs, but will error if any are supplied | ||
unittest.TestCase.__init_subclass__ | ||
|
@@ -183,3 +194,17 @@ typing.NewType.__call__ | |
typing_extensions\.Final | ||
typing\.NamedTuple | ||
typing\.Annotated | ||
|
||
# We lie about the existence of these methods | ||
.*.__buffer__ | ||
.*.__release_buffer__ | ||
|
||
# Removed in 3.12 | ||
distutils\..* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have preferred to not do this. I feel like whenever we've used wildcard regex allowlist entries in the past, it's ended up causing us pain and confusion further down the line (#9900; #10205; there have been others as well). If we have to do this, then we may as well revert the changes that were made to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree in general, but I have basically no further interest in the accuracy of the distutil stubs, especially since most users aren't even going to get distutils when they There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that all makes sense :-) let's go for undoing #9735, then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Longer term, I guess we might want to look at getting type checkers to somehow recognise that if a user does |
||
asyncore.dispatcher.addr | ||
asyncore.dispatcher.handle_accepted | ||
asynchat.async_chat.encoding | ||
asynchat.async_chat.use_encoding | ||
asynchat.find_prefix_at_end | ||
pkgutil.ImpImporter\..* | ||
pkgutil.ImpLoader\..* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These type ignores look like some pretty weird mypy bugginess surrounding LiteralString. I thought probably makes sense to just ignore for now and figure it out later, so we can test 3.12 effectively
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you using mypy
master
when you ran tests locally for this PR? This looks like the regression I reported in python/mypy#15161 (comment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using mypy 1.3, I don't get any mypy or stubtest errors (on any Python version) if I remove these
type: ignore
s, so I think it is the regression I noted in python/mypy#15161 (comment)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I'd missed that, it's definitely the same thing. Hmm, I'm not sure what the best way to proceed is.