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

Avoid 403 error hint for PyTorch URLs #9750

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/uv-resolver/src/pubgrub/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
Expand Down
2 changes: 0 additions & 2 deletions crates/uv/tests/it/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14017,8 +14017,6 @@ fn lock_default_index() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
╰─▶ Because iniconfig was not found in the package registry and your project depends on iniconfig, we can conclude that your project's requirements are unsatisfiable.

hint: An index URL (https://download.pytorch.org/whl/cu121) could not be queried due to a lack of valid authentication credentials (403 Forbidden).
"###);

let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap();
Expand Down
2 changes: 0 additions & 2 deletions crates/uv/tests/it/pip_compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6703,8 +6703,6 @@ fn index_url_in_requirements() -> Result<()> {
----- stderr -----
× No solution found when resolving dependencies:
╰─▶ Because anyio was not found in the package registry and you require anyio<4, we can conclude that your requirements are unsatisfiable.

hint: An index URL (https://download.pytorch.org/whl) could not be queried due to a lack of valid authentication credentials (403 Forbidden).
"###
);

Expand Down
Loading