Update mypy to 1.16.0 (#14194)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
sobolevn
2025-06-01 17:40:42 +01:00
committed by GitHub
co-authored by Sebastian Rittau Alex Waygood
parent 09b6802dc7
commit eb495ff135
13 changed files with 72 additions and 78 deletions
@@ -9,6 +9,14 @@ wtforms.fields.core.Field.__get__
# to let mypy know that arbitrary attribute access is possible
wtforms.meta.DefaultMeta.__getattr__
# Should allow setting and deleting any attribute
wtforms.Flags.__delattr__
wtforms.Flags.__setattr__
wtforms.fields.Flags.__delattr__
wtforms.fields.Flags.__setattr__
wtforms.fields.core.Flags.__delattr__
wtforms.fields.core.Flags.__setattr__
# Error: variable differs from runtime
# ======================
# _unbound_fields has some weird semantics: due to the metaclass it
@@ -177,27 +177,27 @@ assert_type(with_descriptors.match_pattern_str_none, Union[str, None])
assert_type(with_descriptors.match_pattern_bytes, ReadableBuffer)
assert_type(with_descriptors.match_pattern_bytes_none, Union[ReadableBuffer, None])
assert_type(with_descriptors.convertible_not_none, int) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.convertible_not_none, int)
assert_type(with_descriptors.convertible_none, Union[int, None])
assert_type(with_descriptors.minmax_float, float) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.minmax_float, float)
assert_type(with_descriptors.minmax_float_none, Union[float, None])
assert_type(with_descriptors.minmax_int, int) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.minmax_int, int)
assert_type(with_descriptors.minmax_int_none, Union[int, None])
assert_type(with_descriptors.bool_not_none, bool) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.bool_not_none, bool)
assert_type(with_descriptors.bool_none, Union[bool, None])
assert_type(with_descriptors.datetime_not_none, datetime) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.datetime_not_none, datetime)
assert_type(with_descriptors.datetime_none, Union[datetime, None])
assert_type(with_descriptors.string_not_none, str) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.string_not_none, str)
assert_type(with_descriptors.string_none, Union[str, None])
assert_type(with_descriptors.float_not_none, float) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.float_not_none, float)
assert_type(with_descriptors.float_none, Union[float, None])
assert_type(with_descriptors.integer_not_none, int) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.integer_not_none, int)
assert_type(with_descriptors.integer_none, Union[int, None])
@@ -289,8 +289,8 @@ with_descriptors.match_pattern_bytes_none = 0 # type: ignore
with_descriptors.convertible_not_none = 0
with_descriptors.convertible_not_none = "0"
with_descriptors.convertible_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.convertible_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.convertible_not_none = None # type: ignore
with_descriptors.convertible_not_none = object() # type: ignore
with_descriptors.convertible_none = 0
with_descriptors.convertible_none = "0"
@@ -301,7 +301,7 @@ with_descriptors.convertible_none = object() # FIXME: False negative(?) in pyri
with_descriptors.minmax_float = 0
with_descriptors.minmax_float = "0"
with_descriptors.minmax_float = 0.0
with_descriptors.minmax_float = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.minmax_float = None # type: ignore
with_descriptors.minmax_float = object() # type: ignore
with_descriptors.minmax_float_none = 0
@@ -313,7 +313,7 @@ with_descriptors.minmax_float_none = object() # type: ignore
with_descriptors.minmax_int = 0
with_descriptors.minmax_int = "0"
with_descriptors.minmax_int = 0.0
with_descriptors.minmax_int = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.minmax_int = None # type: ignore
with_descriptors.minmax_int = object() # type: ignore
with_descriptors.minmax_int_none = 0
@@ -354,7 +354,7 @@ with_descriptors.datetime_none = time() # type: ignore
with_descriptors.string_not_none = ""
with_descriptors.string_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.string_not_none = None # type: ignore
with_descriptors.string_not_none = 0 # type: ignore
with_descriptors.string_none = ""
@@ -366,8 +366,8 @@ with_descriptors.float_not_none = 0
with_descriptors.float_not_none = 0.0
with_descriptors.float_not_none = "0"
with_descriptors.float_not_none = b"0"
with_descriptors.float_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.float_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.float_not_none = None # type: ignore
with_descriptors.float_not_none = object() # type: ignore
with_descriptors.float_none = 0
with_descriptors.float_none = 0.0
@@ -381,8 +381,8 @@ with_descriptors.integer_not_none = 0
with_descriptors.integer_not_none = 0.0
with_descriptors.integer_not_none = "0"
with_descriptors.integer_not_none = b"0"
with_descriptors.integer_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.integer_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.integer_not_none = None # type: ignore
with_descriptors.integer_not_none = object() # type: ignore
with_descriptors.integer_none = 0
with_descriptors.integer_none = 0.0
@@ -167,19 +167,19 @@ assert_type(with_descriptors.minmax_float_none, Union[float, None])
assert_type(with_descriptors.minmax_int, int)
assert_type(with_descriptors.minmax_int_none, Union[int, None])
assert_type(with_descriptors.bool_not_none, bool) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.bool_not_none, bool)
assert_type(with_descriptors.bool_none, Union[bool, None])
assert_type(with_descriptors.emptytag_not_none, bool)
assert_type(with_descriptors.emptytag_none, Union[bool, None])
assert_type(with_descriptors.string_not_none, str) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.string_not_none, str)
assert_type(with_descriptors.string_none, Union[str, None])
assert_type(with_descriptors.float_not_none, float) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.float_not_none, float)
assert_type(with_descriptors.float_none, Union[float, None])
assert_type(with_descriptors.integer_not_none, int) # type: ignore[assert-type] # False-positive in mypy
assert_type(with_descriptors.integer_not_none, int)
assert_type(with_descriptors.integer_none, Union[int, None])
@@ -264,15 +264,11 @@ with_descriptors.noneset_list = cast( # pyright: ignore[reportAttributeAccessIs
with_descriptors.convertible_not_none = 0
with_descriptors.convertible_not_none = "0"
with_descriptors.convertible_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.convertible_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.convertible_not_none = None # type: ignore
with_descriptors.convertible_not_none = object() # type: ignore
with_descriptors.convertible_not_none = cast(_HasTagAndGet[str], _)
with_descriptors.convertible_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[None], _
)
with_descriptors.convertible_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[object], _
)
with_descriptors.convertible_not_none = cast(_HasTagAndGet[None], _) # type: ignore
with_descriptors.convertible_not_none = cast(_HasTagAndGet[object], _) # type: ignore
with_descriptors.convertible_none = 0
with_descriptors.convertible_none = "0"
@@ -426,15 +422,11 @@ with_descriptors.float_not_none = 0
with_descriptors.float_not_none = 0.0
with_descriptors.float_not_none = "0"
with_descriptors.float_not_none = b"0"
with_descriptors.float_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.float_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.float_not_none = None # type: ignore
with_descriptors.float_not_none = object() # type: ignore
with_descriptors.float_not_none = cast(_HasTagAndGet[float], _)
with_descriptors.float_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[None], _
)
with_descriptors.float_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[object], _
)
with_descriptors.float_not_none = cast(_HasTagAndGet[None], _) # type: ignore
with_descriptors.float_not_none = cast(_HasTagAndGet[object], _) # type: ignore
with_descriptors.float_none = 0
with_descriptors.float_none = 0.0
@@ -451,15 +443,11 @@ with_descriptors.integer_not_none = 0
with_descriptors.integer_not_none = 0.0
with_descriptors.integer_not_none = "0"
with_descriptors.integer_not_none = b"0"
with_descriptors.integer_not_none = None # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.integer_not_none = object() # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
with_descriptors.integer_not_none = None # type: ignore
with_descriptors.integer_not_none = object() # type: ignore
with_descriptors.integer_not_none = cast(_HasTagAndGet[int], _)
with_descriptors.integer_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[None], _
)
with_descriptors.integer_not_none = cast( # pyright: ignore[reportAttributeAccessIssue] # false negative in mypy
_HasTagAndGet[object], _
)
with_descriptors.integer_not_none = cast(_HasTagAndGet[None], _) # type: ignore
with_descriptors.integer_not_none = cast(_HasTagAndGet[object], _) # type: ignore
with_descriptors.integer_none = 0
with_descriptors.integer_none = 0.0
@@ -38,10 +38,7 @@ 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.__all__
passlib.handlers.oracle.oracle11g
passlib.handlers.oracle.oracle10g
passlib.handlers.mysql.__all__
passlib.handlers.mysql.mysq41
# Compat tools are ignored:
passlib.utils.compat.*
@@ -12,6 +12,9 @@ Xlib.protocol.rq.DictWrapper.__lt__
Xlib.protocol.rq.Event.__gt__
Xlib.protocol.rq.Event.__lt__
# should allow setting any attribute
Xlib.protocol.rq.GetAttrData.__setattr__
# Can be None or str once instantiated
Xlib.protocol.rq.*.structcode
# Should only ever be str once instantiated
+4 -24
View File
@@ -53,14 +53,6 @@ reportlab.lib.utils.CIDict.get
reportlab.lib.utils.CIDict.pop
reportlab.lib.utils.CIDict.setdefault
# these have a __module__ argument which confuses stubtest
reportlab.lib.testutils.rlSkip
reportlab.lib.testutils.rlSkipIf
reportlab.lib.testutils.rlSkipUnless
# __map__ argument confuses stubtest
reportlab.lib.styles.str2alignment
# __new__ just forwards the arguments to the super class
# it doesn't actually accept arbitrary arguments
reportlab.platypus.doctemplate.PTCycle.__new__
@@ -83,6 +75,10 @@ reportlab.graphics.barcode.qrencoder.i
reportlab.lib.fonts.k
reportlab.lib.pdfencrypt.i
# should allow setting any attribute
reportlab.lib.abag.ABag.__setattr__
reportlab.lib.styles.PropertySet.__setattr__
# *-imports that cause a mess we don't want to propagate
reportlab.graphics.charts.lineplots.pi
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.EVEN_ODD
@@ -96,23 +92,7 @@ reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.shapeChecking
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.verbose
# messed up __all__ which contains just a string
reportlab.graphics.barcode.qr.C
reportlab.graphics.barcode.qr.Q
reportlab.graphics.barcode.qr.W
reportlab.graphics.barcode.qr.__all__
reportlab.graphics.barcode.qr.d
reportlab.graphics.barcode.qr.e
reportlab.graphics.barcode.qr.g
reportlab.graphics.barcode.qr.i
reportlab.graphics.barcode.qr.o
reportlab.graphics.barcode.qr.r
reportlab.graphics.barcode.qr.t
# spelling mistake in __all__
reportlab.graphics.barcode.ecc200datamatrix.ECC200datamatrix
# wasn't removed from __all__ by accident
reportlab.graphics.barcode.eanbc.isEanString
# Error: is not present at runtime
@@ -2,3 +2,6 @@
requests.packages.mod
requests.packages.package
requests.packages.target
# Should allow setting any attribute:
requests.structures.LookupDict.__setattr__
@@ -1,6 +1,5 @@
# VictoriaDayTuesdayAfterFirstMondayMay is not defined but used in __all__ runtime:
workalendar.europe.scotland.mixins.__all__
workalendar.europe.scotland.mixins.VictoriaDayTuesdayAfterFirstMondayMay
workalendar.core.CoreCalendar.name
workalendar.skyfield_astronomy