diff --git a/crates/uv/src/commands/diagnostics.rs b/crates/uv/src/commands/diagnostics.rs index df5e1eb09..65ead8312 100644 --- a/crates/uv/src/commands/diagnostics.rs +++ b/crates/uv/src/commands/diagnostics.rs @@ -79,6 +79,10 @@ impl OperationDiagnostic { download_and_build(dist, Box::new(err)); None } + pip::operations::Error::Resolve(uv_resolver::ResolveError::Download(dist, err)) => { + download(dist, Box::new(err)); + None + } pip::operations::Error::Resolve(uv_resolver::ResolveError::Build(dist, err)) => { build(dist, Box::new(err)); None @@ -90,11 +94,11 @@ impl OperationDiagnostic { download_and_build(dist, Box::new(err)); None } - pip::operations::Error::Requirements(uv_requirements::Error::Build(dist, err)) => { - build(dist, Box::new(err)); + pip::operations::Error::Requirements(uv_requirements::Error::Download(dist, err)) => { + download(dist, Box::new(err)); None } - pip::operations::Error::Prepare(uv_installer::PrepareError::Build(dist, err)) => { + pip::operations::Error::Requirements(uv_requirements::Error::Build(dist, err)) => { build(dist, Box::new(err)); None } @@ -109,6 +113,10 @@ impl OperationDiagnostic { download(dist, Box::new(err)); None } + pip::operations::Error::Prepare(uv_installer::PrepareError::Build(dist, err)) => { + build(dist, Box::new(err)); + None + } pip::operations::Error::Requirements(err) => { if let Some(context) = self.context { let err = miette::Report::msg(format!("{err}")) diff --git a/crates/uv/tests/it/pip_compile.rs b/crates/uv/tests/it/pip_compile.rs index d625b4760..dbbd09119 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -5911,12 +5911,12 @@ fn offline_direct_url() -> Result<()> { .arg("requirements.in") .arg("--offline"), @r###" success: false - exit_code: 2 + exit_code: 1 ----- stdout ----- ----- stderr ----- - error: Failed to download `iniconfig @ https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl` - Caused by: Network connectivity is disabled, but the requested data wasn't found in the cache for: `https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl` + × Failed to download `iniconfig @ https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl` + ╰─▶ Network connectivity is disabled, but the requested data wasn't found in the cache for: `https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl` "### ); @@ -9957,13 +9957,13 @@ fn not_found_direct_url() -> Result<()> { uv_snapshot!(context.filters(), context.pip_compile() .arg("requirements.in"), @r###" success: false - exit_code: 2 + exit_code: 1 ----- stdout ----- ----- stderr ----- - error: Failed to download `iniconfig @ https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl` - Caused by: Failed to fetch: `https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl` - Caused by: HTTP status client error (404 Not Found) for url (https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl) + × Failed to download `iniconfig @ https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl` + ├─▶ Failed to fetch: `https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl` + ╰─▶ HTTP status client error (404 Not Found) for url (https://files.pythonhosted.org/packages/ef/a6/fake/iniconfig-2.0.0-py3-none-any.whl) "### );