Skip to content

Commit 6b5f8d7

Browse files
committed
Do not include libavif in wheels
1 parent cda26be commit 6b5f8d7

File tree

10 files changed

+5
-572
lines changed

10 files changed

+5
-572
lines changed

.github/workflows/wheels-dependencies.sh

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ LIBWEBP_VERSION=1.5.0
5151
BZIP2_VERSION=1.0.8
5252
LIBXCB_VERSION=1.17.0
5353
BROTLI_VERSION=1.1.0
54-
LIBAVIF_VERSION=1.2.1
5554

5655
if [[ $MB_ML_VER == 2014 ]]; then
5756
function build_xz {
@@ -113,45 +112,6 @@ function build_harfbuzz {
113112
touch harfbuzz-stamp
114113
}
115114

116-
function build_libavif {
117-
if [ -e libavif-stamp ]; then return; fi
118-
119-
python3 -m pip install meson ninja
120-
121-
if [[ "$PLAT" == "x86_64" ]] || [ -n "$SANITIZER" ]; then
122-
build_simple nasm 2.16.03 https://www.nasm.us/pub/nasm/releasebuilds/2.16.03
123-
fi
124-
125-
# For rav1e
126-
curl https://sh.rustup.rs -sSf | sh -s -- -y
127-
. "$HOME/.cargo/env"
128-
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
129-
yum install -y perl
130-
if [[ "$MB_ML_VER" == 2014 ]]; then
131-
yum install -y perl-IPC-Cmd
132-
fi
133-
fi
134-
135-
local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)
136-
(cd $out_dir \
137-
&& CMAKE_POLICY_VERSION_MINIMUM=3.5 cmake \
138-
-DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX \
139-
-DCMAKE_INSTALL_LIBDIR=$BUILD_PREFIX/lib \
140-
-DCMAKE_BUILD_TYPE=Release \
141-
-DBUILD_SHARED_LIBS=OFF \
142-
-DAVIF_LIBSHARPYUV=LOCAL \
143-
-DAVIF_LIBYUV=LOCAL \
144-
-DAVIF_CODEC_AOM=LOCAL \
145-
-DAVIF_CODEC_DAV1D=LOCAL \
146-
-DAVIF_CODEC_RAV1E=LOCAL \
147-
-DAVIF_CODEC_SVT=LOCAL \
148-
-DENABLE_NASM=ON \
149-
-DCMAKE_MODULE_PATH=/tmp/cmake/Modules \
150-
. \
151-
&& make install)
152-
touch libavif-stamp
153-
}
154-
155115
function build {
156116
build_xz
157117
if [ -z "$IS_ALPINE" ] && [ -z "$SANITIZER" ] && [ -z "$IS_MACOS" ]; then
@@ -186,7 +146,6 @@ function build {
186146
build_tiff
187147
fi
188148

189-
build_libavif
190149
build_libpng
191150
build_lcms2
192151
build_openjpeg

.github/workflows/wheels.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,9 @@ jobs:
157157
# Install extra test images
158158
xcopy /S /Y Tests\test-images\* Tests\images
159159
160-
& python.exe winbuild\build_prepare.py -v --no-imagequant --architecture=${{ matrix.cibw_arch }}
160+
& python.exe winbuild\build_prepare.py -v --no-imagequant --no-avif --architecture=${{ matrix.cibw_arch }}
161161
shell: pwsh
162162

163-
- name: Update rust
164-
if: matrix.cibw_arch == 'AMD64'
165-
run: |
166-
rustup update
167-
168163
- name: Build wheels
169164
run: |
170165
setlocal EnableDelayedExpansion

Tests/check_wheel.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import platform
4-
import struct
54
import sys
65

76
from PIL import features
@@ -10,7 +9,7 @@
109

1110

1211
def test_wheel_modules() -> None:
13-
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp", "avif"}
12+
expected_modules = {"pil", "tkinter", "freetype2", "littlecms2", "webp"}
1413

1514
# tkinter is not available in cibuildwheel installed CPython on Windows
1615
try:
@@ -20,11 +19,6 @@ def test_wheel_modules() -> None:
2019
except ImportError:
2120
expected_modules.remove("tkinter")
2221

23-
# libavif is not available on Windows for x86 and ARM64 architectures
24-
if sys.platform == "win32":
25-
if platform.machine() == "ARM64" or struct.calcsize("P") == 4:
26-
expected_modules.remove("avif")
27-
2822
assert set(features.get_supported_modules()) == expected_modules
2923

3024

docs/releasenotes/11.2.0.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,6 @@ Pillow images can also be converted to Arrow objects::
106106
Reading and writing AVIF images
107107
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108108

109-
Pillow can now read and write AVIF images. If you are building Pillow from source, this
110-
will require libavif 1.0.0 or later.
109+
Pillow can now read and write AVIF images. However, due to concern over size, this
110+
functionality is not included in our prebuilt wheels. You will need to build Pillow
111+
from source with libavif 1.0.0 or later.

wheels/dependency_licenses/AOM.txt

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

wheels/dependency_licenses/DAV1D.txt

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

0 commit comments

Comments
 (0)