mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Implement uv build
(#6895)
## Summary This PR exposes uv's PEP 517 implementation via a `uv build` frontend, such that you can use `uv build` to build source and binary distributions (i.e., wheels and sdists) from a given directory. There are some TODOs that I'll tackle in separate PRs: - [x] Support building a wheel from a source distribution (rather than from source) (#6898) - [x] Stream the build output (#6912) Closes https://github.com/astral-sh/uv/issues/1510 Closes https://github.com/astral-sh/uv/issues/1663.
This commit is contained in:
parent
a3a1bfd5ec
commit
df84d25a7e
16 changed files with 1028 additions and 168 deletions
|
@ -4,7 +4,7 @@ use std::process::ExitCode;
|
|||
use std::str::FromStr;
|
||||
use std::time::Instant;
|
||||
|
||||
use anstream::{eprintln, println};
|
||||
use anstream::eprintln;
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
use owo_colors::OwoColorize;
|
||||
|
@ -16,7 +16,6 @@ use tracing_subscriber::layer::SubscriberExt;
|
|||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tracing_subscriber::{EnvFilter, Layer};
|
||||
|
||||
use crate::build::{build, BuildArgs};
|
||||
use crate::clear_compile::ClearCompileArgs;
|
||||
use crate::compile::CompileArgs;
|
||||
use crate::generate_all::Args as GenerateAllArgs;
|
||||
|
@ -43,7 +42,6 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
|||
#[global_allocator]
|
||||
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
|
||||
|
||||
mod build;
|
||||
mod clear_compile;
|
||||
mod compile;
|
||||
mod generate_all;
|
||||
|
@ -57,8 +55,6 @@ const ROOT_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../");
|
|||
|
||||
#[derive(Parser)]
|
||||
enum Cli {
|
||||
/// Build a source distribution into a wheel.
|
||||
Build(BuildArgs),
|
||||
/// Display the metadata for a `.whl` at a given URL.
|
||||
WheelMetadata(WheelMetadataArgs),
|
||||
/// Compile all `.py` to `.pyc` files in the tree.
|
||||
|
@ -82,10 +78,6 @@ enum Cli {
|
|||
async fn run() -> Result<()> {
|
||||
let cli = Cli::parse();
|
||||
match cli {
|
||||
Cli::Build(args) => {
|
||||
let target = build(args).await?;
|
||||
println!("Wheel built to {}", target.display());
|
||||
}
|
||||
Cli::WheelMetadata(args) => wheel_metadata::wheel_metadata(args).await?,
|
||||
Cli::Compile(args) => compile::compile(args).await?,
|
||||
Cli::ClearCompile(args) => clear_compile::clear_compile(&args)?,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue