Skip to content

Commit 5057d98

Browse files
committed
BLD: wasm
1 parent ea8dfaf commit 5057d98

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/wheels.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ jobs:
7878
python: "cp313t"
7979
- buildplat: [ macos13, macosx_x86_64, openblas ]
8080
python: "cp314t"
81-
81+
include:
82+
- buildplat: [ ubuntu-22.04, pyodide_wasm32, "" ]
83+
python: "cp312"
84+
- buildplat: [ ubuntu-22.04, pyodide_wasm32, "" ]
85+
python: "cp313"
8286
env:
8387
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }} # used in a cibw_*.sh script
8488

@@ -147,7 +151,12 @@ jobs:
147151
- name: Build wheel
148152
env:
149153
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
154+
SRC: ${{ github.workspace }}/numpy-src
150155
run: |
156+
if [[ $CIBW_BUILD == *pyodide_wasm32 ]]; then
157+
# specifying CIBW_PLATFORM is required to get the wasm build to work
158+
export CIBW_PLATFORM="pyodide"
159+
fi
151160
python -m pip install cibuildwheel==3.1.1
152161
python -m cibuildwheel numpy-src --config-file cibuildwheel.toml --output-dir ./dist
153162

cibuildwheel.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,13 @@ repair-wheel-command = "bash -el ./tools/wheels/repair_windows.sh {wheel} {dest_
3434
select = ["*-win32"]
3535
config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=true"], build-dir="build"}
3636
repair-wheel-command = ""
37+
38+
[tool.cibuildwheel.pyodide]
39+
before-test = "pip install -r $SRC/requirements/emscripten_test_requirements.txt"
40+
# Pyodide ensures that the wheels are already repaired by auditwheel-emscripten
41+
repair-wheel-command = ""
42+
test-command = "python -m pytest --pyargs numpy -m 'not slow'"
43+
44+
[tool.cibuildwheel.pyodide.config-settings]
45+
build-dir = "build"
46+
setup-args = ["--cross-file=$SRC/tools/ci/emscripten/emscripten.meson.cross", "-Dblas=none", "-Dlapack=none"]

0 commit comments

Comments
 (0)