Skip to content

Conversation

@ryanking13
Copy link
Member

@ryanking13 ryanking13 commented Mar 13, 2025

Adds initial support for uv: make uv run pyodide ... work. Resolve #58

  • changelog

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Thanks, @ryanking13! The failing test on macOS looks like an easy fix. Also, marking #58 as related (could you please check if it fully resolves the issue?)

Comment on lines +66 to +68
uv = [
"build[uv]~=1.2.0",
]
Copy link
Member

Choose a reason for hiding this comment

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

Side note; I remember that pypa/build 1.2.0 broke things for us last year. Would it be worth it for us to vendor pypa/build, so that pypabuild.py can use it instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Side note; I remember that pypa/build 1.2.0 broke things for us last year.

I don't remember this. Could you please elaborate? Note that build~=1.2.0 is also set in the dependencies.

Would it be worth it for us to vendor pypa/build, so that pypabuild.py can use it instead?

No, I don't think vendoring is a good idea for pypa/build case. If we want to pin into a specific version, I would choose to pin the version in pyproject.toml instead.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, sounds good to me, thanks! It was this issue: numpy/numpy#26164

Comment on lines +133 to +135
run_prefix = (
[uv_helper.find_uv_bin(), "run"] if uv_helper.should_use_uv() else []
)
Copy link
Member

Choose a reason for hiding this comment

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

We should be careful about this, based on https://github.com/pyodide/pyodide-build/pull/132/files#r1996940827.

Copy link
Member Author

@ryanking13 ryanking13 Mar 25, 2025

Choose a reason for hiding this comment

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

Hmm, I see. Probably, we should entirely switch from subprocess call to multiprocessing to avoid this kind of problem.

@ryanking13
Copy link
Member Author

Okay, for now I will go ahead and merge. Let's keep discuss how we can improve uv support.

@ryanking13 ryanking13 merged commit 5c1259c into pyodide:main Mar 25, 2025
15 checks passed
@ryanking13 ryanking13 deleted the uv-init branch March 25, 2025 11:50
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.

pyodide xbuildenv install won't work if installed in uv-managed virtual environments

2 participants