From f99e8b0615182bb0f17d9d126019d8d72c207ab3 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 16 Oct 2023 17:34:45 -0400 Subject: [PATCH] Bump Pillow to 10.1.* (#10897) --- stubs/Pillow/@tests/stubtest_allowlist.txt | 6 ------ stubs/Pillow/@tests/stubtest_allowlist_win32.txt | 2 -- stubs/Pillow/METADATA.toml | 3 +-- stubs/Pillow/PIL/EpsImagePlugin.pyi | 5 +++-- stubs/Pillow/PIL/IcnsImagePlugin.pyi | 1 - stubs/Pillow/PIL/IcoImagePlugin.pyi | 1 - stubs/Pillow/PIL/Image.pyi | 11 ++++++++++- stubs/Pillow/PIL/ImageDraw.pyi | 8 ++++++++ stubs/Pillow/PIL/ImageFont.pyi | 2 +- stubs/Pillow/PIL/ImageOps.pyi | 1 + stubs/Pillow/PIL/JpegImagePlugin.pyi | 1 - stubs/Pillow/PIL/PsdImagePlugin.pyi | 1 - 12 files changed, 24 insertions(+), 18 deletions(-) delete mode 100644 stubs/Pillow/@tests/stubtest_allowlist_win32.txt diff --git a/stubs/Pillow/@tests/stubtest_allowlist.txt b/stubs/Pillow/@tests/stubtest_allowlist.txt index 68c616af0..8ac755738 100644 --- a/stubs/Pillow/@tests/stubtest_allowlist.txt +++ b/stubs/Pillow/@tests/stubtest_allowlist.txt @@ -27,9 +27,3 @@ PIL.XVThumbImagePlugin.r # Forwarded arguments PIL\.TiffImagePlugin\.IFDRational\.__[a-z]+__ - -# Already removed in the 10.0.x branch, but still present in 10.0.0 -PIL.Image.MEDIANCUT -PIL.Image.MAXCOVERAGE -PIL.Image.FASTOCTREE -PIL.Image.LIBIMAGEQUANT diff --git a/stubs/Pillow/@tests/stubtest_allowlist_win32.txt b/stubs/Pillow/@tests/stubtest_allowlist_win32.txt deleted file mode 100644 index e1b308eb3..000000000 --- a/stubs/Pillow/@tests/stubtest_allowlist_win32.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Loop variables leaked in global scope -PIL.EpsImagePlugin.binary diff --git a/stubs/Pillow/METADATA.toml b/stubs/Pillow/METADATA.toml index 9dc403e84..4e9663bc3 100644 --- a/stubs/Pillow/METADATA.toml +++ b/stubs/Pillow/METADATA.toml @@ -1,6 +1,5 @@ -version = "10.0.*" +version = "10.1.*" upstream_repository = "https://github.com/python-pillow/Pillow" -partial_stub = true [tool.stubtest] stubtest_requirements = ["olefile"] diff --git a/stubs/Pillow/PIL/EpsImagePlugin.pyi b/stubs/Pillow/PIL/EpsImagePlugin.pyi index c480388c9..8f62e26f1 100644 --- a/stubs/Pillow/PIL/EpsImagePlugin.pyi +++ b/stubs/Pillow/PIL/EpsImagePlugin.pyi @@ -9,8 +9,10 @@ from .ImageFile import ImageFile split: Incomplete field: Incomplete if sys.platform == "win32": - gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False] + gs_binary: Literal["gswin32c", "gswin64c", "gs", False, None] + gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False, None] else: + gs_binary: Literal["gs", False, None] gs_windows_binary: None def has_ghostscript(): ... @@ -28,7 +30,6 @@ class EpsImageFile(ImageFile): format_description: ClassVar[str] mode_map: Incomplete im: Incomplete - mode: Incomplete tile: Incomplete def load(self, scale: int = 1, transparency: bool = False) -> _PixelAccessor: ... def load_seek(self, *args, **kwargs) -> None: ... diff --git a/stubs/Pillow/PIL/IcnsImagePlugin.pyi b/stubs/Pillow/PIL/IcnsImagePlugin.pyi index 95650a31c..f7218692e 100644 --- a/stubs/Pillow/PIL/IcnsImagePlugin.pyi +++ b/stubs/Pillow/PIL/IcnsImagePlugin.pyi @@ -34,5 +34,4 @@ class IcnsImageFile(ImageFile): def size(self, value) -> None: ... best_size: Incomplete im: Incomplete - mode: Incomplete def load(self) -> _PixelAccessor: ... diff --git a/stubs/Pillow/PIL/IcoImagePlugin.pyi b/stubs/Pillow/PIL/IcoImagePlugin.pyi index 2a0b92fa2..a8a61e4bb 100644 --- a/stubs/Pillow/PIL/IcoImagePlugin.pyi +++ b/stubs/Pillow/PIL/IcoImagePlugin.pyi @@ -23,6 +23,5 @@ class IcoImageFile(ImageFile): @size.setter def size(self, value) -> None: ... im: Incomplete - mode: Incomplete def load(self) -> _PixelAccessor: ... def load_seek(self) -> None: ... diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 14c95dad8..8e03aeef2 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -124,6 +124,12 @@ class Quantize(IntEnum): FASTOCTREE: Literal[2] LIBIMAGEQUANT: Literal[3] +# All Quantize items +MEDIANCUT: Literal[0] +MAXCOVERAGE: Literal[1] +FASTOCTREE: Literal[2] +LIBIMAGEQUANT: Literal[3] + ID: list[str] OPEN: dict[str, Any] MIME: dict[str, str] @@ -161,7 +167,6 @@ class Image: format: ClassVar[str | None] format_description: ClassVar[str | None] im: Incomplete - mode: _Mode palette: Incomplete info: dict[Incomplete, Incomplete] readonly: int @@ -176,6 +181,8 @@ class Image: def height(self) -> int: ... @property def size(self) -> tuple[int, int]: ... + @property + def mode(self) -> _Mode: ... def __enter__(self) -> Self: ... def __exit__(self, *args: Unused) -> None: ... def close(self) -> None: ... @@ -219,6 +226,8 @@ class Image: def get_child_images(self) -> list[Image]: ... def getim(self): ... def getpalette(self, rawmode: str | None = "RGB") -> list[int] | None: ... + @property + def has_transparency_data(self) -> bool: ... def apply_transparency(self) -> None: ... def getpixel(self, xy: tuple[int, int]): ... def getprojection(self) -> tuple[list[int], list[int]]: ... diff --git a/stubs/Pillow/PIL/ImageDraw.pyi b/stubs/Pillow/PIL/ImageDraw.pyi index fd5f4c74c..d28771900 100644 --- a/stubs/Pillow/PIL/ImageDraw.pyi +++ b/stubs/Pillow/PIL/ImageDraw.pyi @@ -99,6 +99,8 @@ class ImageDraw: stroke_width: int = 0, stroke_fill: _Ink | None = None, embedded_color: bool = False, + *, + font_size: int | None = None, ) -> None: ... def textlength( self, @@ -108,6 +110,8 @@ class ImageDraw: features: Sequence[str] | None = None, language: str | None = None, embedded_color: bool = False, + *, + font_size: int | None = None, ) -> float: ... def textbbox( self, @@ -122,6 +126,8 @@ class ImageDraw: language: str | None = None, stroke_width: int = 0, embedded_color: bool = False, + *, + font_size: int | None = None, ) -> tuple[int, int, int, int]: ... def multiline_textbbox( self, @@ -136,6 +142,8 @@ class ImageDraw: language: str | None = None, stroke_width: int = 0, embedded_color: bool = False, + *, + font_size: int | None = None, ) -> tuple[int, int, int, int]: ... def Draw(im: Image, mode: str | None = None) -> ImageDraw: ... diff --git a/stubs/Pillow/PIL/ImageFont.pyi b/stubs/Pillow/PIL/ImageFont.pyi index 08b987e50..605f4f4cb 100644 --- a/stubs/Pillow/PIL/ImageFont.pyi +++ b/stubs/Pillow/PIL/ImageFont.pyi @@ -111,4 +111,4 @@ def truetype( layout_engine: Layout | None = None, ) -> FreeTypeFont: ... def load_path(filename: str | bytes) -> ImageFont: ... -def load_default() -> ImageFont: ... +def load_default(size: int | None = None) -> ImageFont: ... diff --git a/stubs/Pillow/PIL/ImageOps.pyi b/stubs/Pillow/PIL/ImageOps.pyi index e02190f65..c9f4f0275 100644 --- a/stubs/Pillow/PIL/ImageOps.pyi +++ b/stubs/Pillow/PIL/ImageOps.pyi @@ -24,6 +24,7 @@ def colorize( midpoint: int = 127, ) -> Image: ... def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ... +def cover(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ... def pad( image: Image, size: _Size, diff --git a/stubs/Pillow/PIL/JpegImagePlugin.pyi b/stubs/Pillow/PIL/JpegImagePlugin.pyi index 0b74b1070..bb938eab4 100644 --- a/stubs/Pillow/PIL/JpegImagePlugin.pyi +++ b/stubs/Pillow/PIL/JpegImagePlugin.pyi @@ -16,7 +16,6 @@ class JpegImageFile(ImageFile): format: ClassVar[Literal["JPEG", "MPO"]] format_description: ClassVar[str] def load_read(self, read_bytes): ... - mode: Incomplete tile: Incomplete decoderconfig: Incomplete def draft(self, mode, size): ... diff --git a/stubs/Pillow/PIL/PsdImagePlugin.pyi b/stubs/Pillow/PIL/PsdImagePlugin.pyi index f6e620b93..452f087de 100644 --- a/stubs/Pillow/PIL/PsdImagePlugin.pyi +++ b/stubs/Pillow/PIL/PsdImagePlugin.pyi @@ -9,7 +9,6 @@ MODES: Incomplete class PsdImageFile(ImageFile): format: ClassVar[Literal["PSD"]] format_description: ClassVar[str] - mode: Incomplete tile: Incomplete frame: Incomplete fp: Incomplete