diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 5b9c42f6c36..5627db7e44b 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -1,10 +1,13 @@ #!/bin/bash # Define custom utilities # Test for macOS with [ -n "$IS_MACOS" ] +if [ -z "$IS_MACOS" ]; then + export MB_ML_LIBC=$(echo $AUDITWHEEL_POLICY | cut -f 1 -d _) + export MB_ML_VER="_"$(echo $AUDITWHEEL_POLICY | cut -f 2- -d _) +fi source wheels/multibuild/common_utils.sh -source wheels/multibuild/travis_steps.sh +PLAT=$CIBW_ARCHS source wheels/multibuild/library_builders.sh if [ -z "$IS_MACOS" ]; then - source wheels/multibuild/library_builders.sh source wheels/multibuild/manylinux_utils.sh fi @@ -34,9 +37,9 @@ BZIP2_VERSION=1.0.8 LIBXCB_VERSION=1.16 BROTLI_VERSION=1.1.0 -if [[ -n "$IS_MACOS" ]] && [[ "$PLAT" == "x86_64" ]]; then +if [[ -n "$IS_MACOS" ]] && [[ "$CIBW_ARCHS" == "x86_64" ]]; then function build_openjpeg { - local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz) + local out_dir=$(fetch_unpack https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz openjpeg-2.5.0.tar.gz) (cd $out_dir \ && cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \ && make install) @@ -46,7 +49,7 @@ fi function build_brotli { local cmake=$(get_modern_cmake) - local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz) + local out_dir=$(fetch_unpack https://github.com/google/brotli/archive/v$BROTLI_VERSION.tar.gz brotli-1.1.0.tar.gz) (cd $out_dir \ && $cmake -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX -DCMAKE_INSTALL_NAME_DIR=$BUILD_PREFIX/lib . \ && make install) @@ -61,7 +64,7 @@ function build_brotli { curl -fsSL -o pillow-depends-main.zip https://github.com/python-pillow/pillow-depends/archive/main.zip untar pillow-depends-main.zip -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then +if [[ -n "$IS_MACOS" ]]; then # webp, zstd, xz, libtiff, libxcb cause a conflict with building webp, libtiff, libxcb # libxdmcp causes an issue on macOS < 11 # curl from brew requires zstd, use system curl @@ -71,7 +74,7 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install pkg-config - if [[ "$PLAT" == "arm64" ]]; then + if [[ "$CIBW_ARCHS" == "arm64" ]]; then export MACOSX_DEPLOYMENT_TARGET="11.0" else export MACOSX_DEPLOYMENT_TARGET="10.10" @@ -95,7 +98,10 @@ if [ -n "$IS_MACOS" ]; then build_simple xorgproto 2023.2 https://www.x.org/pub/individual/proto build_simple libXau 1.0.11 https://www.x.org/pub/individual/lib build_simple libpthread-stubs 0.5 https://xcb.freedesktop.org/dist - cp venv/share/pkgconfig/xcb-proto.pc venv/lib/pkgconfig/xcb-proto.pc + ls -la /Library/Frameworks/Python.framework/Versions + ls -la /Library/Frameworks/Python.framework/Versions/Current + ls -la /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc + cp /Library/Frameworks/Python.framework/Versions/Current/share/pkgconfig/xcb-proto.pc /Library/Frameworks/Python.framework/Versions/Current/lib/pkgconfig else sed s/\${pc_sysrootdir\}// /usr/local/share/pkgconfig/xcb-proto.pc > /usr/local/lib/pkgconfig/xcb-proto.pc fi diff --git a/.github/workflows/wheels-linux.yml b/.github/workflows/wheels-linux.yml deleted file mode 100644 index 72a35edb27d..00000000000 --- a/.github/workflows/wheels-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build Linux wheels - -on: - workflow_call: - -env: - CONFIG_PATH: "wheels/config.sh" - REPO_DIR: "." - TEST_DEPENDS: "pytest pytest-timeout" - -jobs: - build: - name: ${{ matrix.python }} ${{ matrix.mb-ml-libc }}${{ matrix.mb-ml-ver }} - runs-on: "ubuntu-latest" - strategy: - fail-fast: false - matrix: - python: [ - "3.12", - ] - mb-ml-libc: [ "manylinux" ] - mb-ml-ver: [ "_2_28" ] - env: - MB_PYTHON_VERSION: ${{ matrix.python }} - MB_ML_LIBC: ${{ matrix.mb-ml-libc }} - MB_ML_VER: ${{ matrix.mb-ml-ver }} - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Build Wheel - run: | - python3 -m pip install cibuildwheel - python3 -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v3 - with: - path: wheelhouse/*.whl - # Uncomment to get SSH access for testing - # - name: Setup tmate session - # if: failure() - # uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/wheels-macos.yml b/.github/workflows/wheels-macos.yml deleted file mode 100644 index 7f1ec82c133..00000000000 --- a/.github/workflows/wheels-macos.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build macOS wheels - -on: - workflow_call: - -env: - CONFIG_PATH: "wheels/config.sh" - REPO_DIR: "." - TEST_DEPENDS: "pytest pytest-timeout" - -jobs: - build: - name: ${{ matrix.python }} ${{ matrix.platform }} - runs-on: "macos-latest" - strategy: - fail-fast: false - matrix: - python: [ - "3.12", - ] - platform: [ "x86_64", "arm64" ] - env: - PLAT: ${{ matrix.platform }} - MB_PYTHON_VERSION: ${{ matrix.python }} - TRAVIS_OS_NAME: "osx" - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: actions/setup-python@v4 - with: - python-version: "3.x" - - name: Build Wheel - run: | - python3 -m pip install cibuildwheel - python3 -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.artifacts-name }} - path: wheelhouse/*.whl - # Uncomment to get SSH access for testing - # - name: Setup tmate session - # if: failure() - # uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5e6cde5c564..e149b1a68d8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,8 +7,30 @@ permissions: contents: read jobs: - macos: - uses: ./.github/workflows/wheels-macos.yml - - linux: - uses: ./.github/workflows/wheels-linux.yml + build: + name: Build wheels on ${{ matrix.os }} ${{ matrix.archs }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + archs: [ x86_64 ] + include: + - os: macos-latest + archs: arm64 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + - name: Build wheels + run: | + python3 -m pip install cibuildwheel + python3 -m cibuildwheel --output-dir wheelhouse + env: + CIBW_ARCHS: ${{ matrix.archs }} + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl