importlib.metadata: Improve and test SimplePath protocol (#11436)

Co-authored-by: layday <layday@protonmail.com>
This commit is contained in:
Jelle Zijlstra
2024-02-18 00:36:01 -08:00
committed by GitHub
parent e961db9492
commit e5d25a7605
6 changed files with 60 additions and 8 deletions

View File

@@ -180,6 +180,8 @@ def run_testcases(
# Avoid race conditions when reading the cache
# (https://github.com/python/typeshed/issues/11220)
"--no-incremental",
# Not useful for the test cases
"--disable-error-code=empty-body",
]
if package.is_stdlib:

View File

@@ -13,7 +13,6 @@ gettext.install
gettext.translation
importlib._abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
importlib.abc.Finder.find_module
importlib.metadata._meta.SimplePath.__truediv__ # See comments in the stub
# platform.uname_result's processor field is now dynamically made to exist
platform.uname_result.__match_args__
platform.uname_result.__new__
@@ -26,6 +25,10 @@ typing._SpecialForm.__mro_entries__
weakref.ProxyType.__reversed__ # Doesn't really exist
builtins.ellipsis # type is not exposed anywhere
# Runtime definition of protocol is incorrect
importlib.metadata._meta.SimplePath.__truediv__
importlib.metadata._meta.SimplePath.joinpath
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+

View File

@@ -18,6 +18,10 @@ tkinter._VersionInfoType.__doc__
typing.NewType.__mro_entries__
builtins.ellipsis # type is not exposed anywhere
# Runtime definition of protocol is incorrect
importlib.metadata._meta.SimplePath.__truediv__
importlib.metadata._meta.SimplePath.joinpath
# Modules that exist at runtime, but shouldn't be added to typeshed
ctypes.test
ctypes\.test\..+

View File

@@ -75,6 +75,7 @@ types.GenericAlias.__getattr__
types.GenericAlias.__mro_entries__
sys._monitoring # Doesn't really exist. See comments in the stub.
weakref.ProxyType.__reversed__ # Doesn't really exist
importlib.metadata._meta.SimplePath.joinpath # Incorrect runtime definition
# sys attributes that are not always defined
sys.last_exc