Files
uv/crates/uv-dispatch/src
Tomasz Kramkowski ca1e9a9d06 Introduce a global preview state (#18194)
## Summary

Introduce a global preview state to reduce the amount of churn required
when adding a preview feature.

This PR also introduces a testing feature to `uv_preview` enabled for
dev builds (builds which are used for running tests among other things).
This exposes `uv_preview::test::with_features` which can be used from
other crates' unit tests to override the preview state for the duration
of a scope. `uv_preview::init` continues to exist and work in this mode
since running the integration test suite in workspace mode pulls in the
dev feature (whereas doing it in package mode, does not, IDFK).

When doing a debug or release build, the testing feature is not enabled.

The PR is based on and closes #17844.

As an example, I've converted the build backend to using global preview
as it was a place which did unit tests which needed to set the preview
state.

## Test Plan

Verification that things continue to work and that the testing feature
does not enable for debug or release builds but does enable for tests
was done manually and by running the test suite.

Additional tests were added.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-12 20:20:55 +00:00
..