Skip to content

Commit

Permalink
ci: try cibuildwheel pyodide (#935)
Browse files Browse the repository at this point in the history
* ci: try cibuildwheel pyodide

Signed-off-by: Henry Schreiner <[email protected]>

* ci: try setting the same args in cibuildwheel

Signed-off-by: Henry Schreiner <[email protected]>

* Update .github/workflows/emscripten.yaml

* Apply suggestions from code review

* Update emscripten.yaml

* Update emscripten.yaml

* Update .github/workflows/emscripten.yaml

* Update emscripten.yaml

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Jun 13, 2024
1 parent f57cc38 commit 8692d97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
41 changes: 7 additions & 34 deletions .github/workflows/emscripten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,21 @@ concurrency:
cancel-in-progress: true

jobs:
build-wasm-emscripten:
name: Pyodide wheel
build-pyodide:
name: Pyodide cibuildwheel
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- uses: yezz123/setup-uv@v4

- name: Install pyodide-build
run: |
uv pip install --system pyodide-build==0.26.1
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache

- name: Build
run: CXXFLAGS=-fexceptions LDFLAGS=-fexceptions pyodide build --exports whole_archive

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up Pyodide virtual environment
run: |
pyodide venv .venv-pyodide
.venv-pyodide/bin/pip install $(echo -n dist/*.whl)[test]
- name: Test
run: .venv-pyodide/bin/pytest
- uses: pypa/[email protected]
env:
CIBW_PLATFORM: pyodide

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: emscripten-wheel
path: dist/*.whl
name: pyodide-wheel
path: wheelhouse/*.whl
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ environment-pass = ["SETUPTOOLS_SCM_PRETEND_VERSION"]
environment.PIP_ONLY_BINARY = "numpy"
environment.PIP_PREFER_BINARY = "1"

[[tool.cibuildwheel.overrides]]
select = "*pyodide*"
inherit.environment = "append"
environment.CFLAGS = "-fexceptions"
environment.LDFLAGS = "-fexceptions"
build-frontend = {name = "build", args = ["--exports", "whole_archive"]}


[tool.pylint]
py-version = "3.7"
Expand Down

0 comments on commit 8692d97

Please sign in to comment.