Update dependency mypy to v1.16.0 (#8991)

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
renovate[bot] 2025-06-07 11:07:21 +10:00 committed by GitHub
parent 1bf32ae892
commit f3b05d6fab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 8 deletions

View File

@ -1,4 +1,4 @@
mypy==1.15.0
mypy==1.16.0
IceSpringPySideStubs-PyQt6
IceSpringPySideStubs-PySide6
ipython

View File

@ -145,14 +145,16 @@ class TestFileJpeg:
assert k > 0.9
# roundtrip, and check again
im = self.roundtrip(im)
c, m, y, k = (x / 255.0 for x in im.getpixel((0, 0)))
cmyk = im.getpixel((0, 0))
assert isinstance(cmyk, tuple)
c, m, y, k = (x / 255.0 for x in cmyk)
assert c == 0.0
assert m > 0.8
assert y > 0.8
assert k == 0.0
c, m, y, k = (
x / 255.0 for x in im.getpixel((im.size[0] - 1, im.size[1] - 1))
)
cmyk = im.getpixel((im.size[0] - 1, im.size[1] - 1))
assert isinstance(cmyk, tuple)
k = cmyk[3] / 255.0
assert k > 0.9
def test_rgb(self) -> None:

View File

@ -671,6 +671,7 @@ class TestImage:
im_remapped = im.remap_palette(list(range(256)))
assert_image_equal(im, im_remapped)
assert im.palette is not None
assert im_remapped.palette is not None
assert im.palette.palette == im_remapped.palette.palette
# Test illegal image mode

View File

@ -31,7 +31,7 @@ import os
import subprocess
from enum import IntEnum
from functools import cached_property
from typing import IO, Any, Literal, NamedTuple, Union
from typing import IO, Any, Literal, NamedTuple, Union, cast
from . import (
Image,
@ -350,12 +350,15 @@ class GifImageFile(ImageFile.ImageFile):
if self._frame_palette:
if color * 3 + 3 > len(self._frame_palette.palette):
color = 0
return tuple(self._frame_palette.palette[color * 3 : color * 3 + 3])
return cast(
tuple[int, int, int],
tuple(self._frame_palette.palette[color * 3 : color * 3 + 3]),
)
else:
return (color, color, color)
self.dispose = None
self.dispose_extent = frame_dispose_extent
self.dispose_extent: tuple[int, int, int, int] | None = frame_dispose_extent
if self.dispose_extent and self.disposal_method >= 2:
try:
if self.disposal_method == 2: