Repository navigation
Description
What
tools/check_pyodide_base_resolution.py on epic/324-pyodide-browser decides whether a base
dependency is available under Pyodide by testing the package name against the Pyodide lock:
pyodide_names = {canonicalize_name(name) for name in pyodide_lock["packages"]}
...
in_lock = canonicalize_name(name) in pyodide_namesThe required version is never compared against the shipped version.
So the gate answers "does Pyodide have a package by this name", not "can Pyodide satisfy this
constraint", and a floor above what Pyodide ships passes it.
Evidence
epic/324-pyodide-browser declares threadpoolctl>=3.6.0.
Pyodide 0.29.5 ships threadpoolctl 3.5.0 (from pyodide-lock.json for that release).
Running the gate against a tree whose lock resolves threadpoolctl to 3.6.0 prints:
[ok] threadpoolctl==3.6.0: pyodide-lock
which is the gate approving a constraint the distribution cannot meet.
This is how the floor reached the epic branch with the gate already in place.
Shipped versions in Pyodide 0.29.5, for reference:
| package | Pyodide 0.29.5 |
|---|---|
| Python | 3.13.2 |
| threadpoolctl | 3.5.0 |
| scipy | 1.14.1 |
| numpy | 2.2.5 |
| matplotlib | 3.8.4 |
| h5py | 3.13.0 |
Suggested fix
Compare the resolved version against pyodide_lock["packages"][name]["version"].
When they differ, the package is only acceptable if micropip can pull a universal wheel for the
required version, which is the check _find_universal_wheel already implements for the
not-in-Pyodide case. So the fix is to stop treating "in the lock" as automatically ok and route a
version mismatch through the same wheel lookup.
Worth deciding explicitly: a pure-Python package can be overridden from PyPI, but a package with a
compiled extension cannot, and for those a mismatch is a hard failure rather than an extra download.
Related
- mne is a base dependency, but eegprep is its peer rather than its consumer #395 dependency audit
- Require Python 3.12, and bound every dependency floor by what Pyodide ships #399 raises every floor on
developto at or below what Pyodide ships, which is the same class
of constraint enforced by hand rather than by this gate
Activity
Test that the floors stay installable in the browser
Require Python 3.12, and bound every dependency floor by what Pyodide…
neuromechanist commentedon Sep 21, 2026
Correcting this issue: the threadpoolctl example I opened it with is wrong, and the fix I
first proposed makes the gate worse. The blind spot is real, but it is narrower and differently
shaped than described above.
What is wrong with the original report
threadpoolctl>=3.6.0against a Pyodide shipping 3.5.0 is not a broken browser install.threadpoolctl publishes
threadpoolctl-3.6.0-py3-none-any.whl, a universal wheel, so micropippulls 3.6.0 straight from PyPI and the Pyodide build is simply not used. It costs a download, not
an install failure. I called it a live bug; it is not one.
What is actually true
Pyodide's bundled build is the only option for a package that publishes no pure-Python wheel.
Checked against PyPI:
py3-none-anySo the constraint binds on compiled packages only, and
_find_universal_wheelin this tool isalready the right question to ask for everything else.
Why the naive fix is wrong too
Comparing the lockfile's resolved version against Pyodide's shipped version looks like the fix and
is not.
uv.lockresolves for the development environment and runs ahead of Pyodide by design, sothe comparison fires on packages that are perfectly fine: scipy locks to 1.15.3 while the declared
constraint is
>=1.14.1, which Pyodide's 1.14.1 satisfies. I tried it on the epic branch and itreported 11 failures, nearly all false.
The question the gate should ask is "does Pyodide's shipped version satisfy the declared
specifier", evaluated against
[project].dependencies, not against whatever the lock happenedto resolve. For a package with no universal wheel a failure there is fatal; for one with a
universal wheel it is at most a note about download size.
Where this is covered meanwhile
tests/test_browser_dependency_floors.py(#399) asks the correct question offline, and now scopesthe hard assertion to the four compiled packages with
PYODIDE_PURE_PYTHONrecorded separately anddeliberately not enforced. It is verified non-vacuous by raising the scipy floor above 1.14.1.
This issue stays open for the gate itself, with the corrected diagnosis.
Scope the browser floor guard to compiled packages (#402)