Skip to content

Commit 232dc9b

Browse files
committed
Fix up
1 parent e4017b7 commit 232dc9b

File tree

27 files changed

+1159
-355
lines changed

27 files changed

+1159
-355
lines changed

Cargo.lock

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ uv-small-str = { path = "crates/uv-small-str" }
6363
uv-state = { path = "crates/uv-state" }
6464
uv-static = { path = "crates/uv-static" }
6565
uv-tool = { path = "crates/uv-tool" }
66+
uv-torch = { path = "crates/uv-torch" }
6667
uv-trampoline-builder = { path = "crates/uv-trampoline-builder" }
6768
uv-types = { path = "crates/uv-types" }
6869
uv-version = { path = "crates/uv-version" }

crates/uv-cli/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ uv-python = { workspace = true, features = ["clap", "schemars"]}
2828
uv-resolver = { workspace = true, features = ["clap"] }
2929
uv-settings = { workspace = true, features = ["schemars"] }
3030
uv-static = { workspace = true }
31+
uv-torch = { workspace = true, features = ["clap"] }
3132
uv-version = { workspace = true }
3233
uv-warnings = { workspace = true }
3334

crates/uv-cli/src/lib.rs

+40
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use uv_pypi_types::VerbatimParsedUrl;
2121
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
2222
use uv_resolver::{AnnotationStyle, ExcludeNewer, ForkStrategy, PrereleaseMode, ResolutionMode};
2323
use uv_static::EnvVars;
24+
use uv_torch::TorchMode;
2425

2526
pub mod comma;
2627
pub mod compat;
@@ -1258,6 +1259,19 @@ pub struct PipCompileArgs {
12581259
#[arg(long, overrides_with("emit_index_annotation"), hide = true)]
12591260
pub no_emit_index_annotation: bool,
12601261

1262+
/// The backend to use when fetching packages in the `PyTorch` ecosystem (e.g., `cu126` or `auto`)
1263+
///
1264+
/// When set, uv will ignore the configured index URLs for packages in the `PyTorch` ecosystem,
1265+
/// and will instead use the defined backend.
1266+
///
1267+
/// For example, when set to `cpu`, uv will use the CPU-only `PyTorch` index; when set to `cu126`,
1268+
/// uv will use the `PyTorch` index for CUDA 12.6.
1269+
///
1270+
/// The `auto` mode will attempt to detect the appropriate `PyTorch` index based on the currently
1271+
/// installed CUDA drivers.
1272+
#[arg(long, value_enum)]
1273+
pub torch_backend: Option<TorchMode>,
1274+
12611275
#[command(flatten)]
12621276
pub compat_args: compat::PipCompileCompatArgs,
12631277
}
@@ -1499,6 +1513,19 @@ pub struct PipSyncArgs {
14991513
#[arg(long)]
15001514
pub dry_run: bool,
15011515

1516+
/// The backend to use when fetching packages in the `PyTorch` ecosystem (e.g., `cu126` or `auto`)
1517+
///
1518+
/// When set, uv will ignore the configured index URLs for packages in the `PyTorch` ecosystem,
1519+
/// and will instead use the defined backend.
1520+
///
1521+
/// For example, when set to `cpu`, uv will use the CPU-only `PyTorch` index; when set to `cu126`,
1522+
/// uv will use the `PyTorch` index for CUDA 12.6.
1523+
///
1524+
/// The `auto` mode will attempt to detect the appropriate `PyTorch` index based on the currently
1525+
/// installed CUDA drivers.
1526+
#[arg(long, value_enum)]
1527+
pub torch_backend: Option<TorchMode>,
1528+
15021529
#[command(flatten)]
15031530
pub compat_args: compat::PipSyncCompatArgs,
15041531
}
@@ -1791,6 +1818,19 @@ pub struct PipInstallArgs {
17911818
#[arg(long)]
17921819
pub dry_run: bool,
17931820

1821+
/// The backend to use when fetching packages in the `PyTorch` ecosystem (e.g., `cu126` or `auto`)
1822+
///
1823+
/// When set, uv will ignore the configured index URLs for packages in the `PyTorch` ecosystem,
1824+
/// and will instead use the defined backend.
1825+
///
1826+
/// For example, when set to `cpu`, uv will use the CPU-only `PyTorch` index; when set to `cu126`,
1827+
/// uv will use the `PyTorch` index for CUDA 12.6.
1828+
///
1829+
/// The `auto` mode will attempt to detect the appropriate `PyTorch` index based on the currently
1830+
/// installed CUDA drivers.
1831+
#[arg(long, value_enum)]
1832+
pub torch_backend: Option<TorchMode>,
1833+
17941834
#[command(flatten)]
17951835
pub compat_args: compat::PipInstallCompatArgs,
17961836
}

crates/uv-client/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ uv-platform-tags = { workspace = true }
2525
uv-pypi-types = { workspace = true }
2626
uv-small-str = { workspace = true }
2727
uv-static = { workspace = true }
28+
uv-torch = { workspace = true }
2829
uv-version = { workspace = true }
2930
uv-warnings = { workspace = true }
3031

0 commit comments

Comments
 (0)