-
Notifications
You must be signed in to change notification settings - Fork 648
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
fails for dependencies on already-installed local packages
#1661
Comments
Ah, sorry:
|
So, I think |
Ah, interesting, thanks for taking a look and sharing your thoughts! For context, if it's useful, the reason we incrementally |
OTOH maybe since Doing the same work with pip definitely incurs a performance penalty. |
I am curious, though- the venv seems like a pretty reasonable source of packages given that it holds strongly-versioned already-installed dependencies, and that's more or less its reason to exist. To my mind, it seems reasonable that |
I think it's probably correct for us to fix this. It just changes a lot of assumptions -- right now, we perform a resolution that's independent of the virtual environment. |
uv pip install
fails with PEP420 namespace package dependenciesuv pip install
fails when packages rely on installed, locally-derived packages
uv pip install
fails when packages rely on installed, locally-derived packagesuv pip install
fails for dependencies on already-installed, locally-derived packages
uv pip install
fails for dependencies on already-installed, locally-derived packagesuv pip install
fails for dependencies on already-installed local packages
Installing all the editable packages at once works for us. |
Yeah, the problem is that the second install doesn't "know" where to find the existing editable. We need to make the resolver aware of packages that already exist in the virtual environment. |
Possibly related (if not, I can file a separate issue—or none at all if this is a misunderstanding on my part), when I For the record, this is a large monorepo with dozens of modules. The commands complete really fast and therefore it's not a huge problem, just wondering if there is a way (or possibly a different work flow) to prevent this. |
@tylerw -- I think we try to avoid rebuilding with |
(I intend to fix this.) |
Previously, we did not consider installed distributions as candidates while performing resolution. Here, we update the resolver to use installed distributions that satisfy requirements instead of pulling new distributions from the registry. The implementation details are as follows: - We now provide `SitePackages` to the `CandidateSelector` - If an installed distribution satisfies the requirement, we prefer it over remote distributions - We do not want to allow installed distributions in some cases, i.e., upgrade and reinstall - We address this by introducing an `Exclusions` type which tracks installed packages to ignore during selection - There's a new `ResolvedDist` wrapper with `Installed(InstalledDist)` and `Installable(Dist)` variants - This lets us pass already installed distributions throughout the resolver The user-facing behavior is thoroughly covered in the tests, but briefly: - Installing a package that depends on an already-installed package prefers the local version over the index - Installing a package with a name that matches an already-installed URL package does not reinstall from the index - Reinstalling (--reinstall) a package by name _will_ pull from the index even if an already-installed URL package is present - To reinstall the URL package, you must specify the URL in the request Closes #1661 Addresses: - #1476 - #1856 - #2093 - #2282 - #2383 - #2560 ## Test plan - [x] Reproduction at `charlesnicholson/uv-pep420-bug` passes - [x] Unit test for editable package ([#1476](#1476)) - [x] Unit test for previously installed package with empty registry - [x] Unit test for local non-editable package - [x] Unit test for new version available locally but not in registry ([#2093](#2093)) - ~[ ] Unit test for wheel not available in registry but already installed locally ([#2282](#2282 (seems complicated and not worthwhile) - [x] Unit test for install from URL dependency then with matching version ([#2383](#2383)) - [x] Unit test for install of new package that depends on installed package does not change version ([#2560](#2560)) - [x] Unit test that `pip compile` does _not_ consider installed packages
So far it's great, thanks! (I'm integrating it as I type this :) ) |
When a package depends on an editable-installed namespaced package,
uv pip install
fails saying that the already-installed package can't be found. Possibly related to string hygiene and convertingns1.package1
tons1-package1
?Full cloneable repro case here: https://github.com/charlesnicholson/uv-pep420-bug/tree/main
(Runs at least on macOS and maybe Linux, let me know if it's insufficient and I'll fix it up)
The text was updated successfully, but these errors were encountered: