Skip to content

Commit

Permalink
Rename fetch_and_build to download_and_build (#9042)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Nov 12, 2024
1 parent a147ed0 commit de9dc39
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions crates/uv/src/commands/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ static SUGGESTIONS: LazyLock<FxHashMap<PackageName, PackageName>> = LazyLock::ne
.collect()
});

/// Render a [`uv_resolver::ResolveError::DownloadAndBuild`] with a help message.
pub(crate) fn fetch_and_build(sdist: Box<SourceDist>, cause: uv_distribution::Error) {
/// Render a remote source distribution build failure with a help message.
pub(crate) fn download_and_build(sdist: Box<SourceDist>, cause: uv_distribution::Error) {
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
#[error("Failed to download and build `{sdist}`")]
#[diagnostic()]
Expand All @@ -48,7 +48,7 @@ pub(crate) fn fetch_and_build(sdist: Box<SourceDist>, cause: uv_distribution::Er
anstream::eprint!("{report:?}");
}

/// Render a [`uv_resolver::ResolveError::Build`] with a help message.
/// Render a local source distribution build failure with a help message.
pub(crate) fn build(sdist: Box<SourceDist>, cause: uv_distribution::Error) {
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
#[error("Failed to build `{sdist}`")]
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ pub(crate) async fn pip_compile(
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::DownloadAndBuild(dist, err))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::Build(dist, err))) => {
Expand All @@ -422,7 +422,7 @@ pub(crate) async fn pip_compile(
dist,
err,
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Requirements(uv_requirements::Error::Build(dist, err))) => {
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/pip/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ pub(crate) async fn pip_install(
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::DownloadAndBuild(dist, err))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::Build(dist, err))) => {
Expand All @@ -428,7 +428,7 @@ pub(crate) async fn pip_install(
dist,
err,
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Requirements(uv_requirements::Error::Build(dist, err))) => {
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/pip/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pub(crate) async fn pip_sync(
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::DownloadAndBuild(dist, err))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Resolve(uv_resolver::ResolveError::Build(dist, err))) => {
Expand All @@ -372,7 +372,7 @@ pub(crate) async fn pip_sync(
dist,
err,
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(operations::Error::Requirements(uv_requirements::Error::Build(dist, err))) => {
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/project/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ pub(crate) async fn add(
ProjectError::Operation(pip::operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
)) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
Ok(ExitStatus::Failure)
}
ProjectError::Operation(pip::operations::Error::Resolve(
Expand All @@ -694,7 +694,7 @@ pub(crate) async fn add(
ProjectError::Operation(pip::operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
)) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
Ok(ExitStatus::Failure)
}
ProjectError::Operation(pip::operations::Error::Requirements(
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/project/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub(crate) async fn export(
Err(ProjectError::Operation(pip::operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(pip::operations::Error::Resolve(
Expand All @@ -163,7 +163,7 @@ pub(crate) async fn export(
Err(ProjectError::Operation(pip::operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(pip::operations::Error::Requirements(
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/project/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub(crate) async fn lock(
Err(ProjectError::Operation(pip::operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
Ok(ExitStatus::Failure)
}
Err(ProjectError::Operation(pip::operations::Error::Resolve(
Expand All @@ -184,7 +184,7 @@ pub(crate) async fn lock(
Err(ProjectError::Operation(pip::operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
Ok(ExitStatus::Failure)
}
Err(ProjectError::Operation(pip::operations::Error::Requirements(
Expand Down
12 changes: 6 additions & 6 deletions crates/uv/src/commands/project/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Resolve(
Expand All @@ -320,7 +320,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Requirements(
Expand Down Expand Up @@ -649,7 +649,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Resolve(
Expand All @@ -661,7 +661,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Requirements(
Expand Down Expand Up @@ -864,7 +864,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Resolve(
Expand All @@ -876,7 +876,7 @@ pub(crate) async fn run(
Err(ProjectError::Operation(operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Requirements(
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/src/commands/project/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub(crate) async fn sync(
Err(ProjectError::Operation(operations::Error::Resolve(
uv_resolver::ResolveError::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Resolve(
Expand All @@ -175,7 +175,7 @@ pub(crate) async fn sync(
Err(ProjectError::Operation(operations::Error::Requirements(
uv_requirements::Error::DownloadAndBuild(dist, err),
))) => {
diagnostics::fetch_and_build(dist, err);
diagnostics::download_and_build(dist, err);
return Ok(ExitStatus::Failure);
}
Err(ProjectError::Operation(operations::Error::Requirements(
Expand Down

0 comments on commit de9dc39

Please sign in to comment.