diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 8a510fa8c..ee3caeafa 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -240,6 +240,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl .await? .into_environment()?; + let _lock = environment.lock().await?; + // Determine the lock mode. let mode = if frozen { LockMode::Frozen @@ -382,6 +384,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl ) }); + let _lock = environment.lock().await?; + match update_environment( environment, spec, @@ -694,6 +698,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl .map(|lock| (lock, project.workspace().install_path().to_owned())); } } else { + let _lock = venv.lock().await?; + // Determine the lock mode. let mode = if frozen { LockMode::Frozen