Avoid 403 error hint for PyTorch URLs (#9750)

## Summary

Closes https://github.com/astral-sh/uv/issues/9746.
This commit is contained in:
Charlie Marsh 2024-12-09 17:30:24 -05:00 committed by GitHub
parent 3992295e9a
commit 25045cb3e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -793,6 +793,12 @@ impl PubGrubReportFormatter<'_> {
});
}
if index_capabilities.forbidden(&index.url) {
// If the index is a PyTorch index (e.g., `https://download.pytorch.org/whl/cu118`),
// avoid noting the lack of credentials. PyTorch returns a 403 (Forbidden) status
// code for any package that does not exist.
if index.url.url().host_str() == Some("download.pytorch.org") {
continue;
}
hints.insert(PubGrubHint::ForbiddenIndex {
index: index.url.clone(),
});