Skip to content

fix: ensure the same version is installed in host and pyodide venv#59

Merged
ryanking13 merged 13 commits intomainfrom
gyeongjae/version-equal
Feb 9, 2026
Merged

fix: ensure the same version is installed in host and pyodide venv#59
ryanking13 merged 13 commits intomainfrom
gyeongjae/version-equal

Conversation

@ryanking13
Copy link
Contributor

@ryanking13 ryanking13 commented Jan 19, 2026

This ensures the same version is installed in the host venv and Pyodide venv.

The solution is a little bit ugly...

  1. Install packages from PyPI
  2. Install packages from Pyodide index
  3. (new) Re install packages from PyPI with the same versions in Pyodide index

Once we have PEP 783 accepted and all the packages are hosted in PyPI, we should be able to get rid of these steps.


Before this change, the packages installed in the two venv were different, as follows:

FAILED tests/test_cli.py::test_sync_command_integration[dependencies1] - AssertionError: Version mismatch for numpy: vendor has 2.0.2, venv has 2.4.1

@ryanking13 ryanking13 force-pushed the gyeongjae/version-equal branch from e95c616 to 70d73be Compare January 19, 2026 07:50
@ryanking13 ryanking13 requested review from dom96 and hoodmane and removed request for dom96 January 19, 2026 08:58
@hoodmane
Copy link
Contributor

Is there a reason we can't install the packages in the Pyodide venv first?

@hoodmane
Copy link
Contributor

hoodmane commented Jan 26, 2026

Okay I see:

>     # We need to install to .venv-workers first, so that we can determine if the packages requested
>    # by the user are valid.

But surely we don't need to install them, we should be able to do uv lock or something?

@ryanking13
Copy link
Contributor Author

The problem is that we don't know which versions are available in Pyodide index until we install packages from it.

Maybe we can

  1. Install from Pyodide index first
  2. If there is an error, keep going and try to install from PyPI
  3. If PyPI also errors, show PyPI error, otherwise, show Pyodide error.

but that makes the error handling slightly more complex, but we can try.

@ryanking13 ryanking13 requested a review from dom96 February 3, 2026 05:55
Copy link
Contributor

@dom96 dom96 left a comment

Choose a reason for hiding this comment

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

I left a few suggestions for the tests, but otherwise LGTM.

@ryanking13 ryanking13 merged commit f85a938 into main Feb 9, 2026
9 checks passed
@ryanking13 ryanking13 deleted the gyeongjae/version-equal branch February 9, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants