Skip to content

Add Pyodide (WASM) wheel build and release asset - #1960

Open
ericmjl wants to merge 5 commits into
pymc-devs:mainfrom
ericmjl:pyodide-wasm-build-and-release
Open

Add Pyodide (WASM) wheel build and release asset#1960
ericmjl wants to merge 5 commits into
pymc-devs:mainfrom
ericmjl:pyodide-wasm-build-and-release

Conversation

@ericmjl

@ericmjl ericmjl commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaces the old "Build universal wheel for Pyodide" job (PYODIDE=1 + setup.py bdist_wheel --universal) with a proper pyodide-build + Emscripten job that produces a wasm32 wheel.
  • Adds a job that uploads the Pyodide wheel to the GitHub Release as an asset when a release is published (PyPI does not yet accept wasm32 wheels).
  • Adds optional dependency pyodide in pyproject.toml and documents the manual Pyodide build in the dev guide; no Pixi or other new tooling.
  • Removes Pixi-only references: .pixi from pre-commit sphinx-lint args, and conda/mamba/pixiconda/mamba in cmodule and troubleshooting docs.

Numba remains optional on wasm via existing environment markers, so the Pyodide wheel is micropip-installable without numba.

CI changes

  • build_pyodide_wheel: Python 3.12, install pyodide-build, get Emscripten version, mymindstorm/setup-emsdk, pip install -e ".[pyodide]", pyodide build, upload pyodide_wheel artifact.
  • upload_pyodide_to_release: On release published, download pyodide_wheel and attach to the release via softprops/action-gh-release.
  • upload_pypi: No longer downloads or uploads the old universal_wheel; PyPI receives only sdist + cibuildwheel platform wheels.

Made with Cursor

Comment thread .github/workflows/pypi.yml Fixed
Comment thread .github/workflows/pypi.yml Fixed
Comment thread .github/workflows/pypi.yml Fixed
@ericmjl
ericmjl requested review from Armavica and ricardoV94 March 8, 2026 22:57
Comment thread .github/workflows/pypi.yml Fixed
@ricardoV94

Copy link
Copy Markdown
Member

@ericmjl for future reference we prefer devs to contribute from their forks instead of working on the main repo directly

Comment thread doc/dev_start_guide.rst Outdated
Comment thread doc/troubleshooting.rst Outdated
Comment thread doc/dev_start_guide.rst Outdated
Comment thread .pre-commit-config.yaml Outdated
Comment thread pytensor/link/c/cmodule.py Outdated
Comment thread .github/workflows/pypi.yml
Comment thread .github/workflows/pypi.yml Outdated
@ericmjl

ericmjl commented Mar 10, 2026

Copy link
Copy Markdown
Member Author

@ericmjl for future reference we prefer devs to contribute from their forks instead of working on the main repo directly

I'm pretty sure I'm working from my own fork 😄

@lucianopaz lucianopaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be good to add a line some in the README.md or the docs landing page saying how to install on a wasm environment? Wouldn't users have to put in the full url of the github release to install?

@ricardoV94

Copy link
Copy Markdown
Member

@ericmjl for future reference we prefer devs to contribute from their forks instead of working on the main repo directly

I'm pretty sure I'm working from my own fork 😄

You sure are, I wasn't seeing the ericmjl prefix before on my desktop. On the mobile I see

@ericmjl

ericmjl commented Mar 14, 2026

Copy link
Copy Markdown
Member Author

@lucianopaz addressed your comment too.

@ericmjl
ericmjl force-pushed the pyodide-wasm-build-and-release branch from 4d82c0f to 0e6aa46 Compare March 27, 2026 11:44
@ericmjl
ericmjl force-pushed the pyodide-wasm-build-and-release branch from 0e6aa46 to a305593 Compare May 16, 2026 16:44
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@maresb

maresb commented May 16, 2026

Copy link
Copy Markdown
Collaborator

@ericmjl, heads-up in case you didn't notice, there are lots of merge conflicts from your last force-push.

@ricardoV94

Copy link
Copy Markdown
Member

just the branch target

@ricardoV94
ricardoV94 changed the base branch from v2 to main May 17, 2026 06:38
@anutosh491

anutosh491 commented Aug 5, 2026

Copy link
Copy Markdown

Hi,

This is Anutosh here (Jupyterlite, LLVM, Clang, Clang-Repl & Emscripten-Forge maintainer/contributor)

I have successfully built numba & llvmlite for wasm. I spoke about upstreaming my patches in the Numba community call yesterday and we should be making progress there. For more technical details go through my comment here : numba/numba#3284 (comment)

You can try out Numba in Jupyterlite here : https://notebook.link/@anutosh491/numba

I had interacted with Thomas Wiecki (@twiecki) about 2 weeks back on my LinkedIn post talking about how PyTensor could benefit out of this.

Hence I went ahead and built PyTensor for wasm enabling Numba as PyTensor's WebAssembly linker.

Check it out here, I have hosted a simple demo notebook to start with : https://notebook.link/@anutosh491/PyTensor (enable the debug logs to see how numba functions in the backend)

cc @ricardoV94 @maresb @lucianopaz

Feel free to contact us (me, @SylvainCorlay or @MMesch) at QuantStack for more details. We are the main authors of Jupyterlite and would like to host a Jupyterlite notebook in PyTensor's readme. We should possibly be able to shift tutorials or examples that users want to try out in Jupyterlite itself.

Comment thread pyproject.toml Outdated
ericmjl added 4 commits August 5, 2026 18:25
- Replace old 'Build universal wheel for Pyodide' job with proper pyodide-build
  + Emscripten job: Python 3.12, pyodide-build, setup-emsdk, pip install -e .[pyodide], pyodide build
  + Upload artifact pyodide_wheel (dist/*wasm32.whl)
- Add job to upload Pyodide wheel to GitHub Release on publish (PyPI does not accept wasm32 yet)
- Add optional dependency pyodide = [pyodide-build>=0.29.2] and document manual build in dev guide
- Remove Pixi references: .pixi from pre-commit sphinx-lint args, conda/mamba/pixi -> conda/mamba in cmodule and troubleshooting
- upload_pypi no longer downloads universal_wheel; PyPI gets only sdist + cibuildwheel wheels
- Numba remains optional on wasm via existing env markers (micropip install works without numba)

Made-with: Cursor
- Restore pixi references in docs and warnings (previously removed without explanation)
- Restore helpful workflow comments in pypi.yml
- Move Pyodide build docs from dev_start_guide to install.rst (more appropriate location)
- Add user-facing WASM/Pyodide installation instructions in install.rst
Addresses lucianopaz's feedback: make WASM installation instructions
discoverable from the README and docs index, not just install.rst.
@ericmjl
ericmjl force-pushed the pyodide-wasm-build-and-release branch from a305593 to 3596bde Compare August 5, 2026 22:27
@ericmjl

ericmjl commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

Alrighty, @ricardoV94 and @maresb -- looks like we're in a good spot now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants