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

Visit proxy packages eagerly #10441

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Visit proxy packages eagerly #10441

merged 1 commit into from
Jan 9, 2025

Conversation

charliermarsh
Copy link
Member

Summary

The issue here is that we add urllib3{python_full_version >= '3.8'} as a dependency, then requests{python_full_version >= '3.8'}, which adds urllib3, but at that point, we haven't expanded urllib3{python_full_version >= '3.8'}, so we "lose" the singleton constraint. The solution is to ensure that we visit proxies eagerly, so that we accumulate constraints as early as possible.

Closes #10425 (comment).

@charliermarsh charliermarsh requested a review from konstin January 9, 2025 18:44
@charliermarsh charliermarsh added the bug Something isn't working label Jan 9, 2025
@charliermarsh charliermarsh marked this pull request as ready for review January 9, 2025 18:44
@@ -80,6 +82,7 @@ impl PubGrubPriorities {
let priority = if urls.get(name).is_some() {
PubGrubPriority::DirectUrl(Reverse(next))
} else if version.as_singleton().is_some() {
// TODO(charlie): Take local version ranges into account (e.g., `[2.0, 2.0+[max])`).
Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix this separately, but this fix alone does not resolve the bug in the linked issue.

@charliermarsh
Copy link
Member Author

The error message changes seem... ok. The transformers ecosystem change is surprising.

@charliermarsh
Copy link
Member Author

Ok, think I fixed that regression.

@charliermarsh
Copy link
Member Author

I have a hunch that this will actually improve performance and lead to better resolutions.

@@ -224,6 +227,9 @@ pub(crate) enum PubGrubPriority {
/// [`ForkUrls`].
DirectUrl(Reverse<usize>),

/// The package is a proxy package.
Copy link
Member

Choose a reason for hiding this comment

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

Can you expand this by saying something like:

We process these first since each proxy package expands into two regular PubGrubPackage packages, which give us additional constraints, while not changing the priorities since the materialized packages are of the same package name.

It took me a while to get why this was safe to do.

@charliermarsh charliermarsh merged commit 56d39d2 into main Jan 9, 2025
64 checks passed
@charliermarsh charliermarsh deleted the charlie/prox branch January 9, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv pip install --require-hashes fails when (transitive) dependencies aren't pinned to latest version
3 participants