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:


![image](https://github.com/user-attachments/assets/55e3f169-3051-4217-987d-0cb01ae5050e)


![image](https://github.com/user-attachments/assets/1da75245-358d-4bee-9199-f720089f0a70)


![image](https://github.com/user-attachments/assets/4d97a893-552e-43a1-9c22-78fc67f1e9f5)

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:
konsti
2024-12-04 09:52:27 +01:00
committed by GitHub
parent d7b74f964e
commit 7d82cbff01
7 changed files with 570 additions and 177 deletions
+1 -1
View File
@@ -543,7 +543,7 @@ fn python_install_default() {
----- stdout -----
----- stderr -----
The `--default` flag is only available in preview mode; add the `--preview` flag to use `--default
The `--default` flag is only available in preview mode; add the `--preview` flag to use `--default`
"###);
// Install a specific version