Skip to content
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 requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions stdlib/webbrowser.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
8 changes: 0 additions & 8 deletions stubs/ExifRead/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions stubs/PyScreeze/@tests/stubtest_allowlist_linux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# temp variable used to define scrotExists by checking if the command "scrot" exists
pyscreeze.whichProc
7 changes: 0 additions & 7 deletions stubs/cffi/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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__
3 changes: 0 additions & 3 deletions stubs/chevron/@tests/stubtest_allowlist.txt

This file was deleted.

3 changes: 0 additions & 3 deletions stubs/colorama/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
3 changes: 1 addition & 2 deletions stubs/colorama/@tests/stubtest_allowlist_linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 0 additions & 10 deletions stubs/dateparser/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions stubs/dockerfile-parse/@tests/stubtest_allowlist.txt

This file was deleted.

7 changes: 0 additions & 7 deletions stubs/fpdf2/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions stubs/influxdb-client/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -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
9 changes: 0 additions & 9 deletions stubs/netaddr/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
4 changes: 2 additions & 2 deletions stubs/paramiko/paramiko/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
3 changes: 0 additions & 3 deletions stubs/parsimonious/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
parsimonious.nodes.RuleDecoratorMeta.__new__

# Re-export:
parsimonious.nodes.version_info

# Magic:
parsimonious.adhoc_expression

Expand Down
7 changes: 2 additions & 5 deletions stubs/passlib/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.*

Expand Down
6 changes: 0 additions & 6 deletions stubs/pika/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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__
5 changes: 0 additions & 5 deletions stubs/pyasn1/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 0 additions & 3 deletions stubs/python-crontab/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions stubs/python-xlib/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 0 additions & 26 deletions stubs/requests/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions stubs/setuptools/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions stubs/toml/@tests/stubtest_allowlist.txt

This file was deleted.

8 changes: 4 additions & 4 deletions stubs/vobject/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions stubs/whatthepatch/whatthepatch/patch.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 0 additions & 4 deletions stubs/zxcvbn/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
zxcvbn.__main__

# re-exports:
zxcvbn.scoring.ADJACENCY_GRAPHS
zxcvbn.matching.FREQUENCY_LISTS
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/darwin-py310.txt
Original file line number Diff line number Diff line change
@@ -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)?
Expand Down
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/darwin-py37.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ctypes.wintypes
pwd.getpwnam
webbrowser.MacOSXOSAScript.__init__

# ==========
# Allowlist entries that cannot or should not be fixed
Expand Down
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/darwin-py38.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
webbrowser.MacOSXOSAScript.__init__

# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
Expand Down
2 changes: 0 additions & 2 deletions tests/stubtest_allowlists/darwin-py39.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
webbrowser.MacOSXOSAScript.__init__

# ==========
# Allowlist entries that cannot or should not be fixed
# ==========
Expand Down
1 change: 0 additions & 1 deletion tests/stubtest_allowlists/py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/stubtest_allowlists/py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading