mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Rename to SourceDistributionBuilder
(#2750)
## Summary This is more consistent with `DistributionDatabase`. The order of the arguments is also now consistent between the two structs.
This commit is contained in:
parent
8596ff3470
commit
e68cdb1049
6 changed files with 19 additions and 19 deletions
|
@ -22,7 +22,7 @@ use uv_types::{BuildContext, NoBinary, NoBuild};
|
|||
use crate::download::{BuiltWheel, UnzippedWheel};
|
||||
use crate::git::resolve_precise;
|
||||
use crate::locks::Locks;
|
||||
use crate::{DiskWheel, Error, LocalWheel, Reporter, SourceDistCachedBuilder};
|
||||
use crate::{DiskWheel, Error, LocalWheel, Reporter, SourceDistributionBuilder};
|
||||
|
||||
/// A cached high-level interface to convert distributions (a requirement resolved to a location)
|
||||
/// to a wheel or wheel metadata.
|
||||
|
@ -39,7 +39,7 @@ use crate::{DiskWheel, Error, LocalWheel, Reporter, SourceDistCachedBuilder};
|
|||
pub struct DistributionDatabase<'a, Context: BuildContext + Send + Sync> {
|
||||
client: &'a RegistryClient,
|
||||
build_context: &'a Context,
|
||||
builder: SourceDistCachedBuilder<'a, Context>,
|
||||
builder: SourceDistributionBuilder<'a, Context>,
|
||||
locks: Arc<Locks>,
|
||||
reporter: Option<Arc<dyn Reporter>>,
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ impl<'a, Context: BuildContext + Send + Sync> DistributionDatabase<'a, Context>
|
|||
Self {
|
||||
client,
|
||||
build_context,
|
||||
builder: SourceDistCachedBuilder::new(build_context, client),
|
||||
builder: SourceDistributionBuilder::new(client, build_context),
|
||||
locks: Arc::new(Locks::default()),
|
||||
reporter: None,
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ pub use download::{BuiltWheel, DiskWheel, LocalWheel};
|
|||
pub use error::Error;
|
||||
pub use index::{BuiltWheelIndex, RegistryWheelIndex};
|
||||
pub use reporter::Reporter;
|
||||
pub use source::{download_and_extract_archive, SourceDistCachedBuilder};
|
||||
pub use source::{download_and_extract_archive, SourceDistributionBuilder};
|
||||
pub use unzip::Unzip;
|
||||
|
||||
mod distribution_database;
|
||||
|
|
|
@ -44,9 +44,9 @@ mod built_wheel_metadata;
|
|||
mod manifest;
|
||||
|
||||
/// Fetch and build a source distribution from a remote source, or from a local cache.
|
||||
pub struct SourceDistCachedBuilder<'a, T: BuildContext> {
|
||||
build_context: &'a T,
|
||||
pub struct SourceDistributionBuilder<'a, T: BuildContext> {
|
||||
client: &'a RegistryClient,
|
||||
build_context: &'a T,
|
||||
reporter: Option<Arc<dyn Reporter>>,
|
||||
}
|
||||
|
||||
|
@ -56,13 +56,13 @@ pub(crate) const MANIFEST: &str = "manifest.msgpack";
|
|||
/// The name of the file that contains the cached distribution metadata, encoded via `MsgPack`.
|
||||
pub(crate) const METADATA: &str = "metadata.msgpack";
|
||||
|
||||
impl<'a, T: BuildContext> SourceDistCachedBuilder<'a, T> {
|
||||
/// Initialize a [`SourceDistCachedBuilder`] from a [`BuildContext`].
|
||||
pub fn new(build_context: &'a T, client: &'a RegistryClient) -> Self {
|
||||
impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
||||
/// Initialize a [`SourceDistributionBuilder`] from a [`BuildContext`].
|
||||
pub fn new(client: &'a RegistryClient, build_context: &'a T) -> Self {
|
||||
Self {
|
||||
client,
|
||||
build_context,
|
||||
reporter: None,
|
||||
client,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue