Skip to content
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

uv run changes uv.lock files #10845

Open
jaapz opened this issue Jan 22, 2025 · 2 comments
Open

uv run changes uv.lock files #10845

jaapz opened this issue Jan 22, 2025 · 2 comments
Labels
needs-mre Needs more information for reproduction

Comments

@jaapz
Copy link

jaapz commented Jan 22, 2025

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.

@konstin
Copy link
Member

konstin commented Jan 22, 2025

Can you share a minimal reproducible example, following #9452, as well as python version, your platform and your uv version?

@konstin konstin added the needs-mre Needs more information for reproduction label Jan 22, 2025
@charliermarsh
Copy link
Member

Your problem in this case is that you’re using an inconsistent uv version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-mre Needs more information for reproduction
Projects
None yet
Development

No branches or pull requests

3 participants