build: switch back to unsafe-best-match for easy torch install#674
Merged
gsprochette merged 1 commit intoJun 9, 2026
Merged
Conversation
begumcig
reviewed
Jun 8, 2026
begumcig
left a comment
Member
There was a problem hiding this comment.
I thought the reason we switched to first-index was to prioritize PyPI when installing packages. With unsafe-best-match, we were searching the entire PythonAnywhere index, which was causing issues.
Now, my understanding is that explicit = true already prevents uv from looking at those custom indexes unless a package is explicitly assigned to them. Also, first-index makes index lookup greedy, which is not necessarily what we want. Is that correct? If that's the case APPROVED
Collaborator
Author
|
This is exactly correct ! Here's a recap:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR re-introduces the "unsafe-best-match" index resolution strategy that was replaced by "first-index" in #613
The reason for this is that torch used to ship some packages on its index. With first-index, uv only see those outdated versions, the first-index, and doesn't look on pypi for newer versions, leading to an unresolvable environment.
The reason for moving away in the first place was to avoid pinging the pythonanywhere index on every public package. However, this was already accomplished by the line "explicit = true" in the same PR. With explicit=true, the python-anywhere index is only checked when explicitely stated, as in
stable-fast-pruna = { index = "pruna_internal", extra = "stable-fast-extraindex" }.With the change in this PR, we should be able to run
uv pip install -e .[dev] torch==2.12 torchvision --extra-index-url https://download.pytorch.org/whl/cu126(currently fails), without pinging the python-anywhere index on every package causing the HTTP errors.Related Issue
Fixes #(issue number)
Type of Change
Testing
running
uv pip install -e .[dev] torch==2.12 torchvision --extra-index-url https://download.pytorch.org/whl/cu126currently fails, but passes after this change.For full setup and testing instructions, see the Contributing Guide.
Checklist
Thanks for contributing to Pruna! We're excited to review your work.
New to contributing? Check out our Contributing Guide for everything you need to get started.