Skip to content

Commit

Permalink
Rename install-wheel-rs library (#7855)
Browse files Browse the repository at this point in the history
## Summary

I missed this one in the rename (the crate was renamed, but not the
library).
  • Loading branch information
charliermarsh authored Oct 2, 2024
1 parent 14507a1 commit f0659e7
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion crates/uv-bench/benches/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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};
Expand Down
8 changes: 4 additions & 4 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<install_wheel_rs::linker::LinkMode>,
pub link_mode: Option<uv_install_wheel::linker::LinkMode>,

#[command(flatten)]
pub compat_args: compat::VenvCompatArgs,
Expand Down Expand Up @@ -3925,7 +3925,7 @@ pub struct InstallerArgs {
env = "UV_LINK_MODE",
help_heading = "Installer options"
)]
pub link_mode: Option<install_wheel_rs::linker::LinkMode>,
pub link_mode: Option<uv_install_wheel::linker::LinkMode>,

/// Compile Python files to bytecode after installation.
///
Expand Down Expand Up @@ -4123,7 +4123,7 @@ pub struct ResolverArgs {
env = "UV_LINK_MODE",
help_heading = "Installer options"
)]
pub link_mode: Option<install_wheel_rs::linker::LinkMode>,
pub link_mode: Option<uv_install_wheel::linker::LinkMode>,

/// 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
Expand Down Expand Up @@ -4313,7 +4313,7 @@ pub struct ResolverInstallerArgs {
env = "UV_LINK_MODE",
help_heading = "Installer options"
)]
pub link_mode: Option<install_wheel_rs::linker::LinkMode>,
pub link_mode: Option<uv_install_wheel::linker::LinkMode>,

/// Compile Python files to bytecode after installation.
///
Expand Down
4 changes: 2 additions & 2 deletions crates/uv-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<ExcludeNewer>,
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-install-wheel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license = { workspace = true }
workspace = true

[lib]
name = "install_wheel_rs"
name = "uv_install_wheel"

[dependencies]
uv-cache-info = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions crates/uv-installer/src/installer.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 }
Expand Down Expand Up @@ -136,9 +136,9 @@ fn install(
reporter: Option<Box<dyn Reporter>>,
relocatable: bool,
) -> Result<Vec<CachedDist>> {
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(),
Expand Down
10 changes: 5 additions & 5 deletions crates/uv-installer/src/uninstall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<install_wheel_rs::Uninstall, UninstallError> {
) -> Result<uv_install_wheel::Uninstall, UninstallError> {
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)),
}
Expand All @@ -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),
}
2 changes: 1 addition & 1 deletion crates/uv-python/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-settings/src/combine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-settings/src/settings.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions crates/uv-tool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/pip/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/pip/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions crates/uv/src/commands/pip/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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;
Expand Down Expand Up @@ -487,15 +487,15 @@ 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.",
dist_info.path().user_display().cyan(),
);
}
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.",
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/pip/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/venv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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};
Expand Down

0 comments on commit f0659e7

Please sign in to comment.