mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-20 03:49:54 +00:00
Split preview mode into separate feature flags (#14823)
I think this would give us better hygiene than a global flag. It makes it easier for users to opt-in to overlapping features, such as Python upgrades and Python bin installations and to disable warnings for preview mode without opting in to a bunch of other features. In general, I want to reduce the burden for putting something under preview. The `--preview` and `--no-preview` flags are retained as global overrides. A new `--preview-features` option is added which accepts comma separated features or can be passed multiple times, e.g., `--preview-features add-bounds,pylock`. There's a `UV_PREVIEW_FEATURES` environment variable for that option (I'm not sure if we should overload `UV_PREVIEW`, but could be convinced).
This commit is contained in:
parent
9376cf5482
commit
bfb4bc2aeb
55 changed files with 1327 additions and 304 deletions
|
|
@ -3,7 +3,7 @@ use std::path::Path;
|
|||
|
||||
use thiserror::Error;
|
||||
|
||||
use uv_configuration::PreviewMode;
|
||||
use uv_configuration::Preview;
|
||||
use uv_python::{Interpreter, PythonEnvironment};
|
||||
|
||||
pub use virtualenv::{OnExisting, remove_virtualenv};
|
||||
|
|
@ -56,7 +56,7 @@ pub fn create_venv(
|
|||
relocatable: bool,
|
||||
seed: bool,
|
||||
upgradeable: bool,
|
||||
preview: PreviewMode,
|
||||
preview: Preview,
|
||||
) -> Result<PythonEnvironment, Error> {
|
||||
// Create the virtualenv at the given location.
|
||||
let virtualenv = virtualenv::create(
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use itertools::Itertools;
|
|||
use owo_colors::OwoColorize;
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use uv_configuration::PreviewMode;
|
||||
use uv_configuration::Preview;
|
||||
use uv_fs::{CWD, Simplified, cachedir};
|
||||
use uv_pypi_types::Scheme;
|
||||
use uv_python::managed::{PythonMinorVersionLink, create_link_to_executable};
|
||||
|
|
@ -59,7 +59,7 @@ pub(crate) fn create(
|
|||
relocatable: bool,
|
||||
seed: bool,
|
||||
upgradeable: bool,
|
||||
preview: PreviewMode,
|
||||
preview: Preview,
|
||||
) -> Result<VirtualEnvironment, Error> {
|
||||
// Determine the base Python executable; that is, the Python executable that should be
|
||||
// considered the "base" for the virtual environment.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue