Drop support for Python 3.9 (#137)

This commit is contained in:
Hugo van Kemenade 2025-08-02 11:22:16 +03:00 committed by GitHub
commit 956ee04f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 24 additions and 23 deletions

View File

@ -27,6 +27,7 @@ python3 -m pip install --upgrade wheel
python3 -m pip install coverage python3 -m pip install coverage
python3 -m pip install defusedxml python3 -m pip install defusedxml
python3 -m pip install ipython python3 -m pip install ipython
python3 -m pip install numpy
python3 -m pip install olefile python3 -m pip install olefile
python3 -m pip install -U pytest python3 -m pip install -U pytest
python3 -m pip install -U pytest-cov python3 -m pip install -U pytest-cov
@ -36,9 +37,6 @@ python3 -m pip install pyroma
# fails on beta 3.14 and PyPy # fails on beta 3.14 and PyPy
python3 -m pip install --only-binary=:all: pyarrow || true python3 -m pip install --only-binary=:all: pyarrow || true
python3 -m pip install numpy
# PyQt6 doesn't support PyPy3 # PyQt6 doesn't support PyPy3
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0 sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0

View File

@ -208,9 +208,10 @@ def test_exceptions() -> None:
ImageCms.getProfileName(None) # type: ignore[arg-type] ImageCms.getProfileName(None) # type: ignore[arg-type]
skip_missing() skip_missing()
# Python <= 3.9: "an integer is required (got type NoneType)" with pytest.raises(
# Python > 3.9: "'NoneType' object cannot be interpreted as an integer" ImageCms.PyCMSError,
with pytest.raises(ImageCms.PyCMSError, match="integer"): match="'NoneType' object cannot be interpreted as an integer",
):
ImageCms.isIntentSupported(SRGB, None, None) # type: ignore[arg-type] ImageCms.isIntentSupported(SRGB, None, None) # type: ignore[arg-type]

View File

@ -19,13 +19,13 @@ These platforms are built and tested for every change.
+==================================+============================+=====================+ +==================================+============================+=====================+
| Alpine | 3.12 | x86-64 | | Alpine | 3.12 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Amazon Linux 2 | 3.9 | x86-64 | | Amazon Linux 2 | 3.10 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Amazon Linux 2023 | 3.9 | x86-64 | | Amazon Linux 2023 | 3.11 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Arch | 3.13 | x86-64 | | Arch | 3.13 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| CentOS Stream 9 | 3.9 | x86-64 | | CentOS Stream 9 | 3.10 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| CentOS Stream 10 | 3.12 | x86-64 | | CentOS Stream 10 | 3.12 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
@ -42,16 +42,16 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Ubuntu Linux 22.04 LTS (Jammy) | 3.10 | x86-64 | | Ubuntu Linux 22.04 LTS (Jammy) | 3.10 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Ubuntu Linux 24.04 LTS (Noble) | 3.10, 3.11, | x86-64 | | Ubuntu Linux 24.04 LTS (Noble) | 3.10, 3.11, 3.12, 3.13, | x86-64 |
| | 3.12, 3.13, 3.14, PyPy3 | | | | 3.14, PyPy3 | |
| +----------------------------+---------------------+ | +----------------------------+---------------------+
| | 3.12 | arm64v8, ppc64le, | | | 3.12 | arm64v8, ppc64le, |
| | | s390x | | | | s390x |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Windows Server 2022 | 3.10 | x86 | | Windows Server 2022 | 3.10 | x86 |
| +----------------------------+---------------------+ | +----------------------------+---------------------+
| | 3.11, 3.12, 3.13, | x86-64 | | | 3.11, 3.12, 3.13, 3.14, | x86-64 |
| | 3.14, PyPy3 | | | | PyPy3 | |
| +----------------------------+---------------------+ | +----------------------------+---------------------+
| | 3.12 (MinGW) | x86-64 | | | 3.12 (MinGW) | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+

View File

@ -185,7 +185,6 @@ lint.ignore = [
"PT011", # pytest-raises-too-broad "PT011", # pytest-raises-too-broad
"PT012", # pytest-raises-with-multiple-statements "PT012", # pytest-raises-with-multiple-statements
"PT017", # pytest-assert-in-except "PT017", # pytest-assert-in-except
"PYI026", # flake8-pyi: typing.TypeAlias added in Python 3.10
"PYI034", # flake8-pyi: typing.Self added in Python 3.11 "PYI034", # flake8-pyi: typing.Self added in Python 3.11
"UP038", # pyupgrade: deprecated rule "UP038", # pyupgrade: deprecated rule
] ]

View File

@ -31,7 +31,7 @@ import os
import subprocess import subprocess
from enum import IntEnum from enum import IntEnum
from functools import cached_property from functools import cached_property
from typing import IO, Any, Literal, NamedTuple, cast from typing import Any, NamedTuple, cast
from . import ( from . import (
Image, Image,
@ -49,6 +49,8 @@ from ._util import DeferredError
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import IO, Literal
from . import _imaging from . import _imaging
from ._typing import Buffer from ._typing import Buffer

View File

@ -33,22 +33,23 @@ from __future__ import annotations
import math import math
import struct import struct
from collections.abc import Callable, Sequence from collections.abc import Sequence
from typing import cast from typing import cast
from . import Image, ImageColor from . import Image, ImageColor
# experimental access to the outline API
Outline: Callable[[], Image.core._Outline] = Image.core.outline
TYPE_CHECKING = False TYPE_CHECKING = False
if TYPE_CHECKING: if TYPE_CHECKING:
from collections.abc import Callable
from types import ModuleType from types import ModuleType
from typing import Any, AnyStr from typing import Any, AnyStr
from . import ImageDraw2, ImageFont from . import ImageDraw2, ImageFont
from ._typing import Coords from ._typing import Coords
# experimental access to the outline API
Outline: Callable[[], Image.core._Outline] = Image.core.outline
_Ink = float | tuple[int, ...] | str _Ink = float | tuple[int, ...] | str
""" """

View File

@ -1,14 +1,14 @@
import datetime import datetime
import sys import sys
from typing import Literal, SupportsFloat, TypedDict from typing import Literal, SupportsFloat, TypeAlias, TypedDict
from ._typing import CapsuleType from ._typing import CapsuleType
littlecms_version: str | None littlecms_version: str | None
_Tuple3f = tuple[float, float, float] _Tuple3f: TypeAlias = tuple[float, float, float]
_Tuple2x3f = tuple[_Tuple3f, _Tuple3f] _Tuple2x3f: TypeAlias = tuple[_Tuple3f, _Tuple3f]
_Tuple3x3f = tuple[_Tuple3f, _Tuple3f, _Tuple3f] _Tuple3x3f: TypeAlias = tuple[_Tuple3f, _Tuple3f, _Tuple3f]
class _IccMeasurementCondition(TypedDict): class _IccMeasurementCondition(TypedDict):
observer: int observer: int