-
Notifications
You must be signed in to change notification settings - Fork 22
Add initial support for uv #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7aab043
ec25ecd
2ffc601
3b7981b
4d1c864
226edca
87c0c3b
02ed7d7
a5f1291
eff8a22
c31256a
45850d9
e46ef6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import functools | ||
| import os | ||
| import shutil | ||
|
|
||
|
|
||
| @functools.cache | ||
| def find_uv_bin() -> str | None: | ||
| """ | ||
| Check if the uv executable is available. | ||
|
|
||
| If the uv executable is available, return the path to the executable. | ||
| Otherwise, return None. | ||
| """ | ||
| try: | ||
| import uv | ||
|
|
||
| return uv.find_uv_bin() | ||
| except (ModuleNotFoundError, FileNotFoundError): | ||
| return shutil.which("uv") | ||
|
|
||
| return None | ||
|
|
||
|
|
||
| def should_use_uv() -> bool: | ||
| # UV environ is set to the uv executable path when the script is called with the uv executable. | ||
| uv_environ = os.environ.get("UV") | ||
| # double check by comparing the uv executable path with the one found by the uv package. | ||
| return uv_environ and uv_environ == find_uv_bin() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,9 @@ test = [ | |
| "pytest-cov", | ||
| "types-requests", | ||
| ] | ||
| uv = [ | ||
| "build[uv]~=1.2.0", | ||
| ] | ||
|
Comment on lines
+66
to
+68
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Side note; I remember that
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't remember this. Could you please elaborate? Note that
No, I don't think vendoring is a good idea for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| [tool.hatch.version] | ||
| source = "vcs" | ||
|
|
||
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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.