Skip to content

Commit 09e4df1

Browse files
committed
Merge branch 'main' into progress
2 parents 24b9ca7 + 4402797 commit 09e4df1

File tree

148 files changed

+4665
-787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+4665
-787
lines changed

.ci/install.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [[ $(uname) != CYGWIN* ]]; then
2323
sudo apt-get -qq install libfreetype6-dev liblcms2-dev libtiff-dev python3-tk\
2424
ghostscript libjpeg-turbo8-dev libopenjp2-7-dev\
2525
cmake meson imagemagick libharfbuzz-dev libfribidi-dev\
26-
sway wl-clipboard libopenblas-dev
26+
sway wl-clipboard libopenblas-dev nasm
2727
fi
2828

2929
python3 -m pip install --upgrade pip
@@ -36,6 +36,9 @@ python3 -m pip install -U pytest
3636
python3 -m pip install -U pytest-cov
3737
python3 -m pip install -U pytest-timeout
3838
python3 -m pip install pyroma
39+
# optional test dependency, only install if there's a binary package.
40+
# fails on beta 3.14 and PyPy
41+
python3 -m pip install --only-binary=:all: pyarrow || true
3942

4043
if [[ $(uname) != CYGWIN* ]]; then
4144
python3 -m pip install numpy
@@ -50,7 +53,7 @@ if [[ $(uname) != CYGWIN* ]]; then
5053
# Pyroma uses non-isolated build and fails with old setuptools
5154
if [[ $GHA_PYTHON_VERSION == 3.9 ]]; then
5255
# To match pyproject.toml
53-
python3 -m pip install "setuptools>=67.8"
56+
python3 -m pip install "setuptools>=77"
5457
fi
5558

5659
# webp
@@ -62,6 +65,9 @@ if [[ $(uname) != CYGWIN* ]]; then
6265
# raqm
6366
pushd depends && ./install_raqm.sh && popd
6467

68+
# libavif
69+
pushd depends && CMAKE_POLICY_VERSION_MINIMUM=3.5 ./install_libavif.sh && popd
70+
6571
# extra test images
6672
pushd depends && ./install_extra_test_images.sh && popd
6773
else

.ci/requirements-cibw.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cibuildwheel==2.23.1
1+
cibuildwheel==2.23.2

.clang-format

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# A clang-format style that approximates Python's PEP 7
22
# Useful for IDE integration
3+
Language: C
34
BasedOnStyle: Google
45
AlwaysBreakAfterReturnType: All
56
AllowShortIfStatementsOnASingleLine: false
@@ -11,7 +12,26 @@ ColumnLimit: 88
1112
DerivePointerAlignment: false
1213
IndentGotoLabels: false
1314
IndentWidth: 4
15+
PointerAlignment: Right
16+
ReflowComments: true
17+
SortIncludes: false
18+
SpaceBeforeParens: ControlStatements
19+
SpacesInParentheses: false
20+
TabWidth: 4
21+
UseTab: Never
22+
---
1423
Language: Cpp
24+
BasedOnStyle: Google
25+
AlwaysBreakAfterReturnType: All
26+
AllowShortIfStatementsOnASingleLine: false
27+
AlignAfterOpenBracket: BlockIndent
28+
BinPackArguments: false
29+
BinPackParameters: false
30+
BreakBeforeBraces: Attach
31+
ColumnLimit: 88
32+
DerivePointerAlignment: false
33+
IndentGotoLabels: false
34+
IndentWidth: 4
1535
PointerAlignment: Right
1636
ReflowComments: true
1737
SortIncludes: false

.github/workflows/macos-install.sh

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if [[ "$ImageOS" == "macos13" ]]; then
66
brew uninstall gradle maven
77
fi
88
brew install \
9+
aom \
10+
dav1d \
911
freetype \
1012
ghostscript \
1113
jpeg-turbo \
@@ -14,6 +16,8 @@ brew install \
1416
libtiff \
1517
little-cms2 \
1618
openjpeg \
19+
rav1e \
20+
svt-av1 \
1721
webp
1822
export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig"
1923

@@ -26,6 +30,12 @@ python3 -m pip install -U pytest-cov
2630
python3 -m pip install -U pytest-timeout
2731
python3 -m pip install pyroma
2832
python3 -m pip install numpy
33+
# optional test dependency, only install if there's a binary package.
34+
# fails on beta 3.14 and PyPy
35+
python3 -m pip install --only-binary=:all: pyarrow || true
36+
37+
# libavif
38+
pushd depends && ./install_libavif.sh && popd
2939

3040
# extra test images
3141
pushd depends && ./install_extra_test_images.sh && popd

.github/workflows/test-docker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
centos-stream-10-amd64,
4848
debian-12-bookworm-x86,
4949
debian-12-bookworm-amd64,
50-
fedora-40-amd64,
5150
fedora-41-amd64,
51+
fedora-42-amd64,
5252
gentoo,
5353
ubuntu-22.04-jammy-amd64,
5454
ubuntu-24.04-noble-amd64,

.github/workflows/test-mingw.yml

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
mingw-w64-x86_64-gcc \
6161
mingw-w64-x86_64-ghostscript \
6262
mingw-w64-x86_64-lcms2 \
63+
mingw-w64-x86_64-libavif \
6364
mingw-w64-x86_64-libimagequant \
6465
mingw-w64-x86_64-libjpeg-turbo \
6566
mingw-w64-x86_64-libraqm \

.github/workflows/test-windows.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
# Test the oldest Python on 32-bit
4343
- { python-version: "3.9", architecture: "x86", os: "windows-2019" }
4444

45-
timeout-minutes: 30
45+
timeout-minutes: 45
4646

4747
name: Python ${{ matrix.python-version }} (${{ matrix.architecture }})
4848

@@ -88,6 +88,10 @@ jobs:
8888
run: |
8989
python3 -m pip install PyQt6
9090
91+
- name: Install PyArrow dependency
92+
run: |
93+
python3 -m pip install --only-binary=:all: pyarrow || true
94+
9195
- name: Install dependencies
9296
id: install
9397
run: |
@@ -145,6 +149,10 @@ jobs:
145149
if: steps.build-cache.outputs.cache-hit != 'true'
146150
run: "& winbuild\\build\\build_dep_libpng.cmd"
147151

152+
- name: Build dependencies / libavif
153+
if: steps.build-cache.outputs.cache-hit != 'true' && matrix.architecture == 'x64'
154+
run: "& winbuild\\build\\build_dep_libavif.cmd"
155+
148156
# for FreeType WOFF2 font support
149157
- name: Build dependencies / brotli
150158
if: steps.build-cache.outputs.cache-hit != 'true'

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
persist-credentials: false
7171

7272
- name: Set up Python ${{ matrix.python-version }}
73-
uses: Quansight-Labs/setup-python@v5
73+
uses: actions/setup-python@v5
7474
with:
7575
python-version: ${{ matrix.python-version }}
7676
allow-prereleases: true

.github/workflows/wheels-dependencies.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ else
2525
MB_ML_LIBC=${AUDITWHEEL_POLICY::9}
2626
MB_ML_VER=${AUDITWHEEL_POLICY:9}
2727
fi
28-
PLAT=$CIBW_ARCHS
28+
PLAT="${CIBW_ARCHS:-$AUDITWHEEL_ARCH}"
2929

3030
# Define custom utilities
3131
source wheels/multibuild/common_utils.sh
@@ -38,13 +38,14 @@ ARCHIVE_SDIR=pillow-depends-main
3838

