diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index 3d5d5e2f5664d..3b86ccfcbe94f 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -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(), }); diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index f0956f851ed4e..5629ef9ca5ed5 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -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(); diff --git a/crates/uv/tests/it/pip_compile.rs b/crates/uv/tests/it/pip_compile.rs index a132e7a48768e..7cefebdc76d93 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -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). "### );