mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Add uv-
prefix to all internal crates (#7853)
## Summary Brings more consistency to the repo and ensures that all crates automatically show up in `--verbose` logging.
This commit is contained in:
parent
7b55e97909
commit
14507a1793
319 changed files with 1327 additions and 1317 deletions
|
@ -13,18 +13,18 @@ license = { workspace = true }
|
|||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
cache-key = { workspace = true }
|
||||
distribution-filename = { workspace = true }
|
||||
install-wheel-rs = { workspace = true }
|
||||
pep440_rs = { workspace = true }
|
||||
pep508_rs = { workspace = true }
|
||||
platform-tags = { workspace = true }
|
||||
pypi-types = { workspace = true }
|
||||
uv-cache = { workspace = true }
|
||||
uv-cache-info = { workspace = true }
|
||||
uv-cache-key = { workspace = true }
|
||||
uv-client = { workspace = true }
|
||||
uv-distribution-filename = { workspace = true }
|
||||
uv-extract = { workspace = true }
|
||||
uv-fs = { workspace = true }
|
||||
uv-install-wheel = { workspace = true }
|
||||
uv-pep440 = { workspace = true }
|
||||
uv-pep508 = { workspace = true }
|
||||
uv-platform-tags = { workspace = true }
|
||||
uv-pypi-types = { workspace = true }
|
||||
uv-state = { workspace = true }
|
||||
uv-warnings = { workspace = true }
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ use thiserror::Error;
|
|||
use tracing::{debug, instrument, trace};
|
||||
use which::{which, which_all};
|
||||
|
||||
use pep440_rs::{Prerelease, Version, VersionSpecifier, VersionSpecifiers};
|
||||
use uv_cache::Cache;
|
||||
use uv_fs::Simplified;
|
||||
use uv_pep440::{Prerelease, Version, VersionSpecifier, VersionSpecifiers};
|
||||
use uv_warnings::warn_user_once;
|
||||
|
||||
use crate::downloads::PythonDownloadRequest;
|
||||
|
@ -2203,8 +2203,8 @@ mod tests {
|
|||
use std::{path::PathBuf, str::FromStr};
|
||||
|
||||
use assert_fs::{prelude::*, TempDir};
|
||||
use pep440_rs::{Prerelease, PrereleaseKind, VersionSpecifiers};
|
||||
use test_log::test;
|
||||
use uv_pep440::{Prerelease, PrereleaseKind, VersionSpecifiers};
|
||||
|
||||
use crate::{
|
||||
discovery::{PythonRequest, VersionRequest},
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
use distribution_filename::{ExtensionError, SourceDistExtension};
|
||||
use futures::TryStreamExt;
|
||||
use owo_colors::OwoColorize;
|
||||
use pypi_types::{HashAlgorithm, HashDigest};
|
||||
use std::fmt::Display;
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
@ -15,8 +13,10 @@ use tokio_util::either::Either;
|
|||
use tracing::{debug, instrument};
|
||||
use url::Url;
|
||||
use uv_client::WrappedReqwestError;
|
||||
use uv_distribution_filename::{ExtensionError, SourceDistExtension};
|
||||
use uv_extract::hash::Hasher;
|
||||
use uv_fs::{rename_with_retry, Simplified};
|
||||
use uv_pypi_types::{HashAlgorithm, HashDigest};
|
||||
|
||||
use crate::implementation::{
|
||||
Error as ImplementationError, ImplementationName, LenientImplementationName,
|
||||
|
|
|
@ -5,6 +5,7 @@ use std::fmt;
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use uv_cache::Cache;
|
||||
use uv_cache_key::cache_digest;
|
||||
use uv_fs::{LockedFile, Simplified};
|
||||
|
||||
use crate::discovery::find_python_installation;
|
||||
|
@ -287,7 +288,7 @@ impl PythonEnvironment {
|
|||
} else {
|
||||
// Otherwise, use a global lockfile.
|
||||
LockedFile::acquire(
|
||||
env::temp_dir().join(format!("uv-{}.lock", cache_key::cache_digest(&self.0.root))),
|
||||
env::temp_dir().join(format!("uv-{}.lock", cache_digest(&self.0.root))),
|
||||
self.0.root.user_display(),
|
||||
)
|
||||
.await
|
||||
|
|
|
@ -4,9 +4,9 @@ use std::str::FromStr;
|
|||
|
||||
use tracing::{debug, info};
|
||||
|
||||
use pep440_rs::Version;
|
||||
use uv_cache::Cache;
|
||||
use uv_client::BaseClientBuilder;
|
||||
use uv_pep440::Version;
|
||||
|
||||
use crate::discovery::{
|
||||
find_best_python_installation, find_python_installation, EnvironmentPreference, PythonRequest,
|
||||
|
|
|
@ -11,16 +11,16 @@ use serde::{Deserialize, Serialize};
|
|||
use thiserror::Error;
|
||||
use tracing::{trace, warn};
|
||||
|
||||
use cache_key::cache_digest;
|
||||
use install_wheel_rs::Layout;
|
||||
use pep440_rs::Version;
|
||||
use pep508_rs::{MarkerEnvironment, StringVersion};
|
||||
use platform_tags::Platform;
|
||||
use platform_tags::{Tags, TagsError};
|
||||
use pypi_types::{ResolverMarkerEnvironment, Scheme};
|
||||
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_pep440::Version;
|
||||
use uv_pep508::{MarkerEnvironment, StringVersion};
|
||||
use uv_platform_tags::Platform;
|
||||
use uv_platform_tags::{Tags, TagsError};
|
||||
use uv_pypi_types::{ResolverMarkerEnvironment, Scheme};
|
||||
|
||||
use crate::implementation::LenientImplementationName;
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
|
@ -802,8 +802,8 @@ mod tests {
|
|||
use indoc::{formatdoc, indoc};
|
||||
use tempfile::tempdir;
|
||||
|
||||
use pep440_rs::Version;
|
||||
use uv_cache::Cache;
|
||||
use uv_pep440::Version;
|
||||
|
||||
use crate::Interpreter;
|
||||
|
||||
|
|
|
@ -144,53 +144,55 @@ impl Deref for Os {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&platform_tags::Arch> for Arch {
|
||||
fn from(value: &platform_tags::Arch) -> Self {
|
||||
impl From<&uv_platform_tags::Arch> for Arch {
|
||||
fn from(value: &uv_platform_tags::Arch) -> Self {
|
||||
match value {
|
||||
platform_tags::Arch::Aarch64 => Self(target_lexicon::Architecture::Aarch64(
|
||||
uv_platform_tags::Arch::Aarch64 => Self(target_lexicon::Architecture::Aarch64(
|
||||
target_lexicon::Aarch64Architecture::Aarch64,
|
||||
)),
|
||||
platform_tags::Arch::Armv6L => Self(target_lexicon::Architecture::Arm(
|
||||
uv_platform_tags::Arch::Armv6L => Self(target_lexicon::Architecture::Arm(
|
||||
target_lexicon::ArmArchitecture::Armv6,
|
||||
)),
|
||||
platform_tags::Arch::Armv7L => Self(target_lexicon::Architecture::Arm(
|
||||
uv_platform_tags::Arch::Armv7L => Self(target_lexicon::Architecture::Arm(
|
||||
target_lexicon::ArmArchitecture::Armv7,
|
||||
)),
|
||||
platform_tags::Arch::S390X => Self(target_lexicon::Architecture::S390x),
|
||||
platform_tags::Arch::Powerpc64 => Self(target_lexicon::Architecture::Powerpc64),
|
||||
platform_tags::Arch::Powerpc64Le => Self(target_lexicon::Architecture::Powerpc64le),
|
||||
platform_tags::Arch::X86 => Self(target_lexicon::Architecture::X86_32(
|
||||
uv_platform_tags::Arch::S390X => Self(target_lexicon::Architecture::S390x),
|
||||
uv_platform_tags::Arch::Powerpc64 => Self(target_lexicon::Architecture::Powerpc64),
|
||||
uv_platform_tags::Arch::Powerpc64Le => Self(target_lexicon::Architecture::Powerpc64le),
|
||||
uv_platform_tags::Arch::X86 => Self(target_lexicon::Architecture::X86_32(
|
||||
target_lexicon::X86_32Architecture::I686,
|
||||
)),
|
||||
platform_tags::Arch::X86_64 => Self(target_lexicon::Architecture::X86_64),
|
||||
uv_platform_tags::Arch::X86_64 => Self(target_lexicon::Architecture::X86_64),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&platform_tags::Os> for Libc {
|
||||
fn from(value: &platform_tags::Os) -> Self {
|
||||
impl From<&uv_platform_tags::Os> for Libc {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
platform_tags::Os::Manylinux { .. } => Self::Some(target_lexicon::Environment::Gnu),
|
||||
platform_tags::Os::Musllinux { .. } => Self::Some(target_lexicon::Environment::Musl),
|
||||
uv_platform_tags::Os::Manylinux { .. } => Self::Some(target_lexicon::Environment::Gnu),
|
||||
uv_platform_tags::Os::Musllinux { .. } => Self::Some(target_lexicon::Environment::Musl),
|
||||
_ => Self::None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&platform_tags::Os> for Os {
|
||||
fn from(value: &platform_tags::Os) -> Self {
|
||||
impl From<&uv_platform_tags::Os> for Os {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
platform_tags::Os::Dragonfly { .. } => Self(target_lexicon::OperatingSystem::Dragonfly),
|
||||
platform_tags::Os::FreeBsd { .. } => Self(target_lexicon::OperatingSystem::Freebsd),
|
||||
platform_tags::Os::Haiku { .. } => Self(target_lexicon::OperatingSystem::Haiku),
|
||||
platform_tags::Os::Illumos { .. } => Self(target_lexicon::OperatingSystem::Illumos),
|
||||
platform_tags::Os::Macos { .. } => Self(target_lexicon::OperatingSystem::Darwin),
|
||||
platform_tags::Os::Manylinux { .. } | platform_tags::Os::Musllinux { .. } => {
|
||||
uv_platform_tags::Os::Dragonfly { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Dragonfly)
|
||||
}
|
||||
uv_platform_tags::Os::FreeBsd { .. } => Self(target_lexicon::OperatingSystem::Freebsd),
|
||||
uv_platform_tags::Os::Haiku { .. } => Self(target_lexicon::OperatingSystem::Haiku),
|
||||
uv_platform_tags::Os::Illumos { .. } => Self(target_lexicon::OperatingSystem::Illumos),
|
||||
uv_platform_tags::Os::Macos { .. } => Self(target_lexicon::OperatingSystem::Darwin),
|
||||
uv_platform_tags::Os::Manylinux { .. } | uv_platform_tags::Os::Musllinux { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Linux)
|
||||
}
|
||||
platform_tags::Os::NetBsd { .. } => Self(target_lexicon::OperatingSystem::Netbsd),
|
||||
platform_tags::Os::OpenBsd { .. } => Self(target_lexicon::OperatingSystem::Openbsd),
|
||||
platform_tags::Os::Windows => Self(target_lexicon::OperatingSystem::Windows),
|
||||
uv_platform_tags::Os::NetBsd { .. } => Self(target_lexicon::OperatingSystem::Netbsd),
|
||||
uv_platform_tags::Os::OpenBsd { .. } => Self(target_lexicon::OperatingSystem::Openbsd),
|
||||
uv_platform_tags::Os::Windows => Self(target_lexicon::OperatingSystem::Windows),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
use pypi_types::Scheme;
|
||||
use uv_pypi_types::Scheme;
|
||||
|
||||
/// A `--prefix` directory into which packages can be installed, separate from a virtual environment
|
||||
/// or system Python interpreter.
|
||||
|
|
|
@ -2,8 +2,8 @@ use std::fmt::{Display, Formatter};
|
|||
use std::ops::Deref;
|
||||
use std::str::FromStr;
|
||||
|
||||
use pep440_rs::Version;
|
||||
use pep508_rs::{MarkerEnvironment, StringVersion};
|
||||
use uv_pep440::Version;
|
||||
use uv_pep508::{MarkerEnvironment, StringVersion};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct PythonVersion(StringVersion);
|
||||
|
@ -171,7 +171,7 @@ impl PythonVersion {
|
|||
mod tests {
|
||||
use std::str::FromStr;
|
||||
|
||||
use pep440_rs::{Prerelease, PrereleaseKind, Version};
|
||||
use uv_pep440::{Prerelease, PrereleaseKind, Version};
|
||||
|
||||
use crate::PythonVersion;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
use pypi_types::Scheme;
|
||||
use uv_pypi_types::Scheme;
|
||||
|
||||
/// A `--target` directory into which packages can be installed, separate from a virtual environment
|
||||
/// or system Python interpreter.
|
||||
|
|
|
@ -4,8 +4,8 @@ use std::{
|
|||
};
|
||||
|
||||
use fs_err as fs;
|
||||
use pypi_types::Scheme;
|
||||
use thiserror::Error;
|
||||
use uv_pypi_types::Scheme;
|
||||
|
||||
/// The layout of a virtual environment.
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue