Skip to content

Commit 748432e

Browse files
Create initial Pyodide workflow
1 parent 1bf86a3 commit 748432e

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/emscripten.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Test Emscripten/Pyodide build
2+
3+
on:
4+
# TODO: refine when this workflow should run when this
5+
# is ready for use or before merging
6+
pull_request:
7+
push:
8+
workflow_dispatch:
9+
10+
env:
11+
FORCE_COLOR: 3
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build-wasm-emscripten:
19+
name: Build pandas distribution for Pyodide
20+
runs-on: ubuntu-22.04
21+
# To enable this workflow on a fork, comment out:
22+
# if: github.repository == 'pandas-dev/pandas'
23+
env:
24+
PYODIDE_VERSION: 0.25.0
25+
# PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION.
26+
# The appropriate versions can be found in the Pyodide repodata.json
27+
# "info" field, or in Makefile.envs:
28+
# https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2
29+
PYTHON_VERSION: 3.11.3
30+
EMSCRIPTEN_VERSION: 3.1.46
31+
NODE_VERSION: 18
32+
steps:
33+
- name: Checkout pandas
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Set up Python ${{ env.PYTHON_VERSION }}
39+
id: setup-python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ env.PYTHON_VERSION }}
43+
44+
- name: Set up Emscripten toolchain
45+
uses: mymindstorm/setup-emsdk@v14
46+
with:
47+
version: ${{ env.EMSCRIPTEN_VERSION }}
48+
actions-cache-folder: emsdk-cache
49+
50+
- name: Install pyodide-build
51+
run: pip install "pydantic<2" pyodide-build==${{ env.PYODIDE_VERSION }}
52+
53+
- name: Build pandas for Pyodide
54+
run: |
55+
# pyodide build -Ceditable-verbose=true
56+
pyodide build
57+
58+
- name: Set up Node.js
59+
uses: actions/setup-node@v4
60+
with:
61+
node-version: ${{ env.NODE_VERSION }}
62+
63+
- name: Set up Pyodide virtual environment
64+
run: |
65+
pyodide venv .venv-pyodide
66+
source .venv-pyodide/bin/activate
67+
pip install dist/*.whl
68+
69+
- name: Test pandas for Pyodide
70+
run: |
71+
source .venv-pyodide/bin/activate
72+
export PANDAS_CI=1
73+
pip install pytest
74+
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas

0 commit comments

Comments
 (0)