diff --git a/crates/uv-installer/src/installer.rs b/crates/uv-installer/src/installer.rs index 9feaeb013..22ad265e5 100644 --- a/crates/uv-installer/src/installer.rs +++ b/crates/uv-installer/src/installer.rs @@ -9,6 +9,7 @@ pub struct Installer<'a> { venv: &'a PythonEnvironment, link_mode: install_wheel_rs::linker::LinkMode, reporter: Option>, + installer_name: Option, } impl<'a> Installer<'a> { @@ -18,6 +19,7 @@ impl<'a> Installer<'a> { venv, link_mode: install_wheel_rs::linker::LinkMode::default(), reporter: None, + installer_name: Some("uv".to_string()), } } @@ -36,6 +38,15 @@ impl<'a> Installer<'a> { } } + /// Set the `installer_name` to something other than `"uv"`. + #[must_use] + pub fn with_installer_name(self, installer_name: Option) -> Self { + Self { + installer_name, + ..self + } + } + /// Install a set of wheels into a Python virtual environment. #[instrument(skip_all, fields(num_wheels = %wheels.len()))] pub fn install(self, wheels: &[CachedDist]) -> Result<()> { @@ -52,7 +63,7 @@ impl<'a> Installer<'a> { .map(pypi_types::DirectUrl::try_from) .transpose()? .as_ref(), - Some("uv"), + self.installer_name.as_deref(), self.link_mode, ) .with_context(|| format!("Failed to install: {} ({wheel})", wheel.filename()))?;