Pyodide 314.0 支持将 WASM wheel 发布到 PyPI
Publishing WASM wheels to PyPI for use with Pyodide
Pyodide 314.0 发布后,开发者可将为 Pyodide 编译的 Python 包以 wheel 格式发布到 PyPI 并在运行时通过 `micropip` 安装。此前逾 300 个包需由 Pyodide 维护者统一构建托管。作者用 Codex + GPT-5.5 xhigh 将 Luau 的 WebAssembly 版本打包为 `luau-wasm` 并上传至 PyPI,wheel 仅 276KB,展示了完整流程。截至发布,已有 28 个 PyPI 包使用新 `pyemscripten_202*_wasm32` 标签。
The Pyodide 314.0 release announcement (via Hacker News) includes news I’ve been looking forward to for a long time:
You can now publish Python packages built for Pyodide (or any Python runtime compatible with the PyEmscripten platform defined in PEP 783) directly to PyPI and install them at runtime.
Previously, the Pyodide maintainers had to maintain, build, and host over 300 packages ourselves. This created a significant burden on our maintainers and became a major bottleneck for the community, as every new package required manual review.
Moving forward, package maintainers can simply build and publish Pyodide wheels to PyPI, just as they do for native wheels on Linux, macOS, or Windows.
Here’s the PR to PyPI itself supporting this, which landed on April 21st.
I adore Pyodide, and have been frustrated in the past by this limitation. It’s possible to compile C or Rust extensions to WASM in a wheel file, but before now there was no easy way to distribute them.
Thanks to the efforts of a whole lot of people, that’s now been fixed!
Trying it out with luau-wasm
I decided to celebrate by finding something I could package. I have quite a few experimental Pyodide projects lying around, but the best fit for this looked to be my Luau WebAssembly research spike from 9th March.
Luau is a “small, fast, and embeddable programming language based on Lua with a gradual type system”, developed by Roblox and released under an MIT license.
It’s written in C++. I already knew it was possible to compile it to WebAssembly and get it running inside of Pyodide, so I set Codex + GPT-5.5 xhigh the task of packaging my experiment up and publishing it to PyPI using GitHub Actions.
It took some iteration, but here’s the result: luau-wasm is a brand new PyPI package which publishes a 276KB luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl file which can be used in Pyodide like this:
import micropip await micropip.install("luau-wasm") import luau_wasm print(luau_wasm.execute(r''' local animals = {"fox", "owl", "frog", "rabbit"} table.sort(animals, function(a, b) return #a < #b end) for i, name in animals do print(i .. ". " .. name .. " (" .. #name .. ")") end '''))
You can run that code in the Pyodide REPL demo to see it in action.
The GitHub repo for luau-wasm includes all of the build and deploy scripts (using the latest cibuildwheel) and also deploys an HTML demo page which loads Pyodide, installs luau-wasm and provides an interface for trying it out: https://simonw.github.io/luau-wasm/
How many packages are using this so far?
I was curious to see how many packages are currently publishing wheels for this platform.
After some tinkering with ChatGPT I got to this BigQuery SQL which I ran against PyPI’s public dataset on BigQuery. Here’s the raw JSON of query results and here’s a SQLite SQL query in Datasette Lite which dedupes packages by most recent upload date.
If the query is right, there are currently 28 PyPI packages publishing with the new pyemscripten_202*_wasm32 tags:
Here’s hoping we see a whole lot more of those showing up over the coming months and years.
13th June 2026
More recent articles
- Kimi K3, and what we can still learn from the pelican benchmark - 16th July 2026
- The new GPT-5.6 family: Luna, Terra, Sol - 9th July 2026
- sqlite-utils 4.0, now with database schema migrations - 7th July 2026
This is Publishing WASM wheels to PyPI for use with Pyodide by Simon Willison, posted on 13th June 2026.
来源:Simon Willison 博客 · simonwillison.net