Skip to content

Commit

Permalink
Point release to fix MacOS arm64 wheel builds (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaramallion authored Jan 20, 2024
1 parent 419fcbc commit e6823ba
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 21 deletions.
80 changes: 60 additions & 20 deletions .github/workflows/release-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,6 @@ jobs:
python: 312
platform_id: macosx_x86_64

# MacOS arm64
- os: macos-latest
python: 38
platform_id: macosx_arm64
- os: macos-latest
python: 39
platform_id: macosx_arm64
- os: macos-latest
python: 310
platform_id: macosx_arm64
- os: macos-latest
python: 311
platform_id: macosx_arm64
- os: macos-latest
python: 312
platform_id: macosx_arm64

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -169,13 +152,14 @@ jobs:
python -m pip install -U pip
python -m pip install cibuildwheel>=2.16
- name: Build wheels
- name: Build wheels (non-MacOS arm64)
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: all
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_ARCHS_MACOS: x86_64
CIBW_BUILD_VERBOSITY: 1
run: |
python --version
Expand All @@ -187,9 +171,66 @@ jobs:
name: wheel-${{ matrix.python }}-${{ matrix.platform_id }}
path: ./dist

build-wheels-macos-arm64:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
python: 38
platform_id: macosx_arm64
- os: macos-latest
python: 39
platform_id: macosx_arm64
- os: macos-latest
python: 310
platform_id: macosx_arm64
- os: macos-latest
python: 311
platform_id: macosx_arm64
- os: macos-latest
python: 312
platform_id: macosx_arm64

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.9'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2 wheel==0.42

- name: Build wheels
env:
CIBW_BUILD: cp${{ matrix.python }}-*
CIBW_ARCHS_MACOS: arm64
CIBW_BUILD_VERBOSITY: 1
run: |
python -m cibuildwheel --output-dir dist
# Cross compiling wheels for arm64 with poetry creates wheels with wrong tag
# Update the wheel with the correct tag then remove the incorrect wheel
- name: Fix poetry mistagging
run: |
wheel tags --platform-tag macosx_12_0_arm64 ./dist/*-macosx_12_0_x86_64.whl
rm ./dist/*-macosx_12_0_x86_64.whl
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}-${{ matrix.platform_id }}
path: ./dist/*.whl

test-package:
name: Test built package
needs: [ build-wheels, build-sdist ]
needs: [ build-wheels, build-sdist, build-wheels-macos-arm64 ]
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -233,7 +274,6 @@ jobs:
python -m pytest --pyargs openjpeg.tests
deactivate
# The pypi upload fails with non-linux containers, so grab the uploaded
# artifacts and run using those
# See: https://github.com/pypa/gh-action-pypi-publish/discussions/15
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ packages = [
{include = "openjpeg" },
]
readme = "README.md"
version = "2.1.0"
version = "2.1.1"

[tool.poetry.dependencies]
python = "^3.8"
Expand Down

0 comments on commit e6823ba

Please sign in to comment.