Skip to content

Commit 2a9855b

Browse files
agriyakhetarpalmroeschkelithomas1
authored
BLD, CI: Use cibuildwheel to build Emscripten/Pyodide wheels, push nightlies to Anaconda.org (#58647)
* BLD: Add note about keeping jobs in sync * BLD, CI: Upload Emscripten wheels nightly to Anaconda * Add configuration for `cibuildwheel`-Pyodide * Use unreleased `cibuildwheel` in wheels CI job * Temporarily move config from TOML to env vars * Rename job, to match update comment * Try out Pyodide 0.26.1 * Move Pyodide configuration to `pyproject.toml` * Use cibuildwheel v2.19 + clean up workflow * Skip a test that uses subprocesses * Match tests args with other Pyodide tests; use `not single_cpu` * Bump to cibuildwheel version 2.19.1 * Don't add `cp312` in job name Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> * Don't use separate job for Pyodide wheels * Fix matrix inclusion * Add separate step, set `CIBW_PLATFORM` to Pyodide * Add condition for non-Pyodide jobs * Use just one step, inherit `CIBW_PLATFORM` if not set Co-Authored-By: Thomas Li <47963215+lithomas1@users.noreply.github.com> * Remove condition that skips the step Co-Authored-By: Thomas Li <47963215+lithomas1@users.noreply.github.com> --------- Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
1 parent 1165859 commit 2a9855b

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.github/workflows/unit-tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ jobs:
391391
env:
392392
PYTHON_GIL: 0
393393

394+
# NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml
394395
emscripten:
395396
# Note: the Python version, Emscripten toolchain version are determined
396397
# by the Pyodide version. The appropriate versions can be found in the

.github/workflows/wheels.yml

+8
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ jobs:
100100
- [windows-2022, win_amd64]
101101
# TODO: support PyPy?
102102
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
103+
104+
# Build Pyodide wheels and upload them to Anaconda.org
105+
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
106+
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
107+
include:
108+
- buildplat: [ubuntu-22.04, pyodide_wasm32]
109+
python: ["cp312", "3.12"]
103110
env:
104111
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
105112
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -146,6 +153,7 @@ jobs:
146153
env:
147154
CIBW_PRERELEASE_PYTHONS: True
148155
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
156+
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
149157

150158
- name: Set up Python
151159
uses: mamba-org/setup-micromamba@v1

pandas/tests/test_common.py

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import numpy as np
88
import pytest
99

10+
from pandas.compat import WASM
11+
1012
import pandas as pd
1113
from pandas import Series
1214
import pandas._testing as tm
@@ -233,6 +235,7 @@ def test_temp_setattr(with_exception):
233235
assert ser.name == "first"
234236

235237

238+
@pytest.mark.skipif(WASM, reason="Can't start subprocesses in WASM")
236239
@pytest.mark.single_cpu
237240
def test_str_size():
238241
# GH#21758

pyproject.toml

+10
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ test-command = ""
177177
select = "*-macosx*"
178178
environment = {CFLAGS="-g0"}
179179

180+
[[tool.cibuildwheel.overrides]]
181+
select = "*pyodide*"
182+
test-requires = "pytest>=7.3.2 hypothesis>=6.46.1"
183+
# Pyodide repairs wheels on its own, using auditwheel-emscripten
184+
repair-wheel-command = ""
185+
test-command = """
186+
PANDAS_CI='1' python -c 'import pandas as pd; \
187+
pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db", "--no-strict-data-files"]);' \
188+
"""
189+
180190
[tool.ruff]
181191
line-length = 88
182192
target-version = "py310"

0 commit comments

Comments
 (0)