Skip to content

Commit 2ab301d

Browse files
hugovkradarhere
andauthored
Drop support for Python 3.9 (#9119)
Co-authored-by: Andrew Murray <[email protected]> Co-authored-by: Andrew Murray <[email protected]>
1 parent eb59176 commit 2ab301d

37 files changed

+193
-340
lines changed

.ci/install.sh

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,21 @@ aptget_update()
1313
return 1
1414
fi
1515
}
16-
if [[ $(uname) != CYGWIN* ]]; then
17-
aptget_update || aptget_update retry || aptget_update retry
18-
fi
16+
aptget_update || aptget_update retry || aptget_update retry
1917

2018
set -e
2119

22-
if [[ $(uname) != CYGWIN* ]]; then
23-
sudo apt-get -qq install libfreetype6-dev liblcms2-dev libtiff-dev python3-tk\
24-
ghostscript libjpeg-turbo8-dev libopenjp2-7-dev\
25-
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
26-
sway wl-clipboard libopenblas-dev nasm
27-
fi
20+
sudo apt-get -qq install libfreetype6-dev liblcms2-dev libtiff-dev python3-tk\
21+
ghostscript libjpeg-turbo8-dev libopenjp2-7-dev\
22+
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
23+
sway wl-clipboard libopenblas-dev nasm
2824

2925
python3 -m pip install --upgrade pip
3026
python3 -m pip install --upgrade wheel
3127
python3 -m pip install coverage
3228
python3 -m pip install defusedxml
3329
python3 -m pip install ipython
30+
python3 -m pip install numpy
3431
python3 -m pip install olefile
3532
python3 -m pip install -U pytest
3633
python3 -m pip install -U pytest-cov
@@ -40,36 +37,24 @@ python3 -m pip install pyroma
4037
# fails on beta 3.14 and PyPy
4138
python3 -m pip install --only-binary=:all: pyarrow || true
4239

43-
if [[ $(uname) != CYGWIN* ]]; then
44-
python3 -m pip install numpy
45-
46-
# PyQt6 doesn't support PyPy3
47-
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
48-
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
49-
# TODO Update condition when pyqt6 supports free-threading
50-
if ! [[ "$PYTHON_GIL" == "0" ]]; then python3 -m pip install pyqt6 ; fi
51-
fi
52-
53-
# Pyroma uses non-isolated build and fails with old setuptools
54-
if [[ $GHA_PYTHON_VERSION == 3.9 ]]; then
55-
# To match pyproject.toml
56-
python3 -m pip install "setuptools>=77"
57-
fi
40+
# PyQt6 doesn't support PyPy3
41+
if [[ $GHA_PYTHON_VERSION == 3.* ]]; then
42+
sudo apt-get -qq install libegl1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxkbcommon-x11-0
43+
# TODO Update condition when pyqt6 supports free-threading
44+
if ! [[ "$PYTHON_GIL" == "0" ]]; then python3 -m pip install pyqt6 ; fi
45+
fi
5846

59-
# webp
60-
pushd depends && ./install_webp.sh && popd
47+
# webp
48+
pushd depends && ./install_webp.sh && popd
6149

62-
# libimagequant
63-
pushd depends && ./install_imagequant.sh && popd
50+
# libimagequant
51+
pushd depends && ./install_imagequant.sh && popd
6452

65-
# raqm
66-
pushd depends && ./install_raqm.sh && popd
53+
# raqm
54+
pushd depends && ./install_raqm.sh && popd
6755

68-
# libavif
69-
pushd depends && ./install_libavif.sh && popd
56+
# libavif
57+
pushd depends && ./install_libavif.sh && popd
7058

71-
# extra test images
72-
pushd depends && ./install_extra_test_images.sh && popd
73-
else
74-
cd depends && ./install_extra_test_images.sh && cd ..
75-
fi
59+
# extra test images
60+
pushd depends && ./install_extra_test_images.sh && popd

.github/mergify.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pull_request_rules:
88
- status-success=Docker Test Successful
99
- status-success=Windows Test Successful
1010
- status-success=MinGW
11-
- status-success=Cygwin Test Successful
1211
actions:
1312
merge:
1413
method: merge

.github/workflows/test-cygwin.yml

Lines changed: 0 additions & 150 deletions
This file was deleted.

