-
Notifications
You must be signed in to change notification settings - Fork 1.5k
dynamic version in editable install #6860
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
Comments
I was using dynamic dependencies and version with setup.py/setuptools-scm and had the same issue. Currently uv aggressively caches packages, and dynamic metadata are not considered to break the cache. So, as per the current documentation what you are seeing is expected behavior. You can set It did feel confusing to me when I saw it first too - and I feel like there will be many more such issues as users use uv more :) |
Agree that what you're seeing here (persisting the stale hash) is not quite right... |
Thanks a ton for the pointer. Same as you, I did not find this in the documentation. In my case I don't need and more specifically don't want re-installation given that I already have an editable install for a pure Python package. I just don't want an outdated package version in my lock file. Setting it to something like |
This is still somewhat unsolved |
Should this discussion be merged with #7533 ? |
Updating this after trying the same workflow on
|
@pmeier - On this point, are you using the latest improvements to
Git tag support recently got added. See
So I believe you should be able to trigger a re-build with just As for |
Thanks for the info @my1e5, but this is the opposite of what I want to do. Since the version of my app changes with every single commit and tag, but for most of the time no dependencies change, I'd like the Basically fresh development installs will always have to be done with |
Most of the discussion is happening in #7533 — let's track there to avoid splitting the conversation. |
PEP 621 allows for dynamic metadata in
pyproject.toml
. Tools likesetuptools-scm
make use of this feature by computing the version of the package at build time.Imagine I have a git repository with nothing but this
pyproject.toml
file that is committed.$ ls -lA total 8 drwxr-xr-x 8 pmeier pmeier 4096 Aug 30 11:40 .git -rw-r--r-- 1 pmeier pmeier 238 Aug 30 11:34 pyproject.toml $ git log --oneline 1105907 (HEAD -> main) initial commit
Running
uv sync
gives me the following block inuv.lock
We commit that and move on with development.
Re-running,
uv sync
results in no changes in the lock file or venv, although we haveRunning
uv sync --reinstall-package foo
installs the correct version into the venv (checked withuv pip show foo
), but again theuv.lock
file stays untouched. Even why I manually change the version in the lock file to0+dynamic
(uv
complains if the string doesn't start with a number),uv lock
does not change theuv.lock
file at all.IMO, in general this is good behavior given that it is impossible to lock the version of this editable package, since its version is computed dynamically. However, I'd prefer not have a quickly outdated version number "hardcoded" in the lock file.
Would it be possible to set the version to
"dynamic"
(or a different sentinel) if the package is an editable install and declares that the version is computed dynamically?The text was updated successfully, but these errors were encountered: