-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
When running a command through uv run, sometimes the uv.lock file gets changed. This is a bit annoying when the uv.lock file is in a git repository, as it introduces unrelated changes to the lock file to merge requests or commits (or you have to undo the change or explicitly not commit it...).
I know about the --frozen argument, which helps (although it might do with a shortcut argument).
However doesn't it make more sense for uv run not to modify any files unless explicitly allowed, instead of the other way around? For example to instruct uv to change dependencies in the lockfile, you need to explicitly tell uv to do so. But uv run just changes files as a side-effect of whatever command you actually want to run.
The changes done by uv run also always seem quite insignificant, and do not seem to change how the lockfile seems to be interpreted.
As an example, when I run uv run in my ansible playbooks repository it now changes the uv.lock file with the following diff:
diff --git a/playbooks/uv.lock b/playbooks/uv.lock
index c138ac2dd4..74438e6462 100644
--- a/playbooks/uv.lock
+++ b/playbooks/uv.lock
@@ -92,7 +92,6 @@ wheels = [
[[package]]
name = "my-playbooks"
-version = "0.0.0"
source = { virtual = "." }
dependencies = [
{ name = "ansible" },
So now every time I run a playbook, the uv.lock changes and my repository is dirty.