Skip to content

Commit 3b6f382

Browse files
Enable run for Emscripten/Pyodide wheels
Copied with updates and suggestions received from numpy#24603 on 23/02/2024.
1 parent 0c51ac6 commit 3b6f382

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

.github/workflows/emscripten.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- main
1010
- maintenance/**
11+
# TODO: remove both of these after everything is ready
12+
push:
13+
workflow_dispatch:
1114

1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -19,50 +22,46 @@ permissions:
1922
jobs:
2023
build-wasm-emscripten:
2124
runs-on: ubuntu-22.04
22-
if: false # NOTE: job disabled, it needs to be moved to Meson (see gh-24603)
2325
# if: "github.repository == 'numpy/numpy'"
2426
env:
25-
PYODIDE_VERSION: 0.23.1
27+
PYODIDE_VERSION: 0.25.0
2628
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
2729
# The appropriate versions can be found in the Pyodide repodata.json
2830
# "info" field, or in Makefile.envs:
2931
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
30-
PYTHON_VERSION: 3.11.2
31-
EMSCRIPTEN_VERSION: 3.1.32
32+
PYTHON_VERSION: 3.111.3
33+
EMSCRIPTEN_VERSION: 3.1.46
3234
NODE_VERSION: 18
3335
steps:
3436
- name: Checkout numpy
3537
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3638
with:
3739
submodules: true
38-
# versioneer.py requires the latest tag to be reachable. Here we
39-
# fetch the complete history to get access to the tags.
40-
# A shallow clone can work when the following issue is resolved:
41-
# https://github.com/actions/checkout/issues/338
42-
fetch-depth: 0
40+
# The fetch-tags input shall fetch tags for versioneer.py without
41+
# the need to fetch the entire history, see
42+
# https://github.com/actions/checkout#usage
43+
fetch-tags: true
4344

44-
- name: set up python
45+
- name: Set up Python ${{ env.PYTHON_VERSION }}
4546
id: setup-python
4647
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
4748
with:
4849
python-version: ${{ env.PYTHON_VERSION }}
4950

50-
- uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
51+
- name: Set up Emscripten toolchain
52+
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
5153
with:
5254
version: ${{ env.EMSCRIPTEN_VERSION }}
5355
actions-cache-folder: emsdk-cache
5456

5557
- name: Install pyodide-build
5658
run: pip install "pydantic<2" pyodide-build==$PYODIDE_VERSION
5759

58-
- name: Build
60+
- name: Build NumPy for Pyodide
5961
run: |
60-
# Pyodide is still in the process of adding better/easier support for
61-
# non-setup.py based builds.
62-
cp pyproject.toml.setuppy pyproject.toml
63-
CFLAGS=-g2 LDFLAGS=-g2 pyodide build
62+
pyodide build -Csetup-args="--cross-file=$PWD/tools/ci/emscripten.meson.cross"
6463
65-
- name: set up node
64+
- name: Set up Node.js
6665
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
6766
with:
6867
node-version: ${{ env.NODE_VERSION }}
@@ -73,11 +72,10 @@ jobs:
7372
source .venv-pyodide/bin/activate
7473
pip install dist/*.whl
7574
python -c "import sys; print(sys.platform)"
76-
# TODO: when re-enabled this workflow, install test deps differently
77-
# since ninja isn't installable with pyodide
7875
pip install -r requirements/test_requirements.txt
79-
- name: Test
76+
77+
- name: Test NumPy for Pyodide
8078
run: |
8179
source .venv-pyodide/bin/activate
8280
cd ..
83-
python numpy/runtests.py -n -vv
81+
pytest --pyargs numpy -m "not slow"

0 commit comments

Comments
 (0)