3939
# Package versions for fresh source builds
4040
FREETYPE_VERSION=2.13.3
41-
HARFBUZZ_VERSION=10.4.0
41+
HARFBUZZ_VERSION=11.1.0
4242
LIBPNG_VERSION=1.6.47
4343
JPEGTURBO_VERSION=3.1.0
4444
OPENJPEG_VERSION=2.5.3
45-
XZ_VERSION=5.6.4
45+
XZ_VERSION=5.8.1
4646
TIFF_VERSION=4.7.0
4747
LCMS2_VERSION=2.17
48+
ZLIB_VERSION=1.3.1
4849
ZLIB_NG_VERSION=2.2.4
4950
LIBWEBP_VERSION=1.5.0
5051
BZIP2_VERSION=1.0.8
@@ -64,11 +65,7 @@ function build_pkg_config {
6465

6566
function build_zlib_ng {
6667
if [ -e zlib-stamp ]; then return; fi
67-
fetch_unpack https://github.com/zlib-ng/zlib-ng/archive/$ZLIB_NG_VERSION.tar.gz zlib-ng-$ZLIB_NG_VERSION.tar.gz
68-
(cd zlib-ng-$ZLIB_NG_VERSION \
69-
&& ./configure --prefix=$BUILD_PREFIX --zlib-compat \
70-
&& make -j4 \
71-
&& make install)
68+
build_github zlib-ng/zlib-ng $ZLIB_NG_VERSION --zlib-compat
7269

7370
if [ -n "$IS_MACOS" ]; then
7471
# Ensure that on macOS, the library name is an absolute path, not an
@@ -95,7 +92,7 @@ function build_harfbuzz {
9592

9693
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
9794
(cd $out_dir \
98-
&& meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=release -Dfreetype=enabled -Dglib=disabled)
95+
&& meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=minsize -Dfreetype=enabled -Dglib=disabled -Dtests=disabled)
9996
(cd $out_dir/build \
10097
&& meson install)
10198
touch harfbuzz-stamp
@@ -106,7 +103,11 @@ function build {
106103
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
107104
yum remove -y zlib-devel
108105
fi
109-
build_zlib_ng
106+
if [[ -n "$IS_MACOS" ]] && [[ "$MACOSX_DEPLOYMENT_TARGET" == "10.10" || "$MACOSX_DEPLOYMENT_TARGET" == "10.13" ]]; then
107+
build_new_zlib
108+
else
109+
build_zlib_ng
110+
fi
110111

111112
build_simple xcb-proto 1.17.0 https://xorg.freedesktop.org/archive/individual/proto
112113
if [ -n "$IS_MACOS" ]; then

.github/workflows/wheels.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,17 @@ jobs:
121121
windows:
122122
if: github.event_name != 'schedule' || github.repository_owner == 'python-pillow'
123123
name: Windows ${{ matrix.cibw_arch }}
124-
runs-on: windows-latest
124+
runs-on: ${{ matrix.os }}
125125
strategy:
126126
fail-fast: false
127127
matrix:
128128
include:
129129
- cibw_arch: x86
130+
os: windows-latest
130131
- cibw_arch: AMD64
132+
os: windows-latest
131133
- cibw_arch: ARM64
134+
os: windows-11-arm
132135
steps:
133136
- uses: actions/checkout@v4
134137
with:
@@ -157,7 +160,7 @@ jobs:
157160
# Install extra test images
158161
xcopy /S /Y Tests\test-images\* Tests\images
159162
160-
& python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.cibw_arch }}
163+
& python.exe winbuild\build_prepare.py -v --no-imagequant --no-avif --architecture=${{ matrix.cibw_arch }}
161164
shell: pwsh
162165

163166
- name: Build wheels
@@ -240,7 +243,7 @@ jobs:
240243
path: dist
241244
merge-multiple: true
242245
- name: Upload wheels to scientific-python-nightly-wheels
243-
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # 0.6.1
246+
uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf # 0.6.2
244247
with:
245248
artifacts_path: dist
246249
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}

.pre-commit-config.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.9.9
3+
rev: v0.11.4
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -24,7 +24,7 @@ repos:
2424
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)
2525

2626
- repo: https://github.com/pre-commit/mirrors-clang-format
27-
rev: v19.1.7
27+
rev: v20.1.0
2828
hooks:
2929
- id: clang-format
3030
types: [c]
@@ -44,20 +44,21 @@ repos:
4444
- id: check-json
4545
- id: check-toml
4646
- id: check-yaml
47+
args: [--allow-multiple-documents]
4748
- id: end-of-file-fixer
4849
exclude: ^Tests/images/
4950
- id: trailing-whitespace
5051
exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/
5152

5253
- repo: https://github.com/python-jsonschema/check-jsonschema
53-
rev: 0.31.2
54+
rev: 0.32.1
5455
hooks:
5556
- id: check-github-workflows
5657
- id: check-readthedocs
5758
- id: check-renovate
5859

5960
- repo: https://github.com/woodruffw/zizmor-pre-commit
60-
rev: v1.4.1
61+
rev: v1.5.2
6162
hooks:
6263
- id: zizmor
6364

@@ -72,7 +73,7 @@ repos:
7273
- id: pyproject-fmt
7374

7475
- repo: https://github.com/abravalheri/validate-pyproject
75-
rev: v0.23
76+
rev: v0.24.1
7677
hooks:
7778
- id: validate-pyproject
7879
additional_dependencies: [trove-classifiers>=2024.10.12]

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ doc html:
2323
htmlview:
2424
$(MAKE) -C docs htmlview
2525

26+
.PHONY: htmllive
27+
htmllive:
28+
$(MAKE) -C docs htmllive
29+
2630
.PHONY: doccheck
2731
doccheck:
2832
$(MAKE) doc
@@ -43,6 +47,7 @@ help:
4347
@echo " docserve run an HTTP server on the docs directory"
4448
@echo " html make HTML docs"
4549
@echo " htmlview open the index page built by the html target in your browser"
50+
@echo " htmllive rebuild and reload HTML files in your browser"
4651
@echo " install make and install"
4752
@echo " install-coverage make and install with C coverage"
4853
@echo " lint run the lint checks"

Tests/check_wheel.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from __future__ import annotations
22

3+
import platform
34
import sys
45

56
from PIL import features
67

8+
from .helper import is_pypy
9+
710

811
def test_wheel_modules() -> None:
912
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
@@ -40,5 +43,7 @@ def test_wheel_features() -> None:
4043

4144
if sys.platform == "win32":
4245
expected_features.remove("xcb")
46+
elif sys.platform == "darwin" and not is_pypy() and platform.processor() != "arm":
47+
expected_features.remove("zlib_ng")
4348

4449
assert set(features.get_supported_features()) == expected_features

Tests/images/avif/exif.avif

15.7 KB
Binary file not shown.
5.31 KB
Binary file not shown.

Tests/images/avif/hopper.avif

3 KB
Binary file not shown.

Tests/images/avif/hopper.heif

3.47 KB
Binary file not shown.
29.6 KB
Loading

Tests/images/avif/icc_profile.avif

6.31 KB
Binary file not shown.
3.23 KB
Binary file not shown.

Tests/images/avif/rot0mir0.avif

16 KB
Binary file not shown.

Tests/images/avif/rot0mir1.avif

16.8 KB
Binary file not shown.

Tests/images/avif/rot1mir0.avif

16.8 KB
Binary file not shown.

Tests/images/avif/rot1mir1.avif

16.2 KB
Binary file not shown.

Tests/images/avif/rot2mir0.avif

16.6 KB
Binary file not shown.

Tests/images/avif/rot2mir1.avif

16 KB
Binary file not shown.

Tests/images/avif/rot3mir0.avif

16.2 KB
Binary file not shown.

Tests/images/avif/rot3mir1.avif

16.9 KB
Binary file not shown.

Tests/images/avif/star.avifs

29 KB
Binary file not shown.

Tests/images/avif/star.gif

2.83 KB
Loading

Tests/images/avif/star.png

3.75 KB
Loading

Tests/images/avif/transparency.avif

6.29 KB
Binary file not shown.
6.53 KB
Binary file not shown.
984 Bytes
Loading

0 commit comments

Comments
 (0)