diff --git a/crates/uv-bench/benches/uv.rs b/crates/uv-bench/benches/uv.rs index 62cb646886ff..3fee93a73ce5 100644 --- a/crates/uv-bench/benches/uv.rs +++ b/crates/uv-bench/benches/uv.rs @@ -83,7 +83,6 @@ mod resolver { use anyhow::Result; - use install_wheel_rs::linker::LinkMode; use uv_cache::Cache; use uv_client::RegistryClient; use uv_configuration::{ @@ -93,6 +92,7 @@ mod resolver { use uv_distribution::DistributionDatabase; use uv_distribution_types::{DependencyMetadata, IndexCapabilities, IndexLocations}; use uv_git::GitResolver; + use uv_install_wheel::linker::LinkMode; use uv_pep440::Version; use uv_pep508::{MarkerEnvironment, MarkerEnvironmentBuilder}; use uv_platform_tags::{Arch, Os, Platform, Tags}; diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index a8216afb08ca..c9e92ded3157 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -2283,7 +2283,7 @@ pub struct VenvArgs { /// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and /// Windows. #[arg(long, value_enum, env = "UV_LINK_MODE")] - pub link_mode: Option, + pub link_mode: Option, #[command(flatten)] pub compat_args: compat::VenvCompatArgs, @@ -3925,7 +3925,7 @@ pub struct InstallerArgs { env = "UV_LINK_MODE", help_heading = "Installer options" )] - pub link_mode: Option, + pub link_mode: Option, /// Compile Python files to bytecode after installation. /// @@ -4123,7 +4123,7 @@ pub struct ResolverArgs { env = "UV_LINK_MODE", help_heading = "Installer options" )] - pub link_mode: Option, + pub link_mode: Option, /// Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the /// standards-compliant, publishable package metadata, as opposed to using any local or Git @@ -4313,7 +4313,7 @@ pub struct ResolverInstallerArgs { env = "UV_LINK_MODE", help_heading = "Installer options" )] - pub link_mode: Option, + pub link_mode: Option, /// Compile Python files to bytecode after installation. /// diff --git a/crates/uv-dispatch/src/lib.rs b/crates/uv-dispatch/src/lib.rs index 14bd93d5bdc6..69e894c0baf0 100644 --- a/crates/uv-dispatch/src/lib.rs +++ b/crates/uv-dispatch/src/lib.rs @@ -49,7 +49,7 @@ pub struct BuildDispatch<'a> { dependency_metadata: &'a DependencyMetadata, in_flight: &'a InFlight, build_isolation: BuildIsolation<'a>, - link_mode: install_wheel_rs::linker::LinkMode, + link_mode: uv_install_wheel::linker::LinkMode, build_options: &'a BuildOptions, config_settings: &'a ConfigSettings, hasher: &'a HashStrategy, @@ -76,7 +76,7 @@ impl<'a> BuildDispatch<'a> { index_strategy: IndexStrategy, config_settings: &'a ConfigSettings, build_isolation: BuildIsolation<'a>, - link_mode: install_wheel_rs::linker::LinkMode, + link_mode: uv_install_wheel::linker::LinkMode, build_options: &'a BuildOptions, hasher: &'a HashStrategy, exclude_newer: Option, diff --git a/crates/uv-install-wheel/Cargo.toml b/crates/uv-install-wheel/Cargo.toml index e0b8f2dacaf1..349a12b5326e 100644 --- a/crates/uv-install-wheel/Cargo.toml +++ b/crates/uv-install-wheel/Cargo.toml @@ -17,7 +17,7 @@ license = { workspace = true } workspace = true [lib] -name = "install_wheel_rs" +name = "uv_install_wheel" [dependencies] uv-cache-info = { workspace = true } diff --git a/crates/uv-installer/src/installer.rs b/crates/uv-installer/src/installer.rs index 89c7e93d6acf..1b059bb725f7 100644 --- a/crates/uv-installer/src/installer.rs +++ b/crates/uv-installer/src/installer.rs @@ -1,9 +1,9 @@ use anyhow::{Context, Error, Result}; -use install_wheel_rs::{linker::LinkMode, Layout}; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use std::convert; use tokio::sync::oneshot; use tracing::instrument; +use uv_install_wheel::{linker::LinkMode, Layout}; use uv_cache::Cache; use uv_distribution_types::CachedDist; @@ -29,7 +29,7 @@ impl<'a> Installer<'a> { } } - /// Set the [`LinkMode`][`install_wheel_rs::linker::LinkMode`] to use for this installer. + /// Set the [`LinkMode`][`uv_install_wheel::linker::LinkMode`] to use for this installer. #[must_use] pub fn with_link_mode(self, link_mode: LinkMode) -> Self { Self { link_mode, ..self } @@ -136,9 +136,9 @@ fn install( reporter: Option>, relocatable: bool, ) -> Result> { - let locks = install_wheel_rs::linker::Locks::default(); + let locks = uv_install_wheel::linker::Locks::default(); wheels.par_iter().try_for_each(|wheel| { - install_wheel_rs::linker::install_wheel( + uv_install_wheel::linker::install_wheel( &layout, relocatable, wheel.path(), diff --git a/crates/uv-installer/src/uninstall.rs b/crates/uv-installer/src/uninstall.rs index 9f54908c3308..9379cb43fbc7 100644 --- a/crates/uv-installer/src/uninstall.rs +++ b/crates/uv-installer/src/uninstall.rs @@ -3,16 +3,16 @@ use uv_distribution_types::{InstalledDist, InstalledEggInfoFile}; /// Uninstall a package from the specified Python environment. pub async fn uninstall( dist: &InstalledDist, -) -> Result { +) -> Result { let uninstall = tokio::task::spawn_blocking({ let dist = dist.clone(); move || match dist { InstalledDist::Registry(_) | InstalledDist::Url(_) => { - Ok(install_wheel_rs::uninstall_wheel(dist.path())?) + Ok(uv_install_wheel::uninstall_wheel(dist.path())?) } - InstalledDist::EggInfoDirectory(_) => Ok(install_wheel_rs::uninstall_egg(dist.path())?), + InstalledDist::EggInfoDirectory(_) => Ok(uv_install_wheel::uninstall_egg(dist.path())?), InstalledDist::LegacyEditable(dist) => { - Ok(install_wheel_rs::uninstall_legacy_editable(&dist.egg_link)?) + Ok(uv_install_wheel::uninstall_legacy_editable(&dist.egg_link)?) } InstalledDist::EggInfoFile(dist) => Err(UninstallError::Distutils(dist)), } @@ -27,7 +27,7 @@ pub enum UninstallError { #[error("Unable to uninstall `{0}`. distutils-installed distributions do not include the metadata required to uninstall safely.")] Distutils(InstalledEggInfoFile), #[error(transparent)] - Uninstall(#[from] install_wheel_rs::Error), + Uninstall(#[from] uv_install_wheel::Error), #[error(transparent)] Join(#[from] tokio::task::JoinError), } diff --git a/crates/uv-python/src/interpreter.rs b/crates/uv-python/src/interpreter.rs index 61dbd8bcd558..6ce6d87e3f41 100644 --- a/crates/uv-python/src/interpreter.rs +++ b/crates/uv-python/src/interpreter.rs @@ -11,11 +11,11 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use tracing::{trace, warn}; -use install_wheel_rs::Layout; use uv_cache::{Cache, CacheBucket, CachedByTimestamp, Freshness}; use uv_cache_info::Timestamp; use uv_cache_key::cache_digest; use uv_fs::{write_atomic_sync, PythonExt, Simplified}; +use uv_install_wheel::Layout; use uv_pep440::Version; use uv_pep508::{MarkerEnvironment, StringVersion}; use uv_platform_tags::Platform; diff --git a/crates/uv-settings/src/combine.rs b/crates/uv-settings/src/combine.rs index ece27d59cd48..f57675695db7 100644 --- a/crates/uv-settings/src/combine.rs +++ b/crates/uv-settings/src/combine.rs @@ -2,11 +2,11 @@ use std::num::NonZeroUsize; use std::path::PathBuf; use url::Url; -use install_wheel_rs::linker::LinkMode; use uv_configuration::{ ConfigSettings, IndexStrategy, KeyringProviderType, TargetTriple, TrustedPublishing, }; use uv_distribution_types::IndexUrl; +use uv_install_wheel::linker::LinkMode; use uv_pypi_types::SupportedEnvironments; use uv_python::{PythonDownloads, PythonPreference, PythonVersion}; use uv_resolver::{AnnotationStyle, ExcludeNewer, PrereleaseMode, ResolutionMode}; diff --git a/crates/uv-settings/src/settings.rs b/crates/uv-settings/src/settings.rs index 32f9a86454d7..1cea301a8af5 100644 --- a/crates/uv-settings/src/settings.rs +++ b/crates/uv-settings/src/settings.rs @@ -1,6 +1,5 @@ use std::{fmt::Debug, num::NonZeroUsize, path::PathBuf}; -use install_wheel_rs::linker::LinkMode; use serde::{Deserialize, Serialize}; use url::Url; use uv_cache_info::CacheKey; @@ -9,6 +8,7 @@ use uv_configuration::{ TrustedHost, TrustedPublishing, }; use uv_distribution_types::{FlatIndexLocation, IndexUrl, StaticMetadata}; +use uv_install_wheel::linker::LinkMode; use uv_macros::{CombineOptions, OptionsMetadata}; use uv_normalize::{ExtraName, PackageName}; use uv_pep508::Requirement; diff --git a/crates/uv-tool/src/lib.rs b/crates/uv-tool/src/lib.rs index 5059adb48169..647ace743d36 100644 --- a/crates/uv-tool/src/lib.rs +++ b/crates/uv-tool/src/lib.rs @@ -13,7 +13,7 @@ use fs_err::File; use thiserror::Error; use tracing::{debug, warn}; -use install_wheel_rs::read_record_file; +use uv_install_wheel::read_record_file; pub use receipt::ToolReceipt; pub use tool::{Tool, ToolEntrypoint}; @@ -37,7 +37,7 @@ pub enum Error { #[error(transparent)] VirtualEnvError(#[from] uv_virtualenv::Error), #[error("Failed to read package entry points {0}")] - EntrypointRead(#[from] install_wheel_rs::Error), + EntrypointRead(#[from] uv_install_wheel::Error), #[error("Failed to find dist-info directory `{0}` in environment at {1}")] DistInfoMissing(String, PathBuf), #[error("Failed to find a directory for executables")] diff --git a/crates/uv/src/commands/build.rs b/crates/uv/src/commands/build.rs index e0602b1e200b..8f2036b24925 100644 --- a/crates/uv/src/commands/build.rs +++ b/crates/uv/src/commands/build.rs @@ -5,10 +5,10 @@ use std::io::Write as _; use std::path::{Path, PathBuf}; use anyhow::Result; -use install_wheel_rs::linker::LinkMode; use owo_colors::OwoColorize; use uv_distribution_filename::SourceDistExtension; use uv_distribution_types::{DependencyMetadata, IndexLocations}; +use uv_install_wheel::linker::LinkMode; use uv_auth::store_credentials_from_url; use uv_cache::Cache; diff --git a/crates/uv/src/commands/pip/compile.rs b/crates/uv/src/commands/pip/compile.rs index 00bc2f52273d..cbeaa2311184 100644 --- a/crates/uv/src/commands/pip/compile.rs +++ b/crates/uv/src/commands/pip/compile.rs @@ -6,7 +6,6 @@ use itertools::Itertools; use owo_colors::OwoColorize; use tracing::debug; -use install_wheel_rs::linker::LinkMode; use uv_auth::store_credentials_from_url; use uv_cache::Cache; use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder}; @@ -22,6 +21,7 @@ use uv_distribution_types::{ }; use uv_fs::Simplified; use uv_git::GitResolver; +use uv_install_wheel::linker::LinkMode; use uv_normalize::PackageName; use uv_pypi_types::{Requirement, SupportedEnvironments}; use uv_python::{ diff --git a/crates/uv/src/commands/pip/install.rs b/crates/uv/src/commands/pip/install.rs index d5a7eba8333a..b939df6d82a6 100644 --- a/crates/uv/src/commands/pip/install.rs +++ b/crates/uv/src/commands/pip/install.rs @@ -4,7 +4,6 @@ use itertools::Itertools; use owo_colors::OwoColorize; use tracing::{debug, enabled, Level}; -use install_wheel_rs::linker::LinkMode; use uv_auth::store_credentials_from_url; use uv_cache::Cache; use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder}; @@ -19,6 +18,7 @@ use uv_distribution_types::{ UnresolvedRequirementSpecification, }; use uv_fs::Simplified; +use uv_install_wheel::linker::LinkMode; use uv_installer::{SatisfiesResult, SitePackages}; use uv_pep508::PackageName; use uv_pypi_types::Requirement; diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index d3a4213e93a1..8ff32ad0d51b 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -8,7 +8,6 @@ use std::fmt::Write; use std::path::PathBuf; use tracing::debug; -use install_wheel_rs::linker::LinkMode; use uv_cache::Cache; use uv_client::{BaseClientBuilder, RegistryClient}; use uv_configuration::{ @@ -25,6 +24,7 @@ use uv_distribution_types::{ DistributionMetadata, IndexLocations, InstalledMetadata, Name, Resolution, }; use uv_fs::Simplified; +use uv_install_wheel::linker::LinkMode; use uv_installer::{Plan, Planner, Preparer, SitePackages}; use uv_normalize::{GroupName, PackageName}; use uv_platform_tags::Tags; @@ -487,7 +487,7 @@ pub(crate) async fn install( ); } Err(uv_installer::UninstallError::Uninstall( - install_wheel_rs::Error::MissingRecord(_), + uv_install_wheel::Error::MissingRecord(_), )) => { warn_user!( "Failed to uninstall package at {} due to missing `RECORD` file. Installation may result in an incomplete environment.", @@ -495,7 +495,7 @@ pub(crate) async fn install( ); } Err(uv_installer::UninstallError::Uninstall( - install_wheel_rs::Error::MissingTopLevel(_), + uv_install_wheel::Error::MissingTopLevel(_), )) => { warn_user!( "Failed to uninstall package at {} due to missing `top-level.txt` file. Installation may result in an incomplete environment.", diff --git a/crates/uv/src/commands/pip/sync.rs b/crates/uv/src/commands/pip/sync.rs index ce2ed0915e8b..a5ea9c02fa3f 100644 --- a/crates/uv/src/commands/pip/sync.rs +++ b/crates/uv/src/commands/pip/sync.rs @@ -4,7 +4,6 @@ use anyhow::Result; use owo_colors::OwoColorize; use tracing::debug; -use install_wheel_rs::linker::LinkMode; use uv_auth::store_credentials_from_url; use uv_cache::Cache; use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder}; @@ -16,6 +15,7 @@ use uv_configuration::{KeyringProviderType, TargetTriple}; use uv_dispatch::BuildDispatch; use uv_distribution_types::{DependencyMetadata, IndexLocations, Resolution}; use uv_fs::Simplified; +use uv_install_wheel::linker::LinkMode; use uv_installer::SitePackages; use uv_pep508::PackageName; use uv_python::{ diff --git a/crates/uv/src/commands/venv.rs b/crates/uv/src/commands/venv.rs index 17c9becb6d93..2598aaa2266b 100644 --- a/crates/uv/src/commands/venv.rs +++ b/crates/uv/src/commands/venv.rs @@ -9,7 +9,6 @@ use miette::{Diagnostic, IntoDiagnostic}; use owo_colors::OwoColorize; use thiserror::Error; -use install_wheel_rs::linker::LinkMode; use uv_auth::store_credentials_from_url; use uv_cache::Cache; use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder}; @@ -20,6 +19,7 @@ use uv_configuration::{ use uv_dispatch::BuildDispatch; use uv_distribution_types::{DependencyMetadata, IndexLocations}; use uv_fs::Simplified; +use uv_install_wheel::linker::LinkMode; use uv_pypi_types::Requirement; use uv_python::{ EnvironmentPreference, PythonDownloads, PythonInstallation, PythonPreference, PythonRequest, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 64b870d52ee3..55a372a45385 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -4,7 +4,6 @@ use std::path::PathBuf; use std::process; use std::str::FromStr; -use install_wheel_rs::linker::LinkMode; use url::Url; use uv_cache::{CacheArgs, Refresh}; use uv_cli::{ @@ -26,6 +25,7 @@ use uv_configuration::{ TrustedPublishing, Upgrade, VersionControlSystem, }; use uv_distribution_types::{DependencyMetadata, IndexLocations}; +use uv_install_wheel::linker::LinkMode; use uv_normalize::PackageName; use uv_pep508::{ExtraName, RequirementOrigin}; use uv_pypi_types::{Requirement, SupportedEnvironments};