Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ repository = "https://github.com/astral-sh/uv"
authors = ["uv"]
license = "MIT OR Apache-2.0"

[workspace.metadata.cargo-shear]
ignored = ["uv-delocate"]

[workspace.dependencies]
uv-auth = { version = "0.0.15", path = "crates/uv-auth" }
uv-bin-install = { version = "0.0.15", path = "crates/uv-bin-install" }
Expand All @@ -27,6 +30,7 @@ uv-cli = { version = "0.0.15", path = "crates/uv-cli" }
uv-client = { version = "0.0.15", path = "crates/uv-client" }
uv-configuration = { version = "0.0.15", path = "crates/uv-configuration" }
uv-console = { version = "0.0.15", path = "crates/uv-console" }
uv-delocate = { version = "0.0.15", path = "crates/uv-delocate" }
uv-dirs = { version = "0.0.15", path = "crates/uv-dirs" }
uv-dispatch = { version = "0.0.15", path = "crates/uv-dispatch" }
uv-distribution = { version = "0.0.15", path = "crates/uv-distribution" }
Expand Down Expand Up @@ -118,7 +122,7 @@ futures = { version = "0.3.30" }
glob = { version = "0.3.1" }
globset = { version = "0.4.15" }
globwalk = { version = "0.9.1" }
goblin = { version = "0.10.0", default-features = false, features = ["std", "elf32", "elf64", "endian_fd"] }
goblin = { version = "0.10.0", default-features = false, features = ["std", "elf32", "elf64", "endian_fd", "mach32", "mach64"] }
h2 = { version = "0.4.7" }
hashbrown = { version = "0.16.0" }
hex = { version = "0.4.3" }
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ their support.

uv's Git implementation is based on [Cargo](https://github.com/rust-lang/cargo).

uv's macOS wheel delocating is based on [delocate](https://github.com/matthew-brett/delocate).

Some of uv's optimizations are inspired by the great work we've seen in [pnpm](https://pnpm.io/),
[Orogene](https://github.com/orogene/orogene), and [Bun](https://github.com/oven-sh/bun). We've also
learned a lot from Nathaniel J. Smith's [Posy](https://github.com/njsmith/posy) and adapted its
Expand Down
4 changes: 4 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ extend-ignore-re = [

[default.extend-identifiers]
seeked = "seeked" # special term used for streams

[default.extend-words]
Delocate = "Delocate"
delocate = "delocate"
1 change: 1 addition & 0 deletions crates/uv-configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ uv-git = { workspace = true }
uv-normalize = { workspace = true }
uv-pep440 = { workspace = true }
uv-pep508 = { workspace = true, features = ["schemars"] }
uv-platform = { workspace = true }
uv-platform-tags = { workspace = true }
uv-static = { workspace = true }
clap = { workspace = true, features = ["derive"], optional = true }
Expand Down
39 changes: 17 additions & 22 deletions crates/uv-configuration/src/target_triple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use tracing::debug;

use uv_pep508::MarkerEnvironment;
use uv_platform::MacOSVersion;
use uv_platform_tags::{Arch, Os, Platform};
use uv_static::EnvVars;

Expand Down Expand Up @@ -297,18 +298,26 @@ impl TargetTriple {
Arch::X86_64,
),
Self::Macos | Self::Aarch64AppleDarwin => {
let (major, minor) = macos_deployment_target().map_or((13, 0), |(major, minor)| {
debug!("Found macOS deployment target: {}.{}", major, minor);
(major, minor)
});
let MacOSVersion { major, minor } =
MacOSVersion::from_env().map_or(MacOSVersion::DEFAULT, |version| {
debug!(
"Found macOS deployment target: {}.{}",
version.major, version.minor
);
version
});
Platform::new(Os::Macos { major, minor }, Arch::Aarch64)
}
Self::I686PcWindowsMsvc => Platform::new(Os::Windows, Arch::X86),
Self::X8664AppleDarwin => {
let (major, minor) = macos_deployment_target().map_or((13, 0), |(major, minor)| {
debug!("Found macOS deployment target: {}.{}", major, minor);
(major, minor)
});
let MacOSVersion { major, minor } =
MacOSVersion::from_env().map_or(MacOSVersion::DEFAULT, |version| {
debug!(
"Found macOS deployment target: {}.{}",
version.major, version.minor
);
version
});
Platform::new(Os::Macos { major, minor }, Arch::X86_64)
}
Self::Aarch64UnknownLinuxGnu => Platform::new(
Expand Down Expand Up @@ -936,20 +945,6 @@ impl TargetTriple {
}
}

/// Return the macOS deployment target as parsed from the environment.
fn macos_deployment_target() -> Option<(u16, u16)> {
let version = std::env::var(EnvVars::MACOSX_DEPLOYMENT_TARGET).ok()?;
let mut parts = version.split('.');

// Parse the major version (e.g., `12` in `12.0`).
let major = parts.next()?.parse::<u16>().ok()?;

// Parse the minor version (e.g., `0` in `12.0`), with a default of `0`.
let minor = parts.next().unwrap_or("0").parse::<u16>().ok()?;

Some((major, minor))
}

/// Return the iOS deployment target as parsed from the environment.
fn ios_deployment_target() -> Option<(u16, u16)> {
let version = std::env::var(EnvVars::IPHONEOS_DEPLOYMENT_TARGET).ok()?;
Expand Down
35 changes: 35 additions & 0 deletions crates/uv-delocate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "uv-delocate"
version = "0.0.11"
description = "Mach-O delocate functionality for Python wheels"
edition = { workspace = true }
rust-version = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[lib]
doctest = false

[lints]
workspace = true

[dependencies]
uv-distribution-filename = { workspace = true }
uv-extract = { workspace = true }
uv-fs = { workspace = true }
uv-install-wheel = { workspace = true }
uv-platform = { workspace = true }
uv-platform-tags = { workspace = true }
uv-static = { workspace = true }

base64 = { workspace = true }
fs-err = { workspace = true }
goblin = { workspace = true }
sha2 = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
walkdir = { workspace = true }
zip = { workspace = true }
Loading
Loading