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

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

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

charliermarsh
Copy link
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 lock Related to universal resolution and locking labels Aug 12, 2024
Copy link
Member

@BurntSushi BurntSushi left a comment

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
57 checks passed
@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
bug Something isn't working lock Related to universal resolution and locking 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