diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 3a277fbda5d..3d01146f226 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -80,7 +80,10 @@ function build { build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist if [ -f /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc ]; then cp /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc /Library/Frameworks/Python.framework/Versions/Current/lib/pkgconfig + elif [ -f /Users/runner/hostedtoolcache/Python/Current/x64/share/pkgconfig/xcb-proto.pc ]; then + cp /Users/runner/hostedtoolcache/Python/Current/x64/share/pkgconfig/xcb-proto.pc /Users/runner/hostedtoolcache/Python/Current/x64/share/pkgconfig fi + find / -iname xcb.h else sed s/\${pc_sysrootdir\}// /usr/local/share/pkgconfig/xcb-proto.pc > /usr/local/lib/pkgconfig/xcb-proto.pc fi @@ -94,37 +97,6 @@ function build { if [[ -n "$IS_MACOS" ]]; then rm /usr/local/lib/libjpeg.dylib fi - build_tiff - build_libpng - build_lcms2 - build_openjpeg - - ORIGINAL_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -O3 -DNDEBUG" - if [[ -n "$IS_MACOS" ]]; then - CFLAGS="$CFLAGS -Wl,-headerpad_max_install_names" - fi - build_libwebp - CFLAGS=$ORIGINAL_CFLAGS - - build_brotli - - if [ -n "$IS_MACOS" ]; then - # Custom freetype build - build_simple freetype $FREETYPE_VERSION https://download.savannah.gnu.org/releases/freetype tar.gz --with-harfbuzz=no - else - build_freetype - fi - - if [ -z "$IS_MACOS" ]; then - export FREETYPE_LIBS=-lfreetype - export FREETYPE_CFLAGS=-I/usr/local/include/freetype2/ - fi - build_simple harfbuzz $HARFBUZZ_VERSION https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION tar.xz --with-freetype=yes --with-glib=no - if [ -z "$IS_MACOS" ]; then - export FREETYPE_LIBS="" - export FREETYPE_CFLAGS="" - fi } # Any stuff that you need to do before you start building the wheels diff --git a/.github/workflows/wheels-test.sh b/.github/workflows/wheels-test.sh index 0c601f1dd2a..d1ee82b8cc8 100755 --- a/.github/workflows/wheels-test.sh +++ b/.github/workflows/wheels-test.sh @@ -2,37 +2,6 @@ EXP_CODECS="jpg jpg_2000 libtiff zlib" EXP_MODULES="freetype2 littlecms2 pil tkinter webp" EXP_FEATURES="fribidi harfbuzz libjpeg_turbo raqm transp_webp webp_anim webp_mux xcb" -if [[ "$OSTYPE" == "darwin"* ]]; then - brew install fribidi - export PKG_CONFIG_PATH="/usr/local/opt/openblas/lib/pkgconfig" -elif [ "${AUDITWHEEL_POLICY:9}" == "musllinux" ]; then - apk add curl fribidi -else - yum install -y fribidi openblas-devel pkgconfig -fi -if [ "${AUDITWHEEL_POLICY:9}" != "musllinux" ]; then - python3 -m pip install numpy -fi - -curl -fsSL -o pillow-test-images.zip https://github.com/python-pillow/test-images/archive/main.zip -unzip pillow-test-images.zip -mv test-images-main/* Tests/images - -# Runs tests -python3 selftest.py -python3 -m pytest - -# Test against expected codecs, modules and features -codecs=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_codecs())))') -if [ "$codecs" != "$EXP_CODECS" ]; then - echo "Codecs should be: '$EXP_CODECS'; but are '$codecs'" - exit 1 -fi -modules=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_modules())))') -if [ "$modules" != "$EXP_MODULES" ]; then - echo "Modules should be: '$EXP_MODULES'; but are '$modules'" - exit 1 -fi features=$(python3 -c 'from PIL.features import *; print(" ".join(sorted(get_supported_features())))') if [ "$features" != "$EXP_FEATURES" ]; then echo "Features should be: '$EXP_FEATURES'; but are '$features'" diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 832c7423732..fb5b6077c3f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -17,17 +17,10 @@ jobs: - name: "macOS x86_64" os: macos-latest archs: x86_64 - - name: "macOS arm64" - os: macos-latest - archs: arm64 - - name: "manylinux2014 and musllinux x86_64" - os: ubuntu-latest - archs: x86_64 - - name: "manylinux_2_28 x86_64" + - name: "manylinux2014" os: ubuntu-latest archs: x86_64 build: "*manylinux*" - manylinux: "manylinux_2_28" steps: - uses: actions/checkout@v4 with: @@ -42,7 +35,6 @@ jobs: env: CIBW_ARCHS: ${{ matrix.archs }} CIBW_BUILD: ${{ matrix.build }} - CIBW_CONFIG_SETTINGS: raqm=enable raqm=vendor fribidi=vendor CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ${{ matrix.manylinux }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux }} - uses: actions/upload-artifact@v3 diff --git a/pyproject.toml b/pyproject.toml index 3a72107856c..fb8e0d3d71b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,6 +73,7 @@ Twitter = "https://twitter.com/PythonPillow" before-all = ".github/workflows/wheels-dependencies.sh" test-command = "cd {project} && .github/workflows/wheels-test.sh" test-extras = "tests" +build-frontend = { name = "pip", args = ["-v"] } [tool.setuptools] packages = ["PIL"] diff --git a/setup.py b/setup.py index f13f03713a3..0a0f4899f6c 100755 --- a/setup.py +++ b/setup.py @@ -217,6 +217,7 @@ def _find_include_file(self, include): _dbg("Checking for include file %s in %s", (include, directory)) if os.path.isfile(os.path.join(directory, include)): _dbg("Found %s", include) + print(os.path.join(directory, include)) return 1 return 0 @@ -802,8 +803,14 @@ def build_extensions(self): if feature.want("xcb"): _dbg("Looking for xcb") if _find_include_file(self, "xcb/xcb.h"): + print("torch include found") if _find_library_file(self, "xcb"): + print("torch library found") feature.xcb = "xcb" + else: + print("torch library missing") + else: + print("torch include missing") for f in feature: if not getattr(feature, f) and feature.require(f):