Skip to content

Avoid querying GitHub on repeated install invocations #12767

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

Merged
merged 1 commit into from
Apr 9, 2025
Merged

Conversation

charliermarsh
Copy link
Member

Summary

If you run cargo run pip install "pip-test-package @ git+https://github.com/pypa/pip-test-package@5547fa909e83df8bd743d3978d6667497983a4b7" repeatedly, then every time, we'll take the "GitHub fast path" every time, even if the package is already cached. This PR adds logic to skip the fast path if the reference looks like a commit that we've already checked out.

Closes #12760.

@charliermarsh charliermarsh added the performance Potential performance improvement label Apr 9, 2025
@charliermarsh charliermarsh requested review from zanieb and konstin April 9, 2025 01:34
@charliermarsh
Copy link
Member Author

I think there's a better fix here, which is: we move all this metadata querying into uv-git. So we have a method like fetch_metadata that looks like fetch, but is "allowed" to short-circuit by getting the metadata. It's much more involved, though.

@charliermarsh charliermarsh merged commit d99983a into main Apr 9, 2025
75 of 76 checks passed
@charliermarsh charliermarsh deleted the charlie/gh branch April 9, 2025 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Potential performance improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid GitHub queries for immutable references
1 participant