mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 02:22:19 +00:00
Include virtual environment interpreters in uv python find
(#6521)
Previously, we excluded these and only looked at system interpreters. However, it makes sense for this to match the typical Python discovery experience. We could consider swapping the default... I'm not sure what makes more sense. If we change the default (as written now) — this could arguably be a breaking change.
This commit is contained in:
parent
d1cbcb30e3
commit
6cf5d13183
7 changed files with 196 additions and 8 deletions
|
@ -3063,6 +3063,25 @@ pub struct PythonFindArgs {
|
|||
/// directory or parent directories will be used.
|
||||
#[arg(long, alias = "no_workspace")]
|
||||
pub no_project: bool,
|
||||
|
||||
/// Only find system Python interpreters.
|
||||
///
|
||||
/// By default, uv will report the first Python interpreter it would use, including those in an
|
||||
/// active virtual environment or a virtual environment in the current working directory or any
|
||||
/// parent directory.
|
||||
///
|
||||
/// The `--system` option instructs uv to skip virtual environment Python interpreters and
|
||||
/// restrict its search to the system path.
|
||||
#[arg(
|
||||
long,
|
||||
env = "UV_SYSTEM_PYTHON",
|
||||
value_parser = clap::builder::BoolishValueParser::new(),
|
||||
overrides_with("no_system")
|
||||
)]
|
||||
pub system: bool,
|
||||
|
||||
#[arg(long, overrides_with("system"), hide = true)]
|
||||
pub no_system: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue