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 pip install does not install any new dependencies #1651

Closed
skshetry opened this issue Feb 18, 2024 · 7 comments · Fixed by #2169
Closed

uv pip install does not install any new dependencies #1651

skshetry opened this issue Feb 18, 2024 · 7 comments · Fixed by #2169
Assignees
Labels
bug Something isn't working

Comments

@skshetry
Copy link
Contributor

skshetry commented Feb 18, 2024

Let's say I have a project with the following dependencies, and installed the package using:

cat pyproject.toml
uv pip install -e "."
# pyproject.toml

[project]
name = "test-project"
version = "0.0.1"
dependencies = ["fsspec"]

And, later if I add any new dependencies, doing uv pip install -e "." does not pick new dependencies and/or install them, unless I pass --upgrade.

[project]
name = "test-project"
version = "0.0.1"
dependencies = ["fsspec", "s3fs"]
$ uv pip install -e "."
Audited 1 package in 3ms
$ uv pip install -e "." --upgrade
   Built file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.tP1hZ9RVUH                                                Built 1 editable in 1.00s
Resolved 18 packages in 685ms
Downloaded 5 packages in 142ms
Installed 17 packages in 79ms
 + aiobotocore==2.11.2
 + aiohttp==3.9.3
 + aioitertools==0.11.0
 + aiosignal==1.3.1
 + attrs==23.2.0
 + botocore==1.34.34
 + frozenlist==1.4.1
 + idna==3.6
 + jmespath==1.0.1
 + multidict==6.0.5
 + python-dateutil==2.8.2
 + s3fs==2024.2.0
 + six==1.16.0
 - test-project==0.0.1 (from file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.tP1hZ9RVUH)
 + test-project==0.0.1 (from file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.tP1hZ9RVUH)
 + urllib3==2.0.7
 + wrapt==1.16.0
 + yarl==1.9.4

This differs from pip install behaviour.

uv version

uv --version
uv 0.1.4
@charliermarsh charliermarsh added the bug Something isn't working label Feb 18, 2024
@charliermarsh
Copy link
Member

Agree that this should behave as you describe. I can't remember off-hand if this is due to a caching thing or something else.

@agriyakhetarpal
Copy link

agriyakhetarpal commented Feb 18, 2024

I am currently facing the same issue, but in other ways. It seems as if uv is auditing the installation of a package based on the metadata stored in the <mypackage>.dist-info directory – which is why if I delete the <mypackage> directory from a virtual environment, it successfully audits based on the metadata directory's contents and believes that <mypackage> is still installed. Of course, this isn't recommended behaviour (deleting a package's installation from the virtual environment, that is) and this problem is in-line with what pip itself does (I should probably open an issue there as well).

A potential solution to mitigate this problem could be to store the checksums of the pyproject.toml/setup.py/setup.cfg files in the uv cache and validate them at the time of the audit.

@danielhollas
Copy link

I think this is fixed in version 0.1.11

@skshetry

This comment was marked as resolved.

@skshetry
Copy link
Contributor Author

The editable issue seems to be fixed, but it does not work for non-editable installs yet. :(

@charliermarsh
Copy link
Member

@skshetry - Can you provide the exact repro for non-editable installs, just so I can track what isn't working?

@skshetry
Copy link
Contributor Author

cat pyproject.toml
uv pip install "test-project @ ."
[project]
name = "test-project"
version = "0.0.1"
dependencies = ["fsspec"]

After I add a dependency, say, s3fs, and run the above script again, it does not install new dependencies unless I add --upgrade.

cat pyproject.toml
uv pip install "test-project @ ."
[project]
name = "test-project"
version = "0.0.1"
dependencies = ["fsspec", "s3fs"]
$ uv pip install "test-project @ ."
Audited 1 package in 3ms

$ uv pip install "test-project @ ." --upgrade                                                                                    
Resolved 18 packages in 1.80s
   Built test-project @ file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.MLCVX8rwMP                                 Downloaded 1 package in 1.15s
Installed 17 packages in 66ms
 + aiobotocore==2.11.2
 + aiohttp==3.9.3
 + aioitertools==0.11.0
 + aiosignal==1.3.1
 + attrs==23.2.0
 + botocore==1.34.34
 + frozenlist==1.4.1
 + idna==3.6
 + jmespath==1.0.1
 + multidict==6.0.5
 + python-dateutil==2.8.2
 + s3fs==2024.2.0
 + six==1.16.0
 - test-project==0.0.1 (from file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.MLCVX8rwMP)
 + test-project==0.0.1 (from file:///private/var/folders/xh/trg29z296h70n109kwfk6g800000gn/T/tmp.MLCVX8rwMP)
 + urllib3==2.0.7
 + wrapt==1.16.0
 + yarl==1.9.4

@charliermarsh charliermarsh self-assigned this Mar 4, 2024
charliermarsh added a commit that referenced this issue Mar 4, 2024
## Summary

Ensures that local dependencies function similarly to editables, in that
if they're `uv pip install`ed, we invalidate them.

Closes #1651.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants