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

Indicate the version of uv that was used to generate/update the uv.lock file in the file itself #11319

Open
sebn opened this issue Feb 7, 2025 · 1 comment · May be fixed by #11353
Open
Assignees
Labels
enhancement New feature or improvement to existing functionality

Comments

@sebn
Copy link

sebn commented Feb 7, 2025

Summary

When starting a project with uv version 0.5.28, the uv.lock file would include something like this:

[[uv]]
version = 0.5.28

The value would be updated everytime a different uv binary version is used to change the lockfile, be it a newer version:

[[uv]]
version = 0.5.29

Or an older one:

[[uv]]
version = 0.5.27

Example

This would make it possible or at least easier to:

  • Understand both for uv maintainers & uv users that some unexpected changes in the uv.lock file can be related to the version of the uv binary that was used & decide whether the change is legit or not.
  • Display a warning in the console about the current version being used not matching the one in the lock file (separate feature, built on top of this one)
  • Write a simple shell script in one's git repo that automatically install the uv version matching the one in their uv.lock file
@sebn sebn added the enhancement New feature or improvement to existing functionality label Feb 7, 2025
@sebn sebn changed the title Indicate the version of uv that was used to lock the dependencies in the lockfile itself Indicate the version of uv that was used to generate/update the uv.lock file in the file itself Feb 7, 2025
Aditya-PS-05 added a commit to Aditya-PS-05/uv that referenced this issue Feb 9, 2025
@Aditya-PS-05 Aditya-PS-05 linked a pull request Feb 9, 2025 that will close this issue
@charliermarsh
Copy link
Member

Hmm. I think this would be slightly problematic in that it would unnecessarily couple the lockfile to the uv version. For example, the lockfile would now be invalidated every time you update the uv version, despite the fact that the semantic contents may not change, and the lockfile itself is already versioned (and intended to be compatible with a wide range of uv versions).

I would suggest using required-version for this? It's intended for projects that want to enforce a specific uv version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants