From e50df021e88ea4ab70d01781f2614b3a54b76d67 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 30 Jun 2024 00:17:29 +0300 Subject: [PATCH 1/4] Add support for Python 3.13 --- docs/installation/newer-versions.csv | 17 +++++++++-------- docs/releasenotes/11.0.0.rst | 10 +++++++--- pyproject.toml | 4 ++++ tox.ini | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/docs/installation/newer-versions.csv b/docs/installation/newer-versions.csv index e21caf52071..7f4730df45f 100644 --- a/docs/installation/newer-versions.csv +++ b/docs/installation/newer-versions.csv @@ -1,8 +1,9 @@ -Python,3.12,3.11,3.10,3.9,3.8,3.7,3.6,3.5 -Pillow >= 10.1,Yes,Yes,Yes,Yes,Yes,,, -Pillow 10.0,,Yes,Yes,Yes,Yes,,, -Pillow 9.3 - 9.5,,Yes,Yes,Yes,Yes,Yes,, -Pillow 9.0 - 9.2,,,Yes,Yes,Yes,Yes,, -Pillow 8.3.2 - 8.4,,,Yes,Yes,Yes,Yes,Yes, -Pillow 8.0 - 8.3.1,,,,Yes,Yes,Yes,Yes, -Pillow 7.0 - 7.2,,,,,Yes,Yes,Yes,Yes +Python,3.13,3.12,3.11,3.10,3.9,3.8,3.7,3.6,3.5 +Pillow >= 11,Yes,Yes,Yes,Yes,Yes,Yes,,, +Pillow >= 10.1,,Yes,Yes,Yes,Yes,Yes,,, +Pillow 10.0,,,Yes,Yes,Yes,Yes,,, +Pillow 9.3 - 9.5,,,Yes,Yes,Yes,Yes,Yes,, +Pillow 9.0 - 9.2,,,,Yes,Yes,Yes,Yes,, +Pillow 8.3.2 - 8.4,,,,Yes,Yes,Yes,Yes,Yes, +Pillow 8.0 - 8.3.1,,,,,Yes,Yes,Yes,Yes, +Pillow 7.0 - 7.2,,,,,,Yes,Yes,Yes,Yes diff --git a/docs/releasenotes/11.0.0.rst b/docs/releasenotes/11.0.0.rst index bde791b1e4f..0b18fe01ada 100644 --- a/docs/releasenotes/11.0.0.rst +++ b/docs/releasenotes/11.0.0.rst @@ -61,7 +61,11 @@ TODO Other Changes ============= -TODO -^^^^ +Python 3.13 +^^^^^^^^^^^ -TODO +Pillow 10.4.0 had wheels built against Python 3.13 beta, available as a preview to help +others prepare for 3.13, and to ensure Pillow could be used immediately at the release +of 3.13.0 final (2024-10-01, :pep:`719`). + +Pillow 11.0.0 now officially supports Python 3.13. diff --git a/pyproject.toml b/pyproject.toml index 6f47f360b37..a1cc7554fe4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Multimedia :: Graphics", @@ -136,6 +137,9 @@ lint.isort.required-imports = [ "from __future__ import annotations", ] +[tool.pyproject-fmt] +max_supported_python = "3.13" + [tool.pytest.ini_options] addopts = "-ra --color=yes" testpaths = [ diff --git a/tox.ini b/tox.ini index d225a310697..912d7167c2c 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ requires = tox>=4.2 env_list = lint - py{py3, 312, 311, 310, 39, 38} + py{py3, 313, 312, 311, 310, 39, 38} [testenv] deps = From 4eec24a3805bd8dfe671505452985e0da08cdf8a Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:52:43 +0300 Subject: [PATCH 2/4] Increment Python version check on Windows Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0abfaaddc5b..b26852b0b07 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ def get_version(): ZLIB_ROOT = None FUZZING_BUILD = "LIB_FUZZING_ENGINE" in os.environ -if sys.platform == "win32" and sys.version_info >= (3, 13): +if sys.platform == "win32" and sys.version_info >= (3, 14): import atexit atexit.register( From 40d3b2ce0c1527d374095df36589a90d72eed5ef Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:53:23 +0300 Subject: [PATCH 3/4] Fix version range Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- docs/installation/newer-versions.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/newer-versions.csv b/docs/installation/newer-versions.csv index 7f4730df45f..028a2018f00 100644 --- a/docs/installation/newer-versions.csv +++ b/docs/installation/newer-versions.csv @@ -1,6 +1,6 @@ Python,3.13,3.12,3.11,3.10,3.9,3.8,3.7,3.6,3.5 Pillow >= 11,Yes,Yes,Yes,Yes,Yes,Yes,,, -Pillow >= 10.1,,Yes,Yes,Yes,Yes,Yes,,, +Pillow 10.1 - 10.4,,Yes,Yes,Yes,Yes,Yes,,, Pillow 10.0,,,Yes,Yes,Yes,Yes,,, Pillow 9.3 - 9.5,,,Yes,Yes,Yes,Yes,Yes,, Pillow 9.0 - 9.2,,,,Yes,Yes,Yes,Yes,, From 534d82119b60a8d16ecdf2c08d4198ae9e974de5 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:53:48 +0300 Subject: [PATCH 4/4] Test NumPy on Python 3.13 Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- .ci/install.sh | 3 +-- .github/workflows/macos-install.sh | 4 +--- .github/workflows/wheels-test.sh | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.ci/install.sh b/.ci/install.sh index c6e166171a4..fc5ff00646b 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -37,8 +37,7 @@ python3 -m pip install -U pytest-timeout python3 -m pip install pyroma if [[ $(uname) != CYGWIN* ]]; then - # TODO Update condition when NumPy supports 3.13 - if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then python3 -m pip install numpy ; fi + python3 -m pip install numpy # PyQt6 doesn't support PyPy3 if [[ $GHA_PYTHON_VERSION == 3.* ]]; then diff --git a/.github/workflows/macos-install.sh b/.github/workflows/macos-install.sh index ae346e8b6c3..d35cfcd3124 100755 --- a/.github/workflows/macos-install.sh +++ b/.github/workflows/macos-install.sh @@ -25,9 +25,7 @@ python3 -m pip install -U pytest python3 -m pip install -U pytest-cov python3 -m pip install -U pytest-timeout python3 -m pip install pyroma - -# TODO Update condition when NumPy supports 3.13 -if ! [[ "$GHA_PYTHON_VERSION" == "3.13" ]]; then python3 -m pip install numpy ; fi +python3 -m pip install numpy # extra test images pushd depends && ./install_extra_test_images.sh && popd diff --git a/.github/workflows/wheels-test.sh b/.github/workflows/wheels-test.sh index a3376ac929c..3fbf3be695b 100755 --- a/.github/workflows/wheels-test.sh +++ b/.github/workflows/wheels-test.sh @@ -12,7 +12,7 @@ elif [ "${AUDITWHEEL_POLICY::9}" == "musllinux" ]; then else yum install -y fribidi fi -if [ "${AUDITWHEEL_POLICY::9}" != "musllinux" ] && !([[ "$OSTYPE" == "darwin"* ]] && [[ $(python3 --version) == *"3.13."* ]]); then +if [ "${AUDITWHEEL_POLICY::9}" != "musllinux" ]; then python3 -m pip install numpy fi