.github/workflows/test-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
python-version: ["pypy3.11", "3.10", "3.11", "3.12", ">=3.13.5", "3.14"]
38+
python-version: ["pypy3.11", "3.11", "3.12", "3.13", "3.14"]
3939
architecture: ["x64"]
4040
include:
4141
# Test the oldest Python on 32-bit
42-
- { python-version: "3.9", architecture: "x86" }
42+
- { python-version: "3.10", architecture: "x86" }
4343

4444
timeout-minutes: 45
4545

.github/workflows/test.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,17 @@ jobs:
4949
"3.12",
5050
"3.11",
5151
"3.10",
52-
"3.9",
5352
]
5453
include:
55-
- { python-version: "3.11", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" }
56-
- { python-version: "3.10", PYTHONOPTIMIZE: 2 }
54+
- { python-version: "3.12", PYTHONOPTIMIZE: 1, REVERSE: "--reverse" }
55+
- { python-version: "3.11", PYTHONOPTIMIZE: 2 }
5756
# Free-threaded
5857
- { python-version: "3.14t", disable-gil: true }
5958
- { python-version: "3.13t", disable-gil: true }
60-
# M1 only available for 3.10+
61-
- { os: "macos-13", python-version: "3.9" }
59+
# Intel
60+
- { os: "macos-13", python-version: "3.10" }
6261
exclude:
63-
- { os: "macos-latest", python-version: "3.9" }
62+
- { os: "macos-latest", python-version: "3.10" }
6463

6564
runs-on: ${{ matrix.os }}
6665
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ As of 2019, Pillow development is
3636
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-mingw.yml"><img
3737
alt="GitHub Actions build status (Test MinGW)"
3838
src="https://github.com/python-pillow/Pillow/workflows/Test%20MinGW/badge.svg"></a>
39-
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-cygwin.yml"><img
40-
alt="GitHub Actions build status (Test Cygwin)"
41-
src="https://github.com/python-pillow/Pillow/workflows/Test%20Cygwin/badge.svg"></a>
4239
<a href="https://github.com/python-pillow/Pillow/actions/workflows/test-docker.yml"><img
4340
alt="GitHub Actions build status (Test Docker)"
4441
src="https://github.com/python-pillow/Pillow/workflows/Test%20Docker/badge.svg"></a>

Tests/helper.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,20 @@
1010
import subprocess
1111
import sys
1212
import tempfile
13-
from collections.abc import Sequence
1413
from functools import lru_cache
1514
from io import BytesIO
16-
from pathlib import Path
17-
from typing import Any, Callable
1815

1916
import pytest
2017
from packaging.version import parse as parse_version
2118

2219
from PIL import Image, ImageFile, ImageMath, features
2320

21+
TYPE_CHECKING = False
22+
if TYPE_CHECKING:
23+
from collections.abc import Callable, Sequence
24+
from pathlib import Path
25+
from typing import Any
26+
2427
logger = logging.getLogger(__name__)
2528

2629
uploader = None

Tests/test_features.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22

33
import io
44
import re
5-
from typing import Callable
65

76
import pytest
87

98
from PIL import features
109

1110
from .helper import skip_unless_feature
1211

12+
TYPE_CHECKING = False
13+
if TYPE_CHECKING:
14+
from collections.abc import Callable
15+
1316

1417
def test_check() -> None:
1518
# Check the correctness of the convenience function

Tests/test_format_hsv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
import colorsys
44
import itertools
5-
from typing import Callable
65

76
from PIL import Image
87

98
from .helper import assert_image_similar, hopper
109

10+
TYPE_CHECKING = False
11+
if TYPE_CHECKING:
12+
from collections.abc import Callable
13+
1114

1215
def int_to_float(i: int) -> float:
1316
return i / 255

Tests/test_image_transform.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
from __future__ import annotations
22

33
import math
4-
from typing import Callable
54

65
import pytest
76

87
from PIL import Image, ImageTransform
98

109
from .helper import assert_image_equal, assert_image_similar, hopper
1110

11+
TYPE_CHECKING = False
12+
if TYPE_CHECKING:
13+
from collections.abc import Callable
14+
1215

1316
class TestImageTransform:
1417
def test_sanity(self) -> None:

0 commit comments

Comments
 (0)