Skip to content

PYTHON-4177 Build and Test M1 macOS wheels on GHA #1497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
pull_request:

concurrency:
group: wheels-${{ github.ref }}
Expand All @@ -33,10 +34,22 @@ jobs:
- [ubuntu-20.04, manylinux_ppc64le]
- [ubuntu-20.04, manylinux_s390x]
- [ubuntu-20.04, manylinux_i686]
- [macos-11, macosx_*]
- [windows-2019, win_amd64]
- [windows-2019, win32]
python: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
include:
- buildplat: [macos-11, macosx_x86_64]
python: "cp37"
- buildplat: [macos-11, macosx_*]
python: "cp38"
- buildplat: [macos-11, macosx_*]
python: "cp39"
- buildplat: [macos-14, macosx_*]
python: "cp310"
- buildplat: [macos-14, macosx_*]
python: "cp311"
- buildplat: [macos-14, macosx_*]
python: "cp312"

steps:
- name: Checkout pymongo
Expand Down Expand Up @@ -66,18 +79,15 @@ jobs:
# Note: the default manylinux is manylinux2014
run: python -m pip install "cibuildwheel>=2.4,<3"

- name: Build MacOS Py37 Wheel
# Universal wheels are not supported with Python 3.7, so we explicitly
# produce an x86_64 wheel for Python 3.7 on MacOS.
if: ${{ matrix.python == 'cp37' && matrix.buildplat[0] == 'macos-11' }}
- name: Build wheel
if: ${{ matrix.buildplat[0] != 'macos-14' }}
env:
CIBW_BUILD: cp37-macosx_x86_64
CIBW_ARCHS: x86_64
CIBW_TEST_COMMAND: "python {project}/tools/fail_if_no_c.py"
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
MACOS_TEST_SKIP: "*arm64"
run: python -m cibuildwheel --output-dir wheelhouse

- name: Build wheel
if: ${{ matrix.python != 'cp37' || matrix.buildplat[0] != 'macos-11' }}
- name: Build wheel on M1
if: ${{ matrix.buildplat[0] == 'macos-14' }}
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
run: python -m cibuildwheel --output-dir wheelhouse
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,3 @@ test-command = "python {project}/tools/fail_if_no_c.py"

[tool.cibuildwheel.linux]
archs = "x86_64 aarch64 ppc64le s390x i686"

[tool.cibuildwheel.macos]
archs = "universal2"
test-command = "ENSURE_UNIVERSAL2=1 python {project}/tools/fail_if_no_c.py"
test-skip = "*-macosx_universal2:arm64"