You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to rebuild the project whenever the commit hash changes.
However, many dynamic versioning plugins use Git tags (as well as the commit hashes) to generate version numbers. It would be nice if uv could be extended to check for new Git tags as well as changes to the commit hash.
Now it is retrieving the Git commit hash. And if we make some changes and a new commit, uv sync will automatically detect this change in the commit hash
But let's say we now go and tag the initial commit. This should lead to an updated version number based off of this new tag info. But currently, uv sync does not detect this because it only looks for a change in the commit hash.
$ git tag v1.0.0 b54fcd8
$ uv sync
Resolved 1 package in 1ms
Audited 1 package in 0.39ms
Note that if I now checkout the initial commit it will update the version number correctly without the need for --reinstall because it has detected a change in the commit hash.
To conclude, everything currently works as stated in the docs. Just it would be nice if the Git cache keys experience could somehow be made seamless by integrating Git tags as well.
$ uv --version
uv 0.4.19 (a451fb685 2024-10-07)
The text was updated successfully, but these errors were encountered:
For projects with dynamic metadata, you can set
to rebuild the project whenever the commit hash changes.
However, many dynamic versioning plugins use Git tags (as well as the commit hashes) to generate version numbers. It would be nice if uv could be extended to check for new Git tags as well as changes to the commit hash.
Related: #7866
MRE
Set up a simple dynamic version library
Edit the
pyproject.toml
to use a dynamic version, the hatch vcs plugin and uvgit=true
cache-keys
.Run
uv sync
All good so far - there isn't any Git commit history.
Make a commit and sync again.
Now it is retrieving the Git commit hash. And if we make some changes and a new commit,
uv sync
will automatically detect this change in the commit hashBut let's say we now go and tag the initial commit. This should lead to an updated version number based off of this new tag info. But currently,
uv sync
does not detect this because it only looks for a change in the commit hash.But if we
--reinstall
we get the desired outcome.Note that if I now checkout the initial commit it will update the version number correctly without the need for
--reinstall
because it has detected a change in the commit hash.To conclude, everything currently works as stated in the docs. Just it would be nice if the Git cache keys experience could somehow be made seamless by integrating Git tags as well.
The text was updated successfully, but these errors were encountered: