-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add basic uv sync
and uv lock
commands
#3436
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
Conversation
14621c7
to
1b533d6
Compare
let link_mode = LinkMode::default(); | ||
let no_binary = NoBinary::default(); | ||
let no_build = NoBuild::default(); | ||
let setup_py = SetupPyStrategy::default(); |
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 could DRY this up but not sure if it's worth it.
|
||
/// Run a command. | ||
#[allow(clippy::unnecessary_wraps, clippy::too_many_arguments)] | ||
pub(crate) async fn run( |
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.
This is just the existing run.rs
, but moved into the workspace
module, and the resolve
and install
commands were pulled into standalone methods.
7a73411
to
5da8977
Compare
5da8977
to
f8e9aa7
Compare
Summary
These aren't intended for production use; instead, I'm just trying to frame out the overall data flows and code-sharing for these commands. We now have
uv sync
(sync the environment to match the lockfile, without refreshing or resolving) anduv lock
(generate the lockfile). Both require a virtual environment to exist (something we should change).uv sync
,uv run
, anduv lock
all share code for the underlying subroutines (resolution and installation), so the commands themselves are relatively small (~100 lines) and mostly consist of reading arguments and such.uv lock
anduv sync
don't actually really work yet, because we have no way to include the project itself in the lockfile (that's a TODO in the lockfile implementation).Closes #3432.