Skip to content

Commit 956ee04

Browse files
authored
Drop support for Python 3.9 (#137)
2 parents a098a87 + 60fb0fc commit 956ee04

File tree

7 files changed

+24
-23
lines changed

7 files changed

+24
-23
lines changed

.ci/install.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ python3 -m pip install --upgrade wheel
2727
python3 -m pip install coverage
2828
python3 -m pip install defusedxml
2929
python3 -m pip install ipython
30+
python3 -m pip install numpy
3031
python3 -m pip install olefile
3132
python3 -m pip install -U pytest
3233
python3 -m pip install -U pytest-cov
@@ -36,9 +37,6 @@ python3 -m pip install pyroma
3637
# fails on beta 3.14 and PyPy
3738
python3 -m pip install --only-binary=:all: pyarrow || true
3839

39-
40-
python3 -m pip install numpy
41-
4240
# PyQt6 doesn't support PyPy3
4341
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
4442
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0

Tests/test_imagecms.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ def test_exceptions() -> None:
208208
ImageCms.getProfileName(None) # type: ignore[arg-type]
209209
skip_missing()
210210

211-
# Python <= 3.9: "an integer is required (got type NoneType)"
212-
# Python > 3.9: "'NoneType' object cannot be interpreted as an integer"
213-
with pytest.raises(ImageCms.PyCMSError, match="integer"):
211+
with pytest.raises(
212+
ImageCms.PyCMSError,
213+
match="'NoneType' object cannot be interpreted as an integer",
214+
):
214215
ImageCms.isIntentSupported(SRGB, None, None) # type: ignore[arg-type]
215216

216217

docs/installation/platform-support.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ These platforms are built and tested for every change.
1919
+==================================+============================+=====================+
2020
| Alpine | 3.12 | x86-64 |
2121
+----------------------------------+----------------------------+---------------------+
22-
| Amazon Linux 2 | 3.9 | x86-64 |
22+
| Amazon Linux 2 | 3.10 | x86-64 |
2323
+----------------------------------+----------------------------+---------------------+
24-
| Amazon Linux 2023 | 3.9 | x86-64 |
24+
| Amazon Linux 2023 | 3.11 | x86-64 |
2525
+----------------------------------+----------------------------+---------------------+
2626
| Arch | 3.13 | x86-64 |
2727
+----------------------------------+----------------------------+---------------------+
28-
| CentOS Stream 9 | 3.9 | x86-64 |
28+
| CentOS Stream 9 | 3.10 | x86-64 |
2929
+----------------------------------+----------------------------+---------------------+
3030
| CentOS Stream 10 | 3.12 | x86-64 |
3131
+----------------------------------+----------------------------+---------------------+
@@ -42,16 +42,16 @@ These platforms are built and tested for every change.
4242
+----------------------------------+----------------------------+---------------------+
4343
| Ubuntu Linux 22.04 LTS (Jammy) | 3.10 | x86-64 |
4444
+----------------------------------+----------------------------+---------------------+
45-
| Ubuntu Linux 24.04 LTS (Noble) | 3.10, 3.11, | x86-64 |
46-
| | 3.12, 3.13, 3.14, PyPy3 | |
45+
| Ubuntu Linux 24.04 LTS (Noble) | 3.10, 3.11, 3.12, 3.13, | x86-64 |
46+
| | 3.14, PyPy3 | |
4747
| +----------------------------+---------------------+
4848
| | 3.12 | arm64v8, ppc64le, |
4949
| | | s390x |
5050
+----------------------------------+----------------------------+---------------------+
5151
| Windows Server 2022 | 3.10 | x86 |
5252
| +----------------------------+---------------------+
53-
| | 3.11, 3.12, 3.13, | x86-64 |
54-
| | 3.14, PyPy3 | |
53+
| | 3.11, 3.12, 3.13, 3.14, | x86-64 |
54+
| | PyPy3 | |
5555
| +----------------------------+---------------------+
5656
| | 3.12 (MinGW) | x86-64 |
5757
+----------------------------------+----------------------------+---------------------+

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ lint.ignore = [
185185
"PT011", # pytest-raises-too-broad
186186
"PT012", # pytest-raises-with-multiple-statements
187187
"PT017", # pytest-assert-in-except
188-
"PYI026", # flake8-pyi: typing.TypeAlias added in Python 3.10
189188
"PYI034", # flake8-pyi: typing.Self added in Python 3.11
190189
"UP038", # pyupgrade: deprecated rule
191190
]

src/PIL/GifImagePlugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import subprocess
3232
from enum import IntEnum
3333
from functools import cached_property
34-
from typing import IO, Any, Literal, NamedTuple, cast
34+
from typing import Any, NamedTuple, cast
3535

3636
from . import (
3737
Image,
@@ -49,6 +49,8 @@
4949

5050
TYPE_CHECKING = False
5151
if TYPE_CHECKING:
52+
from typing import IO, Literal
53+
5254
from . import _imaging
5355
from ._typing import Buffer
5456

src/PIL/ImageDraw.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,23 @@
3333

3434
import math
3535
import struct
36-
from collections.abc import Callable, Sequence
36+
from collections.abc import Sequence
3737
from typing import cast
3838

3939
from . import Image, ImageColor
4040

41-
# experimental access to the outline API
42-
Outline: Callable[[], Image.core._Outline] = Image.core.outline
43-
4441
TYPE_CHECKING = False
4542
if TYPE_CHECKING:
43+
from collections.abc import Callable
4644
from types import ModuleType
4745
from typing import Any, AnyStr
4846

4947
from . import ImageDraw2, ImageFont
5048
from ._typing import Coords
5149

50+
# experimental access to the outline API
51+
Outline: Callable[[], Image.core._Outline] = Image.core.outline
52+
5253
_Ink = float | tuple[int, ...] | str
5354

5455
"""

src/PIL/_imagingcms.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import datetime
22
import sys
3-
from typing import Literal, SupportsFloat, TypedDict
3+
from typing import Literal, SupportsFloat, TypeAlias, TypedDict
44

55
from ._typing import CapsuleType
66

77
littlecms_version: str | None
88

9-
_Tuple3f = tuple[float, float, float]
10-
_Tuple2x3f = tuple[_Tuple3f, _Tuple3f]
11-
_Tuple3x3f = tuple[_Tuple3f, _Tuple3f, _Tuple3f]
9+
_Tuple3f: TypeAlias = tuple[float, float, float]
10+
_Tuple2x3f: TypeAlias = tuple[_Tuple3f, _Tuple3f]
11+
_Tuple3x3f: TypeAlias = tuple[_Tuple3f, _Tuple3f, _Tuple3f]
1212

1313
class _IccMeasurementCondition(TypedDict):
1414
observer: int

0 commit comments

Comments
 (0)