Skip to content

Add --find-links support for uv pip list#16103

Merged
charliermarsh merged 17 commits into
astral-sh:mainfrom
terror:pip-list-outdated
Jun 6, 2026
Merged

Add --find-links support for uv pip list#16103
charliermarsh merged 17 commits into
astral-sh:mainfrom
terror:pip-list-outdated

Conversation

@terror

@terror terror commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

Resolves #16095

This PR fixes uv pip list --outdated so --find-links locations impact the latest-version lookup. This wires flat indexes through the registry client even under --no-index, lets LatestClient::find_latest evaluate the same compatibility filters across both Simple API and flat metadata, and adds an integration test that installs from scripts/links to show the higher local release is reported.

Comment thread 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why these changed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason why we did not want to include flat_indexes here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread crates/uv-client/src/registry_client.rs Outdated
}

if results.is_empty() {
if self.index_urls.simple_indexes_disabled() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a tad awkward, but this is here to keep the wording the same for the already_installed_local_path_dependent test.

@terror terror marked this pull request as ready for review October 3, 2025 16:02
@zanieb zanieb requested a review from charliermarsh October 8, 2025 13:46
Comment thread crates/uv/src/commands/pip/latest.rs Outdated
Comment thread crates/uv/tests/it/pip_list.rs Outdated
Comment thread crates/uv-client/src/flat_index.rs
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct IndexUrls {
indexes: Vec<Index>,
flat_indexes: Vec<Index>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not aware of any

charliermarsh pushed a commit that referenced this pull request Oct 27, 2025
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.
@charliermarsh

Copy link
Copy Markdown
Member

It's actually a bit hard for me to reason about how --find-links works now, because we create the FlatIndexClient and pass that around, but we're now also passing the flat_indexes to the registry client... Are they now being indexed twice?

@astral-sh-bot

astral-sh-bot Bot commented Jun 6, 2026

Copy link
Copy Markdown

uv test inventory changes

This PR changes the tests when compared with the latest main baseline.

  • Added tests: 6
  • Removed tests: 0
  • Changed suites: 2
uv-client: +4 / -0

Added:

  • uv-client::registry_client::tests::no_index_disables_explicit_flat_index
  • uv-client::registry_client::tests::no_index_disables_explicit_simple_index
  • uv-client::registry_client::tests::no_index_disables_torch_simple_index
  • uv-client::registry_client::tests::simple_detail_does_not_fetch_legacy_find_links

Removed: none

uv::it: +2 / -0

Added:

  • uv::it::pip_install::find_links_multiple
  • uv::it::pip_list::list_outdated_find_links

Removed: none

@charliermarsh charliermarsh enabled auto-merge (squash) June 6, 2026 11:31
@charliermarsh charliermarsh merged commit fd8fcd5 into astral-sh:main Jun 6, 2026
108 of 110 checks passed
@konstin konstin added the enhancement New feature or improvement to existing functionality label Jun 10, 2026
konstin added a commit that referenced this pull request Jun 10, 2026
Released on 2026-06-10.

### Enhancements

- Add `--emit-index-url` and `--emit-find-links` to `uv export`
([#18370](#18370))
- Add `--find-links` support for `uv pip list`
([#16103](#16103))
- Group executable install errors during `uv python install`
([#19691](#19691))
- Use ICF in macOS release builds to reduce binary sizes
([#19615](#19615))

### Preview features

- Add initial hidden `uv upgrade` command
([#19678](#19678))
- Reject Git revisions in `uv upgrade`
([#19742](#19742))

### Configuration

- Recognize `UV_NO_INSTALL_PROJECT`, `UV_NO_INSTALL_WORKSPACE`,
`UV_NO_INSTALL_LOCAL`
([#19323](#19323))

### Performance

- Speed up discovery of large workspaces
([#18311](#18311))

### Bug fixes

- Allow unknown preview flags with a warning again
([#19669](#19669))
- Apply dependency exclusions to direct requirements
([#19699](#19699))
- Avoid following external symlinks during cache clean
([#19682](#19682))
- Avoid following symlinks during cache prune
([#19543](#19543))
- Fix Git cache keys for worktrees and packed refs
([#19706](#19706))
- Make resolver error handling iterative to avoid stack overflows
([#19695](#19695))
- Pass `VIRTUAL_ENV` through `cygpath` inside `fish` on Windows
([#19703](#19703))
- Rebuild explicit local directory tool installs
([#19591](#19591))
- Validate egg top-level entries as identifiers
([#19679](#19679))

### Documentation

- Document `--find-links` caching behavior
([#19585](#19585))
- Add a small section for malware checks
([#19680](#19680))
blake-hamm added a commit to blake-hamm/bhamm-lab that referenced this pull request Jun 10, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ghcr.io/astral-sh/uv](https://github.com/astral-sh/uv) | stage | patch | `0.11.19` → `0.11.20` |

---

### Release Notes

<details>
<summary>astral-sh/uv (ghcr.io/astral-sh/uv)</summary>

### [`v0.11.20`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#01120)

Released on 2026-06-10.

##### Enhancements

- Add `--emit-index-url` and `--emit-find-links` to `uv export` ([#&#8203;18370](astral-sh/uv#18370))
- Add `--find-links` support for `uv pip list` ([#&#8203;16103](astral-sh/uv#16103))
- Group executable install errors during `uv python install` ([#&#8203;19691](astral-sh/uv#19691))
- Use ICF in macOS release builds to reduce binary sizes ([#&#8203;19615](astral-sh/uv#19615))

##### Preview features

- Add initial hidden `uv upgrade` command ([#&#8203;19678](astral-sh/uv#19678))
- Reject Git revisions in `uv upgrade` ([#&#8203;19742](astral-sh/uv#19742))

##### Configuration

- Recognize `UV_NO_INSTALL_PROJECT`, `UV_NO_INSTALL_WORKSPACE`, `UV_NO_INSTALL_LOCAL` ([#&#8203;19323](astral-sh/uv#19323))

##### Performance

- Speed up discovery of large workspaces ([#&#8203;18311](astral-sh/uv#18311))

##### Bug fixes

- Allow unknown preview flags with a warning again ([#&#8203;19669](astral-sh/uv#19669))
- Apply dependency exclusions to direct requirements ([#&#8203;19699](astral-sh/uv#19699))
- Avoid following external symlinks during cache clean ([#&#8203;19682](astral-sh/uv#19682))
- Avoid following symlinks during cache prune ([#&#8203;19543](astral-sh/uv#19543))
- Fix Git cache keys for worktrees and packed refs ([#&#8203;19706](astral-sh/uv#19706))
- Make resolver error handling iterative to avoid stack overflows ([#&#8203;19695](astral-sh/uv#19695))
- Pass `VIRTUAL_ENV` through `cygpath` inside `fish` on Windows ([#&#8203;19703](astral-sh/uv#19703))
- Rebuild explicit local directory tool installs ([#&#8203;19591](astral-sh/uv#19591))
- Validate egg top-level entries as identifiers ([#&#8203;19679](astral-sh/uv#19679))

##### Documentation

- Document `--find-links` caching behavior ([#&#8203;19585](astral-sh/uv#19585))
- Add a small section for malware checks ([#&#8203;19680](astral-sh/uv#19680))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIyMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: Renovate Bot <renovate@bhamm-lab.com>
Reviewed-on: https://codeberg.org/blake-hamm/bhamm-lab/pulls/186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv pip list --outdated does not use UV_FIND_LINKS

3 participants