Includes a few things... - Drops preview warnings for use of `uv python upgrade` and `uv python install --upgrade` - Adds `--resolve-links` to `uv python find`, which I needed in test cases to retain existing snapshots - Fixes issues in our "Using environment ..." messages on Windows which were incorrect - Refactors `from_executable` for the `PythonMinorVersionLink` type (https://github.com/astral-sh/uv/pull/17842/commits/28b2ed2525327d94fdf5372a29bbbc476d74680f) to use the type system to prevent incorrect construction (for above) - Removes special casing where we only upgrade links if they already exist, which existed so preview wasn't needed on every invocation - Fixes a bug with `PythonMinorVersionLink::exists` which returned `true` even if the link pointed to the wrong Python installation leading to discovery failures
2.5 KiB
Preview features
uv includes opt-in preview features to provide an opportunity for community feedback and increase confidence that changes are a net-benefit before enabling them for everyone.
Enabling preview features
To enable all preview features, use the --preview flag:
$ uv run --preview ...
Or, set the UV_PREVIEW environment variable:
$ UV_PREVIEW=1 uv run ...
To enable specific preview features, use the --preview-features flag:
$ uv run --preview-features foo ...
The --preview-features flag can be repeated to enable multiple features:
$ uv run --preview-features foo --preview-features bar ...
Or, features can be provided in a comma separated list:
$ uv run --preview-features foo,bar ...
The UV_PREVIEW_FEATURES environment variable can be used similarly, e.g.:
$ UV_PREVIEW_FEATURES=foo,bar uv run ...
For backwards compatibility, enabling preview features that do not exist will warn, but not error.
Using preview features
Often, preview features can be used without changing any preview settings if the behavior change is
gated by some sort of user interaction, For example, while pylock.toml support is in preview, you
can use uv pip install with a pylock.toml file without additional configuration because
specifying the pylock.toml file indicates you want to use the feature. However, a warning will be
displayed that the feature is in preview. The preview feature can be enabled to silence the warning.
Available preview features
The following preview features are available:
add-bounds: Allows configuring the default bounds foruv addinvocations.json-output: Allows--output-format jsonfor various uv commands.package-conflicts: Allows defining workspace conflicts at the package level.pylock: Allows installing frompylock.tomlfiles.python-install-default: Allows installingpythonandpython3executables.format: Allows usinguv format.native-auth: Enables storage of credentials in a system-native location.workspace-metadata: Allows usinguv workspace metadata.workspace-dir: Allows usinguv workspace dir.workspace-list: Allows usinguv workspace list.
Disabling preview features
The --no-preview option can be used to disable preview features.