Skip to content

Filter mixed sources from --find-links entries in lockfile - #6025

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/mixed-links
Aug 12, 2024
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/mixed-links

Conversation

@charliermarsh

Copy link
Copy Markdown
Member

Summary

Our current handling of --find-links merges the entries in each index. As a result, we can end up with AnnotatedDist entries that reference distributions across indexes.

I'd like to change --find-links such that each --find-links entry is just treated as its own index (so, e.g., if requests exists in the first --find-links entry, we don't even check the registry by default), which would also fix this problem automatically. But that's a behavior change... So for now, in the lockfile, we filter distributions that don't match the source index URL.

There are two cases to consider:

  • There's a source distribution. Then, for the ID to reference the --find-links registry, the source distribution must have come from the --find-links entry, so it's fine to discard any wheels from the "wrong" registry without breaking any compatibility guarantees.
  • There's no source distribution. Then the best wheel must come from the --find-links registry. We might lose some platform coverage by discarding the other wheels, but it shouldn't break any of the "guarantees", since we have at least one wheel that fits in the version range.

Closes #6015.

@charliermarsh charliermarsh added bug Something isn't working preview Experimental behavior area:lock Related to universal resolution and locking labels Aug 12, 2024

@BurntSushi BurntSushi left a comment

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.

Makes sense to me!

@charliermarsh
charliermarsh merged commit b911a10 into main Aug 12, 2024
@charliermarsh
charliermarsh deleted the charlie/mixed-links branch August 12, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:lock Related to universal resolution and locking bug Something isn't working preview Experimental behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv lock mixes registry results with --find-links over HTTP

2 participants