From f7b57265ad8458e9793a8748f31ba6ef92bcace6 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Mon, 28 Oct 2024 08:24:57 -0500 Subject: [PATCH] require types-setuptools>=75.2.0 this is necessary to have https://github.com/python/typeshed/pull/12791 --- .ci/requirements-mypy.txt | 2 +- setup.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.ci/requirements-mypy.txt b/.ci/requirements-mypy.txt index c84a3533b85..f230edde0f3 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 2fe45d1ae6b..c8fc91a583b 100644 --- a/setup.py +++ b/setup.py @@ -16,11 +16,14 @@ 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"]}), ]