diff --git a/.ci/requirements-mypy.txt b/.ci/requirements-mypy.txt index c84a3533b..f230edde0 100644 --- a/.ci/requirements-mypy.txt +++ b/.ci/requirements-mypy.txt @@ -9,4 +9,4 @@ sphinx types-atheris types-defusedxml types-olefile -types-setuptools +types-setuptools>=75.2.0 diff --git a/setup.py b/setup.py index 2fe45d1ae..c8fc91a58 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,14 @@ import subprocess import sys import warnings from collections.abc import Iterator -from typing import Any +from typing import TYPE_CHECKING, Any from setuptools import Extension, setup from setuptools.command.build_ext import build_ext +if TYPE_CHECKING: + from setuptools import _BuildInfo + def get_version() -> str: version_file = "src/PIL/_version.py" @@ -1001,7 +1004,7 @@ def debug_build() -> bool: return hasattr(sys, "gettotalrefcount") or FUZZING_BUILD -libraries = [ +libraries: list[tuple[str, _BuildInfo]] = [ ("pil_imaging_mode", {"sources": ["src/libImaging/Mode.c"]}), ]