Add missing `Download` variants to diagnostics (#9101)

This commit is contained in:
Charlie Marsh 2024-11-13 17:36:54 -05:00 committed by GitHub
parent 415e3dcd24
commit 17181d9e59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 10 deletions

View File

@ -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}"))

View File

@ -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)
"###
);