Add support for `RUST_LOG` to the uv build backend. While we were previously using logging statements in the uv build backend, they could only be shown when when using the direct build fast path through uv, as there was no tracing subscriber to write log messages out. This means no debug logging when using the build backend through pip, `python -m build`, an incompatible version of uv, or any other build frontend; No option to figure why includes and excludes behave the way they do. This PR closes this gap by adding a tracing subscriber. The only option to enable it is `RUST_LOG`, as we don't have a CLI. The formatting style is the same as for uv, and color is also support in the same way, albeit only through anstream's support for TTYs and environment variables. We recommend only `RUST_LOG=uv=debug` and `RUST_LOG=uv=verbose` in the docs, but this can be used to debug into crates such as `glob`, too. <img width="1008" height="325" alt="image" src="https://github.com/user-attachments/assets/d33df219-750b-46a2-b3b4-8895aa137ab9" /> **Before** ``` $ pip wheel . -v [...] Looking in links: /home/konsti/projects/uv/target/wheels/ Processing /home/konsti/projects/uv/scripts/packages/built-by-uv Running command pip subprocess to install build dependencies Looking in links: /home/konsti/projects/uv/target/wheels/ Processing /home/konsti/projects/uv/target/wheels/uv_build-0.8.13-py3-none-manylinux_2_39_x86_64.whl Installing collected packages: uv_build Successfully installed uv_build-0.8.13 Installing build dependencies ... done Running command Getting requirements to build wheel Getting requirements to build wheel ... done Running command Preparing metadata (pyproject.toml) Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: built-by-uv Running command Building wheel for built-by-uv (pyproject.toml) Error: Unsupported glob expression in: `tool.uv.build-backend.*-exclude` Caused by: Invalid character `!` at position 10 in glob: `**/build-*!$§%!½¼²¼³¬!§%$§%.h`. hint: Characters can be escaped with a backslash error: subprocess-exited-with-error × Building wheel for built-by-uv (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /usr/bin/python3 /usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpow1illc9 cwd: /home/konsti/projects/uv/scripts/packages/built-by-uv Building wheel for built-by-uv (pyproject.toml) ... error ERROR: Failed building wheel for built-by-uv Failed to build built-by-uv ERROR: Failed to build one or more wheels ``` **After** ``` $ RUST_LOG=uv=debug pip wheel . -v [...] Looking in links: /home/konsti/projects/uv/target/wheels/ Processing /home/konsti/projects/uv/scripts/packages/built-by-uv Running command pip subprocess to install build dependencies Looking in links: /home/konsti/projects/uv/target/wheels/ Processing /home/konsti/projects/uv/target/wheels/uv_build-0.8.13-py3-none-manylinux_2_39_x86_64.whl Installing collected packages: uv_build Successfully installed uv_build-0.8.13 Installing build dependencies ... done Running command Getting requirements to build wheel Getting requirements to build wheel ... done Running command Preparing metadata (pyproject.toml) DEBUG Writing metadata files to /tmp/pip-modern-metadata-l_kh78cj DEBUG Found PEP 639 license declarations, using METADATA 2.4 DEBUG License files match: `LICENSE-APACHE` DEBUG License files match: `LICENSE-MIT` DEBUG License files match: `third-party-licenses/PEP-401.txt` Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: built-by-uv Running command Building wheel for built-by-uv (pyproject.toml) DEBUG Checking metadata directory /tmp/pip-modern-metadata-l_kh78cj/built_by_uv-0.1.0.dist-info DEBUG Found PEP 639 license declarations, using METADATA 2.4 DEBUG License files match: `LICENSE-APACHE` DEBUG License files match: `LICENSE-MIT` DEBUG License files match: `third-party-licenses/PEP-401.txt` DEBUG Writing wheel at /tmp/pip-wheel-bu6to9i7/built_by_uv-0.1.0-py3-none-any.whl DEBUG Wheel excludes: ["__pycache__", "*.pyc", "*.pyo", "build-*!$§%!½¼²¼³¬!§%$§%.h", "/src/built_by_uv/not-packaged.txt"] Error: Unsupported glob expression in: `tool.uv.build-backend.*-exclude` Caused by: Invalid character `!` at position 10 in glob: `**/build-*!$§%!½¼²¼³¬!§%$§%.h`. hint: Characters can be escaped with a backslash error: subprocess-exited-with-error × Building wheel for built-by-uv (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: /usr/bin/python3 /usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpjrxou13a cwd: /home/konsti/projects/uv/scripts/packages/built-by-uv Building wheel for built-by-uv (pyproject.toml) ... error ERROR: Failed building wheel for built-by-uv Failed to build built-by-uv ERROR: Failed to build one or more wheels ``` (There is no color in the above uv log statements, as pip doesn't register as a TTY) Fixes #12723 |
||
|---|---|---|
| .. | ||
| uv | ||
| uv-auth | ||
| uv-bench | ||
| uv-bin-install | ||
| uv-build | ||
| uv-build-backend | ||
| uv-build-frontend | ||
| uv-cache | ||
| uv-cache-info | ||
| uv-cache-key | ||
| uv-cli | ||
| uv-client | ||
| uv-configuration | ||
| uv-console | ||
| uv-dev | ||
| uv-dirs | ||
| uv-dispatch | ||
| uv-distribution | ||
| uv-distribution-filename | ||
| uv-distribution-types | ||
| uv-extract | ||
| uv-fs | ||
| uv-git | ||
| uv-git-types | ||
| uv-globfilter | ||
| uv-install-wheel | ||
| uv-installer | ||
| uv-keyring | ||
| uv-logging | ||
| uv-macros | ||
| uv-metadata | ||
| uv-normalize | ||
| uv-once-map | ||
| uv-options-metadata | ||
| uv-pep440 | ||
| uv-pep508 | ||
| uv-performance-memory-allocator | ||
| uv-platform | ||
| uv-platform-tags | ||
| uv-preview | ||
| uv-publish | ||
| uv-pypi-types | ||
| uv-python | ||
| uv-redacted | ||
| uv-requirements | ||
| uv-requirements-txt | ||
| uv-resolver | ||
| uv-scripts | ||
| uv-settings | ||
| uv-shell | ||
| uv-small-str | ||
| uv-state | ||
| uv-static | ||
| uv-tool | ||
| uv-torch | ||
| uv-trampoline | ||
| uv-trampoline-builder | ||
| uv-types | ||
| uv-version | ||
| uv-virtualenv | ||
| uv-warnings | ||
| uv-workspace | ||
| README.md | ||
README.md
Crates
uv-bench
Functionality for benchmarking uv.
uv-cache-key
Generic functionality for caching paths, URLs, and other resources across platforms.
uv-distribution-filename
Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.
uv-distribution-types
Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.
uv-install-wheel-rs
Install built distributions (wheels) into a virtual environment.
uv-once-map
A waitmap-like concurrent hash map for executing tasks
exactly once.
uv-pep440-rs
Utilities for interacting with Python version numbers and specifiers.
uv-pep508-rs
Utilities for parsing and evaluating dependency specifiers, previously known as PEP 508.
uv-platform-tags
Functionality for parsing and inferring Python platform tags as per PEP 425.
uv-cli
Command-line interface for the uv package manager.
uv-build-frontend
A PEP 517-compatible build frontend for uv.
uv-cache
Functionality for caching Python packages and associated metadata.
uv-client
Client for interacting with PyPI-compatible HTTP APIs.
uv-dev
Development utilities for uv.
uv-dispatch
A centralized struct for resolving and building source distributions in isolated environments.
Implements the traits defined in uv-types.
uv-distribution
Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.
uv-extract
Utilities for extracting files from archives.
uv-fs
Utilities for interacting with the filesystem.
uv-git
Functionality for interacting with Git repositories.
uv-installer
Functionality for installing Python packages into a virtual environment.
uv-python
Functionality for detecting and leveraging the current Python interpreter.
uv-normalize
Normalize package and extra names as per Python specifications.
uv-requirements
Utilities for reading package requirements from pyproject.toml and requirements.txt files.
uv-resolver
Functionality for resolving Python packages and their dependencies.
uv-shell
Utilities for detecting and manipulating shell environments.
uv-types
Shared traits for uv, to avoid circular dependencies.
uv-pypi-types
General-purpose type definitions for types used in PyPI-compatible APIs.
uv-virtualenv
A venv replacement to create virtual environments in Rust.
uv-warnings
User-facing warnings for uv.
uv-workspace
Workspace abstractions for uv.
uv-requirements-txt
Functionality for parsing requirements.txt files.