Skip to content

Commit 78ccdcb

Browse files
authored
PYTHON-4177 Build and Test M1 macOS wheels on GHA (#1497)
1 parent b185e50 commit 78ccdcb

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.github/workflows/release-python.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
99
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
1010
workflow_dispatch:
11+
pull_request:
1112

1213
concurrency:
1314
group: wheels-${{ github.ref }}
@@ -33,10 +34,22 @@ jobs:
3334
- [ubuntu-20.04, manylinux_ppc64le]
3435
- [ubuntu-20.04, manylinux_s390x]
3536
- [ubuntu-20.04, manylinux_i686]
36-
- [macos-11, macosx_*]
3737
- [windows-2019, win_amd64]
3838
- [windows-2019, win32]
3939
python: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312"]
40+
include:
41+
- buildplat: [macos-11, macosx_x86_64]
42+
python: "cp37"
43+
- buildplat: [macos-11, macosx_*]
44+
python: "cp38"
45+
- buildplat: [macos-11, macosx_*]
46+
python: "cp39"
47+
- buildplat: [macos-14, macosx_*]
48+
python: "cp310"
49+
- buildplat: [macos-14, macosx_*]
50+
python: "cp311"
51+
- buildplat: [macos-14, macosx_*]
52+
python: "cp312"
4053

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

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

79-
- name: Build wheel
80-
if: ${{ matrix.python != 'cp37' || matrix.buildplat[0] != 'macos-11' }}
89+
- name: Build wheel on M1
90+
if: ${{ matrix.buildplat[0] == 'macos-14' }}
8191
env:
8292
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
8393
run: python -m cibuildwheel --output-dir wheelhouse

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,3 @@ test-command = "python {project}/tools/fail_if_no_c.py"
235235

236236
[tool.cibuildwheel.linux]
237237
archs = "x86_64 aarch64 ppc64le s390x i686"
238-
239-
[tool.cibuildwheel.macos]
240-
archs = "universal2"
241-
test-command = "ENSURE_UNIVERSAL2=1 python {project}/tools/fail_if_no_c.py"
242-
test-skip = "*-macosx_universal2:arm64"

0 commit comments

Comments
 (0)