Skip to content

Commit be8f9f2

Browse files
Backport PR #57163 on branch 2.2.x (CI: Add macOS M1 CI) (#57202)
Backport PR #57163: CI: Add macOS M1 CI Co-authored-by: Thomas Li <[email protected]>
1 parent 62aea0f commit be8f9f2

File tree

7 files changed

+19
-21
lines changed

7 files changed

+19
-21
lines changed

.github/workflows/unit-tests.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ jobs:
214214
timeout-minutes: 90
215215
strategy:
216216
matrix:
217-
os: [macos-latest, windows-latest]
217+
# Note: Don't use macOS latest since macos 14 appears to be arm64 only
218+
os: [macos-13, macos-14, windows-latest]
218219
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
219220
fail-fast: false
220221
runs-on: ${{ matrix.os }}
@@ -227,8 +228,7 @@ jobs:
227228
PANDAS_CI: 1
228229
PYTEST_TARGET: pandas
229230
PATTERN: "not slow and not db and not network and not single_cpu"
230-
# GH 47443: PYTEST_WORKERS > 0 crashes Windows builds with memory related errors
231-
PYTEST_WORKERS: ${{ matrix.os == 'macos-latest' && 'auto' || '0' }}
231+
PYTEST_WORKERS: 'auto'
232232

233233
steps:
234234
- name: Checkout
@@ -354,7 +354,8 @@ jobs:
354354
strategy:
355355
fail-fast: false
356356
matrix:
357-
os: [ubuntu-22.04, macOS-latest, windows-latest]
357+
# Separate out macOS 13 and 14, since macOS 14 is arm64 only
358+
os: [ubuntu-22.04, macOS-13, macOS-14, windows-latest]
358359

359360
timeout-minutes: 90
360361

.github/workflows/wheels.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ jobs:
9494
buildplat:
9595
- [ubuntu-22.04, manylinux_x86_64]
9696
- [ubuntu-22.04, musllinux_x86_64]
97-
- [macos-12, macosx_*]
97+
- [macos-12, macosx_x86_64]
98+
# Note: M1 images on Github Actions start from macOS 14
99+
- [macos-14, macosx_arm64]
98100
- [windows-2022, win_amd64]
99101
# TODO: support PyPy?
100102
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
@@ -128,7 +130,7 @@ jobs:
128130
# Python version used to build sdist doesn't matter
129131
# wheel will be built from sdist with the correct version
130132
- name: Unzip sdist (macOS)
131-
if: ${{ matrix.buildplat[1] == 'macosx_*' }}
133+
if: ${{ startsWith(matrix.buildplat[1], 'macosx') }}
132134
run: |
133135
tar -xzf ./dist/${{ env.sdist_name }} -C ./dist
134136
@@ -139,18 +141,18 @@ jobs:
139141

140142
- name: Build normal wheels
141143
if: ${{ (env.IS_SCHEDULE_DISPATCH != 'true' || env.IS_PUSH == 'true') }}
142-
uses: pypa/[email protected].4
144+
uses: pypa/[email protected].5
143145
with:
144-
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
146+
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
145147
env:
146148
CIBW_PRERELEASE_PYTHONS: True
147149
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
148150

149151
- name: Build nightly wheels (with NumPy pre-release)
150152
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
151-
uses: pypa/[email protected].4
153+
uses: pypa/[email protected].5
152154
with:
153-
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
155+
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
154156
env:
155157
# The nightly wheels should be build witht he NumPy 2.0 pre-releases
156158
# which requires the additional URL.
@@ -183,15 +185,15 @@ jobs:
183185
$TST_CMD = @"
184186
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
185187
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
186-
python -c `'import pandas as pd; pd.test(extra_args=[\"`\"--no-strict-data-files`\"\", \"`\"-m not clipboard and not single_cpu and not slow and not network and not db`\"\"])`';
188+
python -c `'import pandas as pd; pd.test(extra_args=[`\"--no-strict-data-files`\", `\"-m not clipboard and not single_cpu and not slow and not network and not db`\"])`';
187189
"@
188190
# add rc to the end of the image name if the Python version is unreleased
189191
docker pull python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
190192
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
191193
192194
- uses: actions/upload-artifact@v4
193195
with:
194-
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
196+
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
195197
path: ./wheelhouse/*.whl
196198

197199
- name: Upload wheels & sdist

ci/deps/actions-310.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-localserver>=0.7.1
1817
- pytest-qt>=4.2.0
1918
- boto3
2019

@@ -61,3 +60,4 @@ dependencies:
6160
- adbc-driver-postgresql>=0.8.0
6261
- adbc-driver-sqlite>=0.8.0
6362
- tzdata>=2022.7
63+
- pytest-localserver>=0.7.1

ci/deps/actions-311.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-localserver>=0.7.1
1817
- pytest-qt>=4.2.0
1918
- boto3
2019

@@ -60,4 +59,4 @@ dependencies:
6059
- pip:
6160
- adbc-driver-postgresql>=0.8.0
6261
- adbc-driver-sqlite>=0.8.0
63-
- tzdata>=2022.7
62+
- pytest-localserver>=0.7.1

ci/deps/actions-312.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-localserver>=0.7.1
1817
- pytest-qt>=4.2.0
1918
- boto3
2019

@@ -61,3 +60,4 @@ dependencies:
6160
- adbc-driver-postgresql>=0.8.0
6261
- adbc-driver-sqlite>=0.8.0
6362
- tzdata>=2022.7
63+
- pytest-localserver>=0.7.1

ci/deps/actions-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dependencies:
1414
- pytest>=7.3.2
1515
- pytest-cov
1616
- pytest-xdist>=2.2.0
17-
- pytest-localserver>=0.7.1
1817
- pytest-qt>=4.2.0
1918
- boto3
2019

@@ -61,3 +60,4 @@ dependencies:
6160
- adbc-driver-postgresql>=0.8.0
6261
- adbc-driver-sqlite>=0.8.0
6362
- tzdata>=2022.7
63+
- pytest-localserver>=0.7.1

pyproject.toml

-4
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@ test-command = """
162162
pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
163163
"""
164164

165-
[tool.cibuildwheel.macos]
166-
archs = "x86_64 arm64"
167-
test-skip = "*_arm64"
168-
169165
[tool.cibuildwheel.windows]
170166
before-build = "pip install delvewheel"
171167
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}"

0 commit comments

Comments
 (0)