diff --git a/requirements-tests.txt b/requirements-tests.txt index 8feed0fe0..de8477cc8 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,7 +5,7 @@ flake8-bugbear==23.1.20; python_version >= "3.8" # must match .pre-commit-confi flake8-noqa==1.3.0; python_version >= "3.8" # must match .pre-commit-config.yaml flake8-pyi==23.1.2; python_version >= "3.8" # must match .pre-commit-config.yaml isort==5.12.0; python_version >= "3.8" # must match .pre-commit-config.yaml -mypy==0.991 +mypy==1.0 packaging==23.0 pathspec>=0.10.3 pre-commit-hooks==4.4.0 # must match .pre-commit-config.yaml diff --git a/stdlib/webbrowser.pyi b/stdlib/webbrowser.pyi index d15ae49fd..02edd42e7 100644 --- a/stdlib/webbrowser.pyi +++ b/stdlib/webbrowser.pyi @@ -65,4 +65,9 @@ if sys.platform == "darwin": def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename` + if sys.version_info >= (3, 11): + def __init__(self, name: str = "default") -> None: ... + else: + def __init__(self, name: str) -> None: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... diff --git a/stubs/ExifRead/@tests/stubtest_allowlist.txt b/stubs/ExifRead/@tests/stubtest_allowlist.txt index 7a1262f27..57820b2cc 100644 --- a/stubs/ExifRead/@tests/stubtest_allowlist.txt +++ b/stubs/ExifRead/@tests/stubtest_allowlist.txt @@ -1,10 +1,2 @@ # Stub-only module. exifread._types - -# The following constants are only re-exported at runtime as a side effect -# of Python's import system. -exifread.DEFAULT_STOP_TAG -exifread.classes.DEFAULT_STOP_TAG -exifread.classes.EXIF_TAGS -exifread.classes.FIELD_TYPES -exifread.classes.IGNORE_TAGS diff --git a/stubs/PyScreeze/@tests/stubtest_allowlist_linux.txt b/stubs/PyScreeze/@tests/stubtest_allowlist_linux.txt new file mode 100644 index 000000000..fa9bd6fa0 --- /dev/null +++ b/stubs/PyScreeze/@tests/stubtest_allowlist_linux.txt @@ -0,0 +1,2 @@ +# temp variable used to define scrotExists by checking if the command "scrot" exists +pyscreeze.whichProc diff --git a/stubs/cffi/@tests/stubtest_allowlist.txt b/stubs/cffi/@tests/stubtest_allowlist.txt index 7a2812d7f..908583146 100644 --- a/stubs/cffi/@tests/stubtest_allowlist.txt +++ b/stubs/cffi/@tests/stubtest_allowlist.txt @@ -2,10 +2,3 @@ cffi.(api.)?FFI.CData cffi.(api.)?FFI.CType cffi.(api.)?FFI.buffer - -# Exists at runtime, but missing from stubs -cffi.vengine_cpy.__warningregistry__ - -# Unnecessary re-exports -cffi.cparser.COMMON_TYPES -cffi.verifier.__version_verifier_modules__ diff --git a/stubs/chevron/@tests/stubtest_allowlist.txt b/stubs/chevron/@tests/stubtest_allowlist.txt deleted file mode 100644 index c8e15f37d..000000000 --- a/stubs/chevron/@tests/stubtest_allowlist.txt +++ /dev/null @@ -1,3 +0,0 @@ -# These are re-exports which we consider an implementation detail: -chevron.main.version -chevron.renderer.linesep diff --git a/stubs/colorama/@tests/stubtest_allowlist.txt b/stubs/colorama/@tests/stubtest_allowlist.txt index 4eb2e3c1f..cee2f1962 100644 --- a/stubs/colorama/@tests/stubtest_allowlist.txt +++ b/stubs/colorama/@tests/stubtest_allowlist.txt @@ -42,8 +42,5 @@ colorama.ansi.AnsiStyle.RESET_ALL colorama.initialise.wrapped_stderr colorama.initialise.wrapped_stdout -# These are re-exports that are implementation detail: -colorama.ansitowin32.BEL - # Not planning on writing stubs for tests: colorama.tests.* diff --git a/stubs/colorama/@tests/stubtest_allowlist_linux.txt b/stubs/colorama/@tests/stubtest_allowlist_linux.txt index 7ecdad633..1fff10610 100644 --- a/stubs/colorama/@tests/stubtest_allowlist_linux.txt +++ b/stubs/colorama/@tests/stubtest_allowlist_linux.txt @@ -3,6 +3,5 @@ colorama.winterm.WinColor colorama.winterm.WinStyle colorama.winterm.WinTerm -# These are re-exports that are implementation detail: -colorama.ansitowin32.windll +# A re-export that's an implementation detail: colorama.winterm.get_osfhandle diff --git a/stubs/dateparser/@tests/stubtest_allowlist.txt b/stubs/dateparser/@tests/stubtest_allowlist.txt index e61115b95..40724a190 100644 --- a/stubs/dateparser/@tests/stubtest_allowlist.txt +++ b/stubs/dateparser/@tests/stubtest_allowlist.txt @@ -6,13 +6,3 @@ dateparser.search.detection.BaseLanguageDetector.iterate_applicable_languages # Timezone and other internal data: dateparser.data.date_translation_data.* - -# Re-exports: -dateparser.conf.date_order_chart -dateparser.conf.language_order -dateparser.languages.loader.language_locale_dict -dateparser.languages.loader.language_order -dateparser.languages.locale.ALWAYS_KEEP_TOKENS -dateparser.custom_language_detection.language_mapping.language_map -dateparser.custom_language_detection.fasttext.dateparser_model_home -dateparser.timezone_parser.timezone_info_list diff --git a/stubs/dockerfile-parse/@tests/stubtest_allowlist.txt b/stubs/dockerfile-parse/@tests/stubtest_allowlist.txt deleted file mode 100644 index 3adb07038..000000000 --- a/stubs/dockerfile-parse/@tests/stubtest_allowlist.txt +++ /dev/null @@ -1,3 +0,0 @@ -# These are re-exports which we consider an implementation detail -dockerfile_parse.parser.DOCKERFILE_FILENAME -dockerfile_parse.parser.COMMENT_INSTRUCTION diff --git a/stubs/fpdf2/@tests/stubtest_allowlist.txt b/stubs/fpdf2/@tests/stubtest_allowlist.txt index 593989e8b..b4c987bcb 100644 --- a/stubs/fpdf2/@tests/stubtest_allowlist.txt +++ b/stubs/fpdf2/@tests/stubtest_allowlist.txt @@ -2,13 +2,6 @@ fpdf.FPDF.output fpdf.fpdf.FPDF.output -# Unnecessary re-export from codecs -fpdf.syntax.BOM_UTF16_BE - -# stubtest doesn't recognize ImportError handler -fpdf.linearization.signer -fpdf.output.signer - # Argument has default at runtime, but using it raises a TypeError. fpdf.FPDF.set_creation_date fpdf.fpdf.FPDF.set_creation_date diff --git a/stubs/influxdb-client/@tests/stubtest_allowlist.txt b/stubs/influxdb-client/@tests/stubtest_allowlist.txt index 70e11067b..d38fbca2b 100644 --- a/stubs/influxdb-client/@tests/stubtest_allowlist.txt +++ b/stubs/influxdb-client/@tests/stubtest_allowlist.txt @@ -1,9 +1,2 @@ -# Imports that stubtest thinks should be re-exported. -influxdb_client.client.write.dataframe_serializer.DEFAULT_WRITE_PRECISION -influxdb_client.client.write.retry.random -influxdb_client.client.write_api.DEFAULT_WRITE_PRECISION -influxdb_client.client.write_api.random -influxdb_client.client.write_api_async.DEFAULT_WRITE_PRECISION - # Metaclass problem inherited from urllib3. influxdb_client.client.write.retry.WritesRetry diff --git a/stubs/netaddr/@tests/stubtest_allowlist.txt b/stubs/netaddr/@tests/stubtest_allowlist.txt index 6165bfd26..a77ef49fb 100644 --- a/stubs/netaddr/@tests/stubtest_allowlist.txt +++ b/stubs/netaddr/@tests/stubtest_allowlist.txt @@ -2,15 +2,6 @@ # ============================= netaddr.core.a # This is a temporary module attribute used to detect python version -# These are unnecessary re-exports -netaddr.ip.INET_PTON -netaddr.ip.N -netaddr.ip.NOHOST -netaddr.ip.P -netaddr.ip.Z -netaddr.ip.ZEROFILL - - # Error: is not present at runtime # ================================ netaddr.ip.iana.XMLRecordParser.__getattr__ # __init__ has `self.__dict__.update(kwargs)` diff --git a/stubs/paramiko/paramiko/util.pyi b/stubs/paramiko/paramiko/util.pyi index b8c76612d..723bbde7b 100644 --- a/stubs/paramiko/paramiko/util.pyi +++ b/stubs/paramiko/paramiko/util.pyi @@ -42,5 +42,5 @@ def clamp_value(minimum: int, val: int, maximum: int) -> int: ... # This function attempts to convert objects to bytes, # *but* just returns the object unchanged if that was unsuccessful! def asbytes(s: object) -> object: ... -def b(s: str | bytes, encoding: str = "utf-8") -> bytes: ... -def u(s: str | bytes, encoding: str = "utf-8") -> str: ... +def b(s: str | bytes, encoding: str = "utf8") -> bytes: ... +def u(s: str | bytes, encoding: str = "utf8") -> str: ... diff --git a/stubs/parsimonious/@tests/stubtest_allowlist.txt b/stubs/parsimonious/@tests/stubtest_allowlist.txt index b96ebbf0d..f870d6960 100644 --- a/stubs/parsimonious/@tests/stubtest_allowlist.txt +++ b/stubs/parsimonious/@tests/stubtest_allowlist.txt @@ -1,8 +1,5 @@ parsimonious.nodes.RuleDecoratorMeta.__new__ -# Re-export: -parsimonious.nodes.version_info - # Magic: parsimonious.adhoc_expression diff --git a/stubs/passlib/@tests/stubtest_allowlist.txt b/stubs/passlib/@tests/stubtest_allowlist.txt index 1954308b8..d2087ce33 100644 --- a/stubs/passlib/@tests/stubtest_allowlist.txt +++ b/stubs/passlib/@tests/stubtest_allowlist.txt @@ -37,15 +37,12 @@ passlib.utils.handlers.HasRounds.rounds # Errors in `__all__` at runtime: # TODO: change after https://github.com/python/mypy/pull/14217 is released -passlib.handlers.oracle +passlib.handlers.oracle.__all__ passlib.handlers.oracle.oracle11g passlib.handlers.oracle.oracle10g -passlib.handlers.mysql +passlib.handlers.mysql.__all__ passlib.handlers.mysql.mysq41 -# Mutable state because of the warnigns: -passlib.utils.des.__warningregistry__ - # Compat tools are ignored: passlib.utils.compat.* diff --git a/stubs/pika/@tests/stubtest_allowlist.txt b/stubs/pika/@tests/stubtest_allowlist.txt index 008ad7a1c..11f4140c6 100644 --- a/stubs/pika/@tests/stubtest_allowlist.txt +++ b/stubs/pika/@tests/stubtest_allowlist.txt @@ -25,12 +25,6 @@ pika.adapters.blocking_connection.BlockingConnection.publisher_confirms # created instances unusable, so we require the arguments in the stub. pika.spec.Queue.DeclareOk.__init__ -# Flagged by stubtest for unknown reasons. -pika.data.PY2 -pika.data.basestring -pika.spec.str_or_bytes -pika.validators.basestring - # Arguments have a sentinel default, which is not reflected in the stubs. pika.ConnectionParameters.__init__ pika.connection.ConnectionParameters.__init__ diff --git a/stubs/pyasn1/@tests/stubtest_allowlist.txt b/stubs/pyasn1/@tests/stubtest_allowlist.txt index 93df54d3f..2d7a6bbca 100644 --- a/stubs/pyasn1/@tests/stubtest_allowlist.txt +++ b/stubs/pyasn1/@tests/stubtest_allowlist.txt @@ -1,8 +1,3 @@ -# Unintended re-exports -pyasn1.compat.binary.version_info -pyasn1.compat.octets.version_info -pyasn1.compat.string.version_info - # type_check_only pyasn1.type.base.NoValue.plug diff --git a/stubs/python-crontab/@tests/stubtest_allowlist.txt b/stubs/python-crontab/@tests/stubtest_allowlist.txt index 12ab26021..083ad0d32 100644 --- a/stubs/python-crontab/@tests/stubtest_allowlist.txt +++ b/stubs/python-crontab/@tests/stubtest_allowlist.txt @@ -1,5 +1,2 @@ -# Re-export: -crontabs.X_OK - # stub does not have *args argument "args", but function doesn't actually accept positional args crontab.CronTab.remove_all diff --git a/stubs/python-xlib/@tests/stubtest_allowlist.txt b/stubs/python-xlib/@tests/stubtest_allowlist.txt index 90fabe566..6bc560550 100644 --- a/stubs/python-xlib/@tests/stubtest_allowlist.txt +++ b/stubs/python-xlib/@tests/stubtest_allowlist.txt @@ -20,9 +20,5 @@ Xlib.protocol.rq.*.name # Structs generate their attributes (@type_check_only) Xlib.protocol.rq.Struct.__getattr__ -# Iteration variable bleed into the global scope +# Iteration variable that bleeds into the global scope Xlib.protocol.rq.c -# Re-exports from six -Xlib.ext.xinput.integer_types -Xlib.protocol.display.PY3 -Xlib.protocol.rq.PY3 diff --git a/stubs/requests/@tests/stubtest_allowlist.txt b/stubs/requests/@tests/stubtest_allowlist.txt index 008db89f5..06ff56060 100644 --- a/stubs/requests/@tests/stubtest_allowlist.txt +++ b/stubs/requests/@tests/stubtest_allowlist.txt @@ -8,36 +8,10 @@ requests.adapters.PoolManager.proxy_config requests.adapters.PoolManager.urlopen requests.adapters.Retry.DEFAULT -# Unnecessary re-exported constants from requests.compat -requests.adapters.basestring -requests.auth.basestring -requests.utils.basestring -requests.utils.integer_types -requests.models.basestring - -# Unnecessary re-exported constant -# (you should access this as `requests.__version__` or `requests.__version__.__version__`, -# not `requests.help.requests_version`) -requests.help.requests_version - -# No reason to access this re-exported constant from `requests.sessions` instead of from `requests.utils` -requests.sessions.DEFAULT_PORTS - -# Unnecessary re-exports of third-party modules -requests.help.chardet -requests.help.cryptography -requests.help.pyopenssl -requests.help.OpenSSL - # Loop variables that leak into the global scope requests.packages.mod requests.packages.package requests.packages.target -# Internal implementation details, not for public consumption -requests.charset_normalizer_version -requests.chardet_version -requests.utils.HEADER_VALIDATORS - # Metaclass differs: requests.adapters.Retry diff --git a/stubs/setuptools/@tests/stubtest_allowlist.txt b/stubs/setuptools/@tests/stubtest_allowlist.txt index 59eaa688f..fdcdd0a54 100644 --- a/stubs/setuptools/@tests/stubtest_allowlist.txt +++ b/stubs/setuptools/@tests/stubtest_allowlist.txt @@ -29,3 +29,7 @@ pkg_resources.to_filename # Only present if docutils is installed setuptools._distutils.command.check.SilentReporter + +# Discrepancy in the value of the default +# between setuptools's version of distutils and the stdlib distutils +setuptools._distutils.core.Command.announce diff --git a/stubs/toml/@tests/stubtest_allowlist.txt b/stubs/toml/@tests/stubtest_allowlist.txt deleted file mode 100644 index b26f9eb28..000000000 --- a/stubs/toml/@tests/stubtest_allowlist.txt +++ /dev/null @@ -1,2 +0,0 @@ -# re-exports -toml.decoder.linesep diff --git a/stubs/vobject/@tests/stubtest_allowlist.txt b/stubs/vobject/@tests/stubtest_allowlist.txt index be42939db..22f329834 100644 --- a/stubs/vobject/@tests/stubtest_allowlist.txt +++ b/stubs/vobject/@tests/stubtest_allowlist.txt @@ -7,16 +7,16 @@ vobject.base.VBase.__init__ vobject.win32tz # dependencies -vobject.change_tz.PyICU vobject.icalendar.Pytz vobject.icalendar.pytz -# re-exports -vobject.hcalendar.CRLF - # python2 compat vobject.base.basestring vobject.base.str_ vobject.base.to_unicode vobject.base.to_basestring vobject.vcard.basestring + +# implementation details that users shouldn't depend on +vobject.base.formatter +vobject.base.handler diff --git a/stubs/whatthepatch/whatthepatch/patch.pyi b/stubs/whatthepatch/whatthepatch/patch.pyi index 669e187a4..488646774 100644 --- a/stubs/whatthepatch/whatthepatch/patch.pyi +++ b/stubs/whatthepatch/whatthepatch/patch.pyi @@ -24,33 +24,44 @@ class Change(NamedTuple): hunk: int file_timestamp_str: str + diffcmd_header: Pattern[str] unified_header_index: Pattern[str] unified_header_old_line: Pattern[str] unified_header_new_line: Pattern[str] unified_hunk_start: Pattern[str] unified_change: Pattern[str] + context_header_old_line: Pattern[str] context_header_new_line: Pattern[str] context_hunk_start: Pattern[str] context_hunk_old: Pattern[str] context_hunk_new: Pattern[str] context_change: Pattern[str] + ed_hunk_start: Pattern[str] ed_hunk_end: Pattern[str] rcs_ed_hunk_start: Pattern[str] + default_hunk_start: Pattern[str] default_hunk_mid: Pattern[str] default_change: Pattern[str] + git_diffcmd_header: Pattern[str] git_header_index: Pattern[str] git_header_old_line: Pattern[str] git_header_new_line: Pattern[str] git_header_file_mode: Pattern[str] git_header_binary_file: Pattern[str] +git_binary_patch_start: Pattern[str] +git_binary_literal_start: Pattern[str] +git_binary_delta_start: Pattern[str] +base85string: Pattern[str] + bzr_header_index: Pattern[str] bzr_header_old_line: Pattern[str] bzr_header_new_line: Pattern[str] + svn_header_index: Pattern[str] svn_header_timestamp_version: Pattern[str] svn_header_timestamp: Pattern[str] diff --git a/stubs/zxcvbn/@tests/stubtest_allowlist.txt b/stubs/zxcvbn/@tests/stubtest_allowlist.txt index eca494fa5..5842f5953 100644 --- a/stubs/zxcvbn/@tests/stubtest_allowlist.txt +++ b/stubs/zxcvbn/@tests/stubtest_allowlist.txt @@ -1,5 +1 @@ zxcvbn.__main__ - -# re-exports: -zxcvbn.scoring.ADJACENCY_GRAPHS -zxcvbn.matching.FREQUENCY_LISTS diff --git a/tests/stubtest_allowlists/darwin-py310.txt b/tests/stubtest_allowlists/darwin-py310.txt index f41bd702d..23992673a 100644 --- a/tests/stubtest_allowlists/darwin-py310.txt +++ b/tests/stubtest_allowlists/darwin-py310.txt @@ -1,5 +1,4 @@ _?curses.color_pair -webbrowser.MacOSXOSAScript.__init__ # Github Actions on macOS with Python 3.10.5 claims these are missing, but they do exist locally (locale.bind_textdomain_codeset)? diff --git a/tests/stubtest_allowlists/darwin-py37.txt b/tests/stubtest_allowlists/darwin-py37.txt index cfd8f1b6b..e300b9f16 100644 --- a/tests/stubtest_allowlists/darwin-py37.txt +++ b/tests/stubtest_allowlists/darwin-py37.txt @@ -1,6 +1,5 @@ ctypes.wintypes pwd.getpwnam -webbrowser.MacOSXOSAScript.__init__ # ========== # Allowlist entries that cannot or should not be fixed diff --git a/tests/stubtest_allowlists/darwin-py38.txt b/tests/stubtest_allowlists/darwin-py38.txt index 1617e024e..eefb793f8 100644 --- a/tests/stubtest_allowlists/darwin-py38.txt +++ b/tests/stubtest_allowlists/darwin-py38.txt @@ -1,5 +1,3 @@ -webbrowser.MacOSXOSAScript.__init__ - # ========== # Allowlist entries that cannot or should not be fixed # ========== diff --git a/tests/stubtest_allowlists/darwin-py39.txt b/tests/stubtest_allowlists/darwin-py39.txt index 1617e024e..eefb793f8 100644 --- a/tests/stubtest_allowlists/darwin-py39.txt +++ b/tests/stubtest_allowlists/darwin-py39.txt @@ -1,5 +1,3 @@ -webbrowser.MacOSXOSAScript.__init__ - # ========== # Allowlist entries that cannot or should not be fixed # ========== diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 739a3db42..a3c77a1b9 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -84,7 +84,6 @@ _collections_abc.Iterable.__class_getitem__ _collections_abc.MappingView.__class_getitem__ _csv.Reader _csv.Writer -asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this bdb.Breakpoint.clearBreakpoints distutils.util.get_host_platform inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index ed6ce05f4..12adfda65 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -13,10 +13,9 @@ _collections_abc.ValuesView.__reversed__ _csv.Reader _csv.Writer argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group -asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this configparser.LegacyInterpolation.__init__ enum.Enum.__init__ -# TODO: The stub for enum is nothing like the implementation +# TODO: The stub for enum.auto is nothing like the implementation enum.auto.__init__ enum.auto.value fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 480d47fc3..78e7adbd2 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -67,6 +67,10 @@ tempfile.SpooledTemporaryFile.readable tempfile.SpooledTemporaryFile.seekable tempfile.SpooledTemporaryFile.writable +# Default values given in the stub are a white lie, see #9637 +tkinter.Tcl +tkinter.Tk.__init__ + # Exists at runtime, but missing from stubs contextvars.ContextVar.__class_getitem__ datetime.datetime_CAPI @@ -76,7 +80,6 @@ distutils.cygwinccompiler.RE_VERSION distutils.dist.command_re distutils.fancy_getopt.longopt_re distutils.fancy_getopt.neg_alias_re -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -91,7 +94,6 @@ ssl.OP_ENABLE_MIDDLEBOX_COMPAT ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT ssl.SSLObject.verify_client_post_handshake ssl.SSLSocket.verify_client_post_handshake -stringprep.unicodedata # re-exported from unicodedata tempfile.SpooledTemporaryFile.softspace tkinter.Tk.split tkinter.commondialog.[A-Z_]+ @@ -156,7 +158,6 @@ types.FunctionType.__get__ types.LambdaType.__get__ # Missing from distutils (deprecated, to be removed in 3.12) -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -184,7 +185,6 @@ distutils.core.Distribution.parse_command_line distutils.core.Distribution.print_command_list distutils.core.Distribution.reinitialize_command distutils.core.Distribution.run_commands -distutils.cygwinccompiler.PIPE distutils.cygwinccompiler.is_cygwingcc distutils.dist.Distribution.announce distutils.dist.Distribution.common_usage diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index b8377089c..e9667438e 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -34,7 +34,6 @@ collections.KeysView.__reversed__ collections.ValuesView.__reversed__ collections.Mapping.__reversed__ # Set to None at runtime for a better error message distutils.command.bdist_wininst # see #6523 -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -89,6 +88,10 @@ tempfile.SpooledTemporaryFile.readable tempfile.SpooledTemporaryFile.seekable tempfile.SpooledTemporaryFile.writable +# Default values given in the stub are a white lie, see #9637 +tkinter.Tcl +tkinter.Tk.__init__ + # Exists at runtime, but missing from stubs contextvars.ContextVar.__class_getitem__ datetime.datetime_CAPI @@ -111,7 +114,6 @@ multiprocessing.managers.SharedMemoryServer.shutdown multiprocessing.managers.SharedMemoryServer.track_segment plistlib.Data.asBase64 plistlib.Data.fromBase64 -stringprep.unicodedata # re-exported from unicodedata tempfile.SpooledTemporaryFile.softspace tkinter.Tk.split tkinter.commondialog.[A-Z_]+ @@ -173,7 +175,6 @@ types.FunctionType.__get__ types.LambdaType.__get__ # Missing from distutils (deprecated, to be removed in 3.12) -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -201,7 +202,6 @@ distutils.core.Distribution.parse_command_line distutils.core.Distribution.print_command_list distutils.core.Distribution.reinitialize_command distutils.core.Distribution.run_commands -distutils.cygwinccompiler.PIPE distutils.cygwinccompiler.is_cygwingcc distutils.dist.Distribution.announce distutils.dist.Distribution.common_usage diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 41847807d..54b0f0813 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -34,7 +34,6 @@ collections.ValuesView.__reversed__ contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ distutils.command.bdist_wininst # see #6523 -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -112,7 +111,6 @@ multiprocessing.managers.SharedMemoryServer.public multiprocessing.managers.SharedMemoryServer.release_segment multiprocessing.managers.SharedMemoryServer.shutdown multiprocessing.managers.SharedMemoryServer.track_segment -stringprep.unicodedata # re-exported from unicodedata types.GenericAlias.__mro_entries__ typing._SpecialForm.__mro_entries__ @@ -172,7 +170,6 @@ types.FunctionType.__get__ types.LambdaType.__get__ # Missing from distutils (deprecated, to be removed in 3.12) -distutils.core.DEBUG distutils.core.USAGE distutils.core.extension_keywords distutils.core.gen_usage @@ -200,7 +197,6 @@ distutils.core.Distribution.parse_command_line distutils.core.Distribution.print_command_list distutils.core.Distribution.reinitialize_command distutils.core.Distribution.run_commands -distutils.cygwinccompiler.PIPE distutils.cygwinccompiler.is_cygwingcc distutils.dist.Distribution.announce distutils.dist.Distribution.common_usage diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index cad267396..a035c9ad7 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -30,6 +30,7 @@ _weakref.CallableProxyType.__getattr__ # Should have all attributes of proxy _weakref.ProxyType.__getattr__ # Should have all attributes of proxy _weakref.ReferenceType.__call__ # C function default annotation is wrong _weakref.ReferenceType.__init__ # Runtime defines __new__ but stubtest thinks __init__ is also defined. +argparse.ArgumentParser.__init__ # stubtest doesn't recognise the runtime default (a class) as being compatible with a callback protocol (the stub annotation) argparse.Namespace.__getattr__ # The whole point of this class is its attributes are dynamic asynchat.async_chat.encoding # Removal planned for 3.12, can add if someone needs this asynchat.async_chat.use_encoding # Removal planned for 3.12, can add if someone needs this @@ -132,7 +133,7 @@ lib2to3.pytree.NegatedPattern.match lib2to3.pytree.NegatedPattern.match_seq # LC_MESSAGES is sometimes present in __all__, sometimes not, # so stubtest will sometimes complain about exported names being different at runtime to the exported names in the stub -(locale)? +(locale.__all__)? multiprocessing.JoinableQueue multiprocessing.Queue multiprocessing.SimpleQueue @@ -493,17 +494,7 @@ turtle.ScrolledCanvas.find_all turtle.ScrolledCanvas.select_clear turtle.ScrolledCanvas.select_item -# Unnecessary re-exports -asyncore\.E[A-Z]+ # re-exported from errno -asyncore.errorcode # re-exported from errno -email._header_value_parser.hexdigits -logging.handlers.ST_[A-Z]+ -xml.dom.expatbuilder.EMPTY_NAMESPACE -xml.dom.expatbuilder.EMPTY_PREFIX -xml.dom.expatbuilder.XMLNS_NAMESPACE -xml.dom.minidom.EMPTY_NAMESPACE -xml.dom.minidom.EMPTY_PREFIX -xml.dom.minidom.XMLNS_NAMESPACE +# Unnecessary re-export xml.dom.minidom.StringTypes # __all__-related weirdness (see #6523) @@ -655,11 +646,7 @@ distutils.ccompiler.compiler_class distutils.cmd.Command.dump_options distutils.cmd.Command.ensure_finalized distutils.command.bdist -distutils.command.bdist_rpm.DEBUG -distutils.command.build_ext.USER_BASE -distutils.command.build_scripts.ST_MODE distutils.command.install.* -distutils.command.install_scripts.ST_MODE distutils.core.Distribution.finalize_options distutils.core.Distribution.get_command_class distutils.core.Distribution.get_command_list @@ -681,7 +668,6 @@ distutils.cygwinccompiler.check_config_h distutils.cygwinccompiler.get_msvcr distutils.cygwinccompiler.get_versions distutils.dir_util.ensure_relative -distutils.dist.DEBUG distutils.dist.Distribution.finalize_options distutils.dist.Distribution.get_command_class distutils.dist.Distribution.get_command_list @@ -722,7 +708,6 @@ distutils.msvccompiler.get_build_version distutils.msvccompiler.normalize_and_reduce_paths distutils.msvccompiler.read_keys distutils.msvccompiler.read_values -distutils.spawn.DEBUG distutils.sysconfig.BASE_EXEC_PREFIX distutils.sysconfig.BASE_PREFIX distutils.sysconfig.build_flags diff --git a/tests/stubtest_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index 67141687b..4d5ef5db4 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -1,6 +1,4 @@ ctypes.GetLastError # Is actually a pointer -distutils.archive_util.getgrnam -distutils.archive_util.getpwnam distutils.msvccompiler.HKEYS locale.[A-Z0-9_]+ # Constants that should be moved to _locale and re-exported conditionally locale.nl_langinfo # Function that should be moved to _locale and re-exported conditionally @@ -14,7 +12,6 @@ selectors.KqueueSelector signal.SIGEMT signal.SIGINFO winsound.SND_APPLICATION -xmlrpc.server.fcntl # Exists at runtime, but missing from stubs _msi.MSIError