Add --clear to uv build to remove old build artifacts (#16371)
Add `uv build --clear` that behaves like `rm -r ./dist && uv build` to clear artifacts from previous builds. This avoids accidentally publishing the wrong artifacts and removes accumulated old builds. See https://github.com/astral-sh/uv/issues/10293#issuecomment-3405904013 Fixes #10293
This commit is contained in:
@@ -2635,6 +2635,10 @@ pub struct BuildArgs {
|
||||
#[arg(long, conflicts_with = "list")]
|
||||
pub force_pep517: bool,
|
||||
|
||||
/// Clear the output directory before the build, removing stale artifacts.
|
||||
#[arg(long)]
|
||||
pub clear: bool,
|
||||
|
||||
/// Constrain build dependencies using the given requirements files when building distributions.
|
||||
///
|
||||
/// Constraints files are `requirements.txt`-like files that only control the _version_ of a
|
||||
|
||||
Reference in New Issue
Block a user