-
Notifications
You must be signed in to change notification settings - Fork 891
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 installs wrong (cached) version when specifying a git+ dependency with hash #6974
Comments
I'm having a little trouble following, but can you try passing the |
Well, to summarize it: Adding uv pip install -U 'djangocms-blog @ git+https://github.com/fsbraun/djangocms-blog.git@6b5b5f0fd716a6a3df07c32ab1897aaa34a2e325'
Resolved 34 packages in 7.84s
Prepared 2 packages in 2.78s
Uninstalled 2 packages in 174ms
Installed 2 packages in 134ms
- django==5.0.8
+ django==5.0.9
- packaging==21.3
+ packaging==24.1 In a second try, the output looks as expected, but still the wrong version is being installed. uv pip install --upgrade 'djangocms-blog @ git+https://github.com/fsbraun/djangocms-blog.git@6b5b5f0fd716a6a3df07c32ab1897aaa34a2e325'
Resolved 34 packages in 1.40s
Prepared 1 package in 7ms
Installed 1 package in 4ms
+ djangocms-blog==2.0.0rc1 (from git+https://github.com/fsbraun/djangocms-blog.git@6b5b5f0fd716a6a3df07c32ab1897aaa34a2e325 |
This could be completely correct if the package is already installed at the correct version. I can't know without |
Do you mind providing a clear sequence of commands that demonstrate the behavior you're seeing from a clean state? (I.e., running |
(I would love to help and fix any issues here.) |
Not sure it's exactly the same issue, but it is related, so adding it here. Here is a simple pyproject.toml, on macOS:
an
Note that the computed is exactly as requested. More important: Removing line 7, I hope this is helpful. |
Thanks @maparent. Looks like a real bug but separate from the above; going to move into its own issue. |
Thanks, @charliermarsh. After cleaning the cache with Wehn reproducing the bug, I had deleted all other virtualenvs of this project, just in case. So for trying to reproduce this bug, one could first install an older version like uv pip install 'djangocms-blog @ git+https://github.com/fsbraun/djangocms-blog.git@29a799ea11dd9206bf88ff71ef61effd1692d9e6' Then verify the version by looking at Uninstalling the package should not be necessary, but like this you can be sure that uv or pip use the correct virtualenv: uv pip uninstall djangocms-blog or shell
Check that the package directory in the virtualenv is empty. The install the newer version: uv pip install 'djangocms-blog @ git+https://github.com/fsbraun/djangocms-blog.git@6b5b5f0fd716a6a3df07c32ab1897aaa34a2e325' Check if the mentioned file has changed and corresponds to the desired version. A colleague of mine could not reproduce the bug, and after cleaning the cache I cannot either. So I don’t know if it makes sense to chase this reason for bug or jut live with it that sometimes uv may not install the correct version. In many cases you might not even notice it. i only realized it because the error message didn’t match the code (content vs. contents). |
Ok, going to close out due to lack of reproduction, but let me know if you see it consistently! |
I use uv 0.4.3 with Python 3.11 on Manjaro Linux.
I need to install updated versions of a package from Github. I have a dependency in my
pyproject.toml
:uv writes the correct version hash to the requirement files:
Before I had other versions installed. As it is a package in development where the author fixes a bug, the version number defined in the source doesn’t change in every commit, but the hash does for sure. E. g. the one before is
29a799ea11dd9206bf88ff71ef61effd1692d9e6
.As I noticed from an error message, the newest version was not installed with
uv pip install -r dev-requirements.txt
, as the message refers to content in line 64, which still mentionedcontent
instead ofcontents
.I also tried to uninstall and reinstall the package:
After
uv pip uninstall djangocms-blog
orpip uninstall djangocms-blog
the corresponding directory is deleted, souv
apparently installs an old cached version.With
pip
I get the correct version.There are other version mismatch issues, which seem to me similar, but not the same, so I wanted to tell about this specific problem encounter.
The text was updated successfully, but these errors were encountered: