Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --system and --no-system in uv venv #5925

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1837,15 +1837,22 @@ pub struct VenvArgs {
)]
pub python: Option<String>,

// TODO(zanieb): Hide me, I do nothing.
/// Ignore virtual environments when searching for the Python interpreter.
///
/// This is the default behavior and has no effect.
#[arg(
long,
env = "UV_SYSTEM_PYTHON",
value_parser = clap::builder::BoolishValueParser::new(),
overrides_with("no_system")
overrides_with("no_system"),
hide = true,
)]
pub system: bool,

/// This flag is included for compatibility only, it has no effect.
///
/// uv will never search for interpreters in virtual environments when
/// creating a virtual environment.
#[arg(long, overrides_with("system"), hide = true)]
pub no_system: bool,

Expand Down
10 changes: 9 additions & 1 deletion crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use uv_configuration::Concurrency;
use uv_fs::CWD;
use uv_requirements::RequirementsSource;
use uv_settings::{Combine, FilesystemOptions};
use uv_warnings::warn_user;
use uv_warnings::{warn_user, warn_user_once};
use uv_workspace::{DiscoveryOptions, Workspace};

use crate::commands::{ExitStatus, ToolRunCommand};
Expand Down Expand Up @@ -627,6 +627,14 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
Commands::Venv(args) => {
args.compat_args.validate()?;

if args.no_system {
warn_user_once!("The `--no-system` flag has no effect, a system Python interpreter is always used in `uv venv`");
}

if args.system {
warn_user_once!("The `--system` flag has no effect, a system Python interpreter is always used in `uv venv`");
}

// Resolve the settings from the command-line arguments and workspace configuration.
let args = settings::VenvSettings::resolve(args, filesystem);
show_settings!(args);
Expand Down
Loading