Dev

Direct Publishing of WASM Wheels on PyPI Resolves Pyodide's Bottleneck

With the release of Pyodide 314.0, Python packages can now be built for WebAssembly and published directly to PyPI. This breaks away from the previous maintainer-dependent workflow and is expected to expand the ecosystem.

5 min read Reviewed & edited by the SINGULISM Editorial Team

Direct Publishing of WASM Wheels on PyPI Resolves Pyodide's Bottleneck
Photo from Unsplash

A major change has arrived in the Pyodide maintenance framework. According to the release announcement for Pyodide 314.0 (via Hacker News), it is now possible to build Python packages for WebAssembly (WASM) and publish them directly to PyPI. This change is expected to ease the burden of managing over 300 packages that the Pyodide team previously had to handle.

Background and Challenges

Pyodide is a project that compiles CPython to WebAssembly, enabling Python to run in the browser. As use cases for running machine learning and data analysis libraries in the browser have increased, the method of distributing packages has been a long-standing challenge.

While it was possible to compile C or Rust extension modules for WASM, there was no standard way to upload the resulting wheel files to PyPI. Consequently, the Pyodide team had to build and host over 300 packages themselves. This process was a significant burden for maintainers, and adding new packages required manual review, which constrained the growth of the ecosystem.

Technical Foundation: The Role of PEP 783

The change is supported by the PyEmscripten platform defined in PEP 783. This specification standardizes the platform tag for Python packages compiled for WASM. Specifically, wheel file names will include tags like pyemscripten_2026_0_wasm32. This allows PyPI to recognize WASM wheels and distribute them appropriately.

Support on PyPI itself was achieved through a pull request merged on April 21. Numerous contributors have been involved in this effort, and it has drawn praise in posts such as Simon Willison’s blog (who reported on this news in detail on his site).

Example: The luau-wasm Package

Simon Willison published a WASM package for the language Luau on PyPI to test this new feature. Luau is an MIT-licensed language developed by Roblox Corporation, which adds gradual typing to Lua. It is written in C++ and can be compiled to WASM.

The published package, luau-wasm, is provided as a 276KB wheel file (luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl). It can be used in Pyodide with the following code:

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
'''))

This code can be verified to work in the Pyodide REPL demo. The GitHub repository includes build scripts (using cibuildwheel) and a demonstration HTML page, published in a reproducible manner.

Impact on the Ecosystem

Previously, developers who wanted to publish packages for Pyodide had to ask the Pyodide team or run their own repositories. With this change, WASM wheels can be published to PyPI using the same workflow as for Linux, macOS, and Windows. This is expected to significantly lower the barrier to entry for new package maintainers.

On the other hand, it remains to be seen how many packages will actually support this new platform. Willison is investigating the number of packages currently publishing PyEmscripten-platform wheels on PyPI, but the count appears limited at this point. However, depending on future developments, the range of Python use cases in the browser could expand dramatically.

Editorial Opinion

In the short term, this change directly reduces the maintenance burden on Pyodide. By allowing package maintainers to introduce their own build configurations (such as WASM support in cibuildwheel), the cycle for adding new packages is expected to shorten significantly. Particularly in the fields of scientific computing and machine learning, having an environment where users can try out libraries in the browser will improve convenience for educational and demonstration purposes.

In the long term, the key will be whether the ecosystem of WASM Python packages grows organically. The standardization provided by PEP 783 is a solid foundation, but actual adoption will require effort from package maintainers and sustained compatibility from the runtime side. It also remains unclear whether Python use cases in the browser will expand from simple demos and education to full-fledged application development. How this technology will compete with or complement existing web-based Python environments like Jupyter Notebook and Streamlit is also a point worth watching.

From the editorial standpoint, this change is seen as a step forward for the “Python everywhere” vision. However, given that performance constraints and memory management issues on WASM remain unresolved, it should not be viewed as a complete replacement for native execution. How much resources the Pyodide team can allocate to runtime optimization and expanding package compatibility will determine true adoption. We recommend that readers test WASM wheels in their own projects to assess how realistic their usage is. Whether Python in the browser will become established as a third execution environment complementing server-side use will depend on future community momentum.

References

Frequently Asked Questions

What changes now that Pyodide's WASM wheels can be published directly to PyPI?
Previously, the Pyodide maintainers managed over 300 packages. Now, package maintainers can build and publish them to PyPI themselves. The bottleneck for adding new packages is removed, and the ecosystem is expected to grow.
What kinds of packages can be published as WASM wheels?
Python packages that include C or Rust extension modules are eligible. By building for the PyEmscripten platform defined in PEP 783, the wheel is recognized as a WASM wheel. In the code example, bindings for the Luau language are published.
Source: Simon Willison's Weblog

Comments

← Back to Home