From 6ab8e77950ac5c5e7362ea8332c96db95717aea8 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 25 Jun 2025 19:47:48 +1000 Subject: [PATCH 1/6] Removed Android --- Tests/oss-fuzz/test_fuzzers.py | 7 ++----- Tests/test_main.py | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Tests/oss-fuzz/test_fuzzers.py b/Tests/oss-fuzz/test_fuzzers.py index 9e357f30d..37d11e0ba 100644 --- a/Tests/oss-fuzz/test_fuzzers.py +++ b/Tests/oss-fuzz/test_fuzzers.py @@ -10,11 +10,8 @@ import pytest from PIL import Image, features from Tests.helper import skip_unless_feature -if sys.platform.startswith("win32") or sys.platform in {"ios", "android"}: - pytest.skip( - "Fuzzer doesn't run on Windows or mobile", - allow_module_level=True, - ) +if sys.platform.startswith("win32") or sys.platform == "ios": + pytest.skip("Fuzzer doesn't run on Windows or iOS", allow_module_level=True) libjpeg_turbo_version = features.version("libjpeg_turbo") if libjpeg_turbo_version is not None: diff --git a/Tests/test_main.py b/Tests/test_main.py index a7886592c..b98c85543 100644 --- a/Tests/test_main.py +++ b/Tests/test_main.py @@ -7,10 +7,7 @@ import sys import pytest -@pytest.mark.skipif( - sys.platform in {"ios", "android"}, - reason="Not required on mobile", -) +@pytest.mark.skipif(sys.platform == "ios", reason="Not required on mobile") @pytest.mark.parametrize( "args, report", ((["PIL"], False), (["PIL", "--report"], True), (["PIL.report"], True)), From 3524b4e72917dc5d6a417b23dfcfca97f287ea19 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 24 Jun 2025 20:42:59 +1000 Subject: [PATCH 2/6] Updated reason --- Tests/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/test_main.py b/Tests/test_main.py index b98c85543..65e7a44d8 100644 --- a/Tests/test_main.py +++ b/Tests/test_main.py @@ -7,7 +7,7 @@ import sys import pytest -@pytest.mark.skipif(sys.platform == "ios", reason="Not required on mobile") +@pytest.mark.skipif(sys.platform == "ios", reason="Processes not supported on iOS") @pytest.mark.parametrize( "args, report", ((["PIL"], False), (["PIL", "--report"], True), (["PIL.report"], True)), From e5676027194ffee83103a4aea4ec311d0c0b130f Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 24 Jun 2025 20:55:03 +1000 Subject: [PATCH 3/6] Updated capitalisation --- .github/workflows/wheels-dependencies.sh | 8 ++++---- pyproject.toml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 83041dafb..9f6a85d97 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -60,11 +60,11 @@ if [[ "$CIBW_PLATFORM" == "ios" ]]; then # Cmake has native support for iOS. However, most of that support is based # on using the Xcode builder, which isn't very helpful for most of Pillow's # dependencies. Therefore, we lean on the OSX configurations, plus CC/CFLAGS - # etc to ensure the right sysroot is selected. + # etc. to ensure the right sysroot is selected. HOST_CMAKE_FLAGS="-DCMAKE_SYSTEM_NAME=$CMAKE_SYSTEM_NAME -DCMAKE_SYSTEM_PROCESSOR=$GNU_ARCH -DCMAKE_OSX_DEPLOYMENT_TARGET=$IPHONEOS_DEPLOYMENT_TARGET -DCMAKE_OSX_SYSROOT=$IOS_SDK_PATH -DBUILD_SHARED_LIBS=NO" # Meson needs to be pointed at a cross-platform configuration file - # This will be generated once CC etc have been evaluated. + # This will be generated once CC etc. have been evaluated. HOST_MESON_FLAGS="--cross-file $WORKDIR/meson-cross.txt -Dprefer_static=true -Ddefault_library=static" elif [[ "$(uname -s)" == "Darwin" ]]; then @@ -291,7 +291,7 @@ if [[ -n "$IS_MACOS" ]]; then mkdir -p "$BUILD_PREFIX/lib" # Ensure pkg-config is available. This is done *before* setting CC, CFLAGS - # etc to ensure that the build is *always* a macOS build, even when building + # etc. to ensure that the build is *always* a macOS build, even when building # for iOS. build_pkg_config @@ -317,7 +317,7 @@ if [[ -n "$IS_MACOS" ]]; then # behavior into clang. unset IPHONEOS_DEPLOYMENT_TARGET - # Now that we know CC etc, we can create a meson cross-configuration file + # Now that we know CC etc., we can create a meson cross-configuration file create_meson_cross_config fi fi diff --git a/pyproject.toml b/pyproject.toml index 709c141b1..9590e69c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,11 +112,11 @@ test-requires = [ xbuild-tools = [ ] [tool.cibuildwheel.macos] -# Disable platform guessing on macOS to avoid picking up homebrew etc +# Disable platform guessing on macOS to avoid picking up Homebrew etc. config-settings = "raqm=enable raqm=vendor fribidi=vendor imagequant=disable platform-guessing=disable" [tool.cibuildwheel.macos.environment] -# Isolate macOS build environment from homebrew etc +# Isolate macOS build environment from Homebrew etc. PATH = "$(pwd)/build/deps/darwin/bin:$(dirname $(which python3)):/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin" [tool.cibuildwheel.ios] From 1c2ec9fff9560b4ffa9ddafcc41c4b0260a77616 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 24 Jun 2025 20:57:59 +1000 Subject: [PATCH 4/6] Removed duplicate lines --- .gitignore | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitignore b/.gitignore index e373f5a73..3033c2ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -80,10 +80,6 @@ docs/_build/ # JetBrains .idea -# Files downloaded as part of the build process -pillow-depends-main.zip -pillow-test-images.zip - # Extra test images installed from python-pillow/test-images Tests/images/README.md Tests/images/crash_1.tif From d393d0937e2ffcd6c9ee7e09eb46200d54e6ec5a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 25 Jun 2025 20:07:37 +1000 Subject: [PATCH 5/6] Simplified code --- .github/workflows/wheels-dependencies.sh | 6 ++---- checks/check_wheel.py | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 9f6a85d97..d3998236d 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -43,10 +43,9 @@ if [[ "$CIBW_PLATFORM" == "ios" ]]; then IOS_SDK_PATH=$(xcrun --sdk $IOS_SDK --show-sdk-path) CMAKE_SYSTEM_NAME=iOS + IOS_HOST_TRIPLE=$PLAT-apple-ios$IPHONEOS_DEPLOYMENT_TARGET if [[ "$IOS_SDK" == "iphonesimulator" ]]; then - IOS_HOST_TRIPLE=$PLAT-apple-ios$IPHONEOS_DEPLOYMENT_TARGET-simulator - else - IOS_HOST_TRIPLE=$PLAT-apple-ios$IPHONEOS_DEPLOYMENT_TARGET + IOS_HOST_TRIPLE=$IOS_HOST_TRIPLE-simulator fi # GNU Autotools doesn't recognize the existence of arm64-apple-ios-simulator @@ -171,7 +170,6 @@ function build_brotli { function build_harfbuzz { if [ -e harfbuzz-stamp ]; then return; fi - python3 -m pip install meson ninja local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz) diff --git a/checks/check_wheel.py b/checks/check_wheel.py index a23006c6b..025ab8590 100644 --- a/checks/check_wheel.py +++ b/checks/check_wheel.py @@ -51,8 +51,6 @@ def test_wheel_features() -> None: elif sys.platform == "ios": # Can't distribute raqm due to licensing, and there's no system version; # fribidi and harfbuzz won't be available if raqm isn't available. - expected_features.remove("fribidi") - expected_features.remove("raqm") - expected_features.remove("harfbuzz") + expected_features -= {"raqm", "fribidi", "harfbuzz"} assert set(features.get_supported_features()) == expected_features From 527d18c2d71af1f6682883c3ac066dcc9a54f3a8 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Thu, 26 Jun 2025 17:00:03 +1000 Subject: [PATCH 6/6] Run selftest directly --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9590e69c6..188a8542a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,7 +131,10 @@ test-sources = [ "pyproject.toml", "selftest.py", ] -test-command = "python -m pytest -vv selftest.py checks/check_wheel.py Tests" +test-command = [ + "python -m selftest", + "python -m pytest checks/check_wheel.py Tests", +] # There's no numpy wheel for iOS (yet...) test-requires = [ ]