Add --find-links support for uv pip list#16103
Add --find-links support for uv pip list#16103terror wants to merge 12 commits intoastral-sh:mainfrom
--find-links support for uv pip list#16103Conversation
crates/uv/tests/it/pip_install.rs
Outdated
| ----- stderr ----- | ||
| × No solution found when resolving dependencies: | ||
| ╰─▶ Because first-local was not found in the provided package locations and second-local==0.1.0 depends on first-local, we can conclude that second-local==0.1.0 cannot be used. | ||
| ╰─▶ Because first-local was not found in the package registry and second-local==0.1.0 depends on first-local, we can conclude that second-local==0.1.0 cannot be used. |
There was a problem hiding this comment.
Do you know why these changed?
There was a problem hiding this comment.
This path used to short-circuit with ErrorKind::NoIndex, but now since we're considering flat indexes (via --find-links), we end up getting a UnavailablePackage::NotFound rendering as 'not found in the package registry' instead.
There was a problem hiding this comment.
I think this wording is actually a bit confusing, this is implying we did a registry lookup (even though we supplied --no-index) as opposed to just looking at the directories/URLs provided by --find-links. Something to address for sure.
| #[derive(Default, Debug, Clone, PartialEq, Eq)] | ||
| pub struct IndexUrls { | ||
| indexes: Vec<Index>, | ||
| flat_indexes: Vec<Index>, |
There was a problem hiding this comment.
Was there a reason why we did not want to include flat_indexes here?
There was a problem hiding this comment.
Unfortunately I really can't remember. I'm sure there's a reason for it. Probably because historically we didn't query flat indexes in the registry client? Something like that?
| } | ||
|
|
||
| if results.is_empty() { | ||
| if self.index_urls.simple_indexes_disabled() { |
There was a problem hiding this comment.
This is a tad awkward, but this is here to keep the wording the same for the already_installed_local_path_dependent test.
| #[derive(Default, Debug, Clone, PartialEq, Eq)] | ||
| pub struct IndexUrls { | ||
| indexes: Vec<Index>, | ||
| flat_indexes: Vec<Index>, |
Made to address this comment: #16103 (comment) This PR sorts the distributions collected by `FlatIndexClient::read_from_directory` (used for `--find-links`) so results are ordered deterministically by filename and index.
|
It's actually a bit hard for me to reason about how |
Resolves #16095
This PR fixes
uv pip list --outdatedso--find-linkslocations impact the latest-version lookup. This wires flat indexes through the registry client even under--no-index, letsLatestClient::find_latestevaluate the same compatibility filters across both Simple API and flat metadata, and adds an integration test that installs fromscripts/linksto show the higher local release is reported.