Repository navigation
Compare Pyodide shipped versions to declared specifiers - #678
Conversation
The base-resolution gate treated a package name in the Pyodide lock as installable. Check each direct and transitive specifier against the version Pyodide ships, and record a universal-wheel override as a note. Co-authored-by: Suraj Ranganath <[email protected]>
Name the locked release that declared a failing transitive specifier, ignore yanked universal wheels, and drop the name-only lock shortcut. Co-authored-by: Suraj Ranganath <[email protected]>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @suraj-ranganath's task in 1m 2s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notesNone. This is developer tooling with no EEGLAB counterpart. Checked: specifier and marker evaluation (including |
| for name, version in closure.items(): | ||
| requires = (releases[name].get("info") or {}).get("requires_dist") or [] | ||
| declared_by = f"locked release {name}=={version} Requires-Dist" |
There was a problem hiding this comment.
Important: transitive specifiers come from the parent version in uv.lock, but Pyodide installs a different parent version.
When Pyodide ships a parent whose version satisfies the direct specifier, micropip uses that bundled build, so that build's Requires-Dist applies. The Requires-Dist of the newer version in uv.lock does not. This is the same "lock runs ahead of Pyodide" problem the module docstring warns about, one level down. For example, uv.lock bumps matplotlib (Pyodide ships 3.8.4) to a release that requires numpy>=2.3. The gate then fails numpy, even though the bundled matplotlib 3.8.4 + numpy 2.2.5 pair installs fine.
The suggested fix in the message is also impossible to follow: "Lower the floor in locked release scipy==1.15.3 Requires-Dist" asks the user to edit third-party metadata.
test_transitive_specifier_the_bundled_version_misses_fails (tests/test_pyodide_harness.py:562) locks in this false failure. Pyodide ships scipy 1.14.1, which satisfies scipy>=1.14.1, so the numpy>=2.3 from scipy 1.15.3 would never apply.
Suggested fix: take each parent's Requires-Dist from the version that will actually be installed. That is the shipped version when the parent comes from pyodide-lock; Pyodide's lock is self-consistent, so you can also skip edges between two packages Pyodide ships. Use the locked version only when the parent comes from a PyPI wheel. Then flip that test so it expects ok.
A bundled parent installs Pyodide's build, so the newer lock pin's Requires-Dist does not apply. Use that pin only for a PyPI wheel. Co-authored-by: Suraj Ranganath <[email protected]>
|
Claude review follow-up: the important point (bundled Pyodide parents imposing the uv.lock Requires-Dist) was fixed in 5aeed95. A bundled parent whose shipped version satisfies the specifier no longer adds the newer pin's Requires-Dist, which matches micropip keeping the preloaded build. A PyPI-installed parent still applies its floor. Both cases are covered by |
The Pyodide resolution gate treated a package name in the lock as installable. It now asks whether the version Pyodide 0.29.5 ships satisfies each declared specifier, direct from pyproject.toml and transitive from the Requires-Dist of the release micropip installs. A parent that Pyodide ships, when that build satisfies its specifier, does not contribute the newer uv.lock pin's Requires-Dist. That pin is used only when micropip installs the parent from a PyPI wheel. A universal wheel that meets the specifier is a note. A compiled package that does not is a failure. The resolved version in uv.lock is not the comparison.
On develop, uv run python tools/check_pyodide_base_resolution.py exits 0:
[ok] colorama==0.4.6: pypi wheel: colorama-0.4.6-py2.py3-none-any.whl
[ok] contourpy==1.3.2: pyodide-lock 1.3.1
[ok] cycler==0.12.1: pyodide-lock 0.12.1
[ok] eeglabio==0.1.3: pypi wheel: eeglabio-0.1.3-py3-none-any.whl
[ok] fonttools==4.62.1: pyodide-lock 4.56.0
[ok] h5py==3.14.0: pyodide-lock 3.13.0
[ok] kiwisolver==1.5.0: pyodide-lock 1.4.8
[ok] matplotlib==3.10.9: pyodide-lock 3.8.4
[ok] numpy==2.2.6: pyodide-lock 2.2.5
[ok] packaging==26.2: pyodide-lock 26.2
[ok] pillow==12.2.0: pyodide-lock 11.3.0
[ok] pyparsing==3.3.2: pyodide-lock 3.2.1
[ok] python-dateutil==2.9.0.post0: pyodide-lock 2.9.0.post0
[ok] pyyaml==6.0.3: pyodide-lock 6.0.2
[ok] scipy==1.15.3: pyodide-lock 1.14.1
[ok] six==1.17.0: pyodide-lock 1.17.0
[ok] threadpoolctl==3.6.0: pyodide-lock 3.5.0
Checked 17 base packages against Pyodide 0.29.5: 0 failing, 0 known gaps (not blocking), 0 notes.
With the non-darwin scipy floor in pyproject.toml raised from >=1.14.1 to >=1.15, the same command exits 1 and names pyproject.toml:
[FAIL] scipy==1.15.3: tools/check_pyodide_base_resolution.py: scipy: Pyodide 0.29.5 ships 1.14.1, which does not satisfy scipy>=1.15 declared by pyproject.toml. Lower the floor in pyproject.toml to <= 1.14.1, or move to a Pyodide release that ships it.
Checked 17 base packages against Pyodide 0.29.5: 1 failing, 0 known gaps (not blocking), 0 notes.
Issue 375's acceptance criteria are all met on develop. This does not close issue 375.
Fixes #400