mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 10:33:49 +00:00
Add uv python install --default
(#8650)
This pull request is best viewed with [whitespace hidden](https://github.com/astral-sh/uv/pull/8650/files?diff=unified&w=1) Adds a `--default` flag to `uv python install` in preview. This includes a `python` and `python{major}` executable in addition to the `python{major}.{minor}` executable. We will replace uv-managed executables, but externally managed executables require the `--force` flag to overwrite. If you run `uv python install` (without arguments), we include the `--default` flag implicitly to populate `python` and `python3` for the "default" install version. In the future, we should add a warning if the installed executable isn't at the front of the PATH.
This commit is contained in:
parent
97114ebe4b
commit
63443f1984
9 changed files with 500 additions and 125 deletions
|
@ -4226,6 +4226,21 @@ pub struct PythonInstallArgs {
|
|||
/// Implies `--reinstall`.
|
||||
#[arg(long, short)]
|
||||
pub force: bool,
|
||||
|
||||
/// Use as the default Python version.
|
||||
///
|
||||
/// By default, only a `python{major}.{minor}` executable is installed, e.g., `python3.10`. When
|
||||
/// the `--default` flag is used, `python{major}`, e.g., `python3`, and `python` executables are
|
||||
/// also installed.
|
||||
///
|
||||
/// Alternative Python variants will still include their tag. For example, installing
|
||||
/// 3.13+freethreaded with `--default` will include in `python3t` and `pythont`, not `python3`
|
||||
/// and `python`.
|
||||
///
|
||||
/// If multiple Python versions are requested during the installation, the first request will be
|
||||
/// the default.
|
||||
#[arg(long)]
|
||||
pub default: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue