Skip to content

Commit b512c64

Browse files
lithomas1pmhatre1
authored andcommitted
CI: Add macOS M1 CI (pandas-dev#57163)
* CI: Start testing on M1 * install pytest-localserver from pip * typo * more CI adjustments and try to fix wheel builders * more fixes * auto workers on windows as well * fix wheel builders * Update wheels.yml * bump cibuildwheel * bump both * maybe fix windows as well
1 parent 67bd76d commit b512c64

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
@@ -202,7 +202,8 @@ jobs:
202202
timeout-minutes: 90
203203
strategy:
204204
matrix:
205-
os: [macos-latest, windows-latest]
205+
# Note: Don't use macOS latest since macos 14 appears to be arm64 only
206+
os: [macos-13, macos-14, windows-latest]
206207
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
207208
fail-fast: false
208209
runs-on: ${{ matrix.os }}
@@ -215,8 +216,7 @@ jobs:
215216
PANDAS_CI: 1
216217
PYTEST_TARGET: pandas
217218
PATTERN: "not slow and not db and not network and not single_cpu"
218-
# GH 47443: PYTEST_WORKERS > 0 crashes Windows builds with memory related errors
219-
PYTEST_WORKERS: ${{ matrix.os == 'macos-latest' && 'auto' || '0' }}
219+
PYTEST_WORKERS: 'auto'
220220

221221
steps:
222222
- name: Checkout
@@ -342,7 +342,8 @@ jobs:
342342
strategy:
343343
fail-fast: false
344344
matrix:
345-
os: [ubuntu-22.04, macOS-latest, windows-latest]
345+
# Separate out macOS 13 and 14, since macOS 14 is arm64 only
346+
os: [ubuntu-22.04, macOS-13, macOS-14, windows-latest]
346347

347348
timeout-minutes: 90
348349

.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
@@ -161,10 +161,6 @@ test-command = """
161161
pd.test(extra_args=["-m not clipboard and single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
162162
"""
163163

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

0 commit comments

Comments
 (0)