Draft
Conversation
e51729c to
e0ecb54
Compare
e0ecb54 to
f541be2
Compare
f541be2 to
edcec81
Compare
edcec81 to
5b9b3ff
Compare
5b9b3ff to
bf7c80d
Compare
bf7c80d to
32d020c
Compare
32d020c to
6c1ef6d
Compare
6c1ef6d to
0201222
Compare
0201222 to
645bcc7
Compare
645bcc7 to
ed58ad0
Compare
ed58ad0 to
bd9fe3d
Compare
|
Cool! would it be possible to call the executable FYI you can do things like this on Windows: It is something I miss when using mac |
|
Would be nice to run sync or at least have the option to run sync(with uv specific key in pyproject.toml). Could help teams maintain a consistent environment (especially if some users don't know as much about package management). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a minimal
uv-pythonbinary to our distributions, which usesuv python findto determine which Python executable to use then invokes it with all the arguments.Some notes:
uv-pythoninstead ofpythonso we don't replacepythonon thePATHwhen uv is installed.pythonduringuv python install. We'll probably want more ways to manage the shim?Interpreter::querycalls to avoid recursive queries once a shim is installed--shim/--no-shimflags touv python install. By default, we only install a shim if a CPython variant is installed and preview is enabled.Supports a few options, which can be used together:
uv-python +3.12 ....uv-python +managed ....uv-python +system ....uv-python +v ...Unlike
uvx, we usewhichto find the uv binary instead of only looking next to the file. This is because we need this to be copyable into the user's path. Unfortunately this makes it hard for us to guarantee that we are finding the correct version of uv if multiple are installed, but that seems like an edge-case. We could add some sort ofUV_REQUIRED_VERSIONvariable or something that tells the uv binary to bail if it's not the right version. We prefer a binary that we find next touv-pythonwhich could help alleviate this — I'll need to look at what happens with symlinks and such.An alternative implementation is something like
uvxwhere we add auv python runcommand and then create aliases to it. That route is powerful because we can have advanced behaviors and rely on other crates without increasing the size of our installation. However, the constraints of this approach may be a good thing.Unfortunately we need to invoke uv to find the Python interpreter to use and uv queries Python interpreters so this probably adds some significant overhead to a
pythoninvocation. I'll benchmark this before moving out of draft.