Skip to content

Commit 0133bcc

Browse files
authored
(f)lock during uv run (#14153)
This is very similar to the locking added for `uv sync`, `uv add`, and `uv remove` in #13869. Improving our (f)locking in general is tracked in #13883.
1 parent 1dbe750 commit 0133bcc

File tree

1 file changed

+6
-0
lines changed
  • crates/uv/src/commands/project

1 file changed

+6
-0
lines changed

crates/uv/src/commands/project/run.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl
240240
.await?
241241
.into_environment()?;
242242

243+
let _lock = environment.lock().await?;
244+
243245
// Determine the lock mode.
244246
let mode = if frozen {
245247
LockMode::Frozen
@@ -382,6 +384,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl
382384
)
383385
});
384386

387+
let _lock = environment.lock().await?;
388+
385389
match update_environment(
386390
environment,
387391
spec,
@@ -694,6 +698,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl
694698
.map(|lock| (lock, project.workspace().install_path().to_owned()));
695699
}
696700
} else {
701+
let _lock = venv.lock().await?;
702+
697703
// Determine the lock mode.
698704
let mode = if frozen {
699705
LockMode::Frozen

0 commit comments

Comments
 (0)