mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 02:48:17 +00:00
Build backend: Add --list
option (#9610)
Add the `uv build --list`, a "subcommand" to list the files that would be included when building a distribution. It does not build the distribution, except when a source dist is required for source dist -> wheel. This is an important debugging tool for the include and exclude options: Did i actually include the files I wanted, or am i shipping a broken distribution? Are there any temporary files I still need to exclude? Cargo offers this as `cargo package --list`. `--list` is preview-exclusive, since it requires the fast path, which I also put into preview. Examples:    I'll fix the error handling in a follow-up. Tagging as enhancement because it changes the stable output slightly (two lines instead of one). CC @charliermarsh for uv-wide consistency in the stdout/stderr handling.
This commit is contained in:
parent
d7b74f964e
commit
7d82cbff01
7 changed files with 570 additions and 177 deletions
|
@ -2175,6 +2175,18 @@ pub struct BuildArgs {
|
|||
#[arg(long)]
|
||||
pub wheel: bool,
|
||||
|
||||
/// When using the uv build backend, list the files that would be included when building.
|
||||
///
|
||||
/// Skips building the actual distribution, except when the source distribution is needed to
|
||||
/// build the wheel. The file list is collected directly without a PEP 517 environment. It only
|
||||
/// works with the uv build backend, there is no PEP 517 file list build hook.
|
||||
///
|
||||
/// This option can be combined with `--sdist` and `--wheel` for inspecting different build
|
||||
/// paths.
|
||||
// Hidden while in preview.
|
||||
#[arg(long, hide = true)]
|
||||
pub list: bool,
|
||||
|
||||
#[arg(long, overrides_with("no_build_logs"), hide = true)]
|
||||
pub build_logs: bool,
|
||||
|
||||
|
@ -2187,7 +2199,7 @@ pub struct BuildArgs {
|
|||
/// By default, uv won't create a PEP 517 build environment for packages using the uv build
|
||||
/// backend, but use a fast path that calls into the build backend directly. This option forces
|
||||
/// always using PEP 517.
|
||||
#[arg(long)]
|
||||
#[arg(long, conflicts_with = "list")]
|
||||
pub force_pep517: bool,
|
||||
|
||||
/// Constrain build dependencies using the given requirements files when building
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue