mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Rename python install --force
parameter to --reinstall
(#4999)
## Summary Rename the `--force` parameter of `uv python install` to `--reinstall`. Closes #4961.
This commit is contained in:
parent
c345484c93
commit
9643fb99d1
5 changed files with 13 additions and 13 deletions
|
@ -2205,9 +2205,9 @@ pub struct PythonInstallArgs {
|
||||||
/// installed any Python versions. If not, it will install the latest stable version of Python.
|
/// installed any Python versions. If not, it will install the latest stable version of Python.
|
||||||
pub targets: Vec<String>,
|
pub targets: Vec<String>,
|
||||||
|
|
||||||
/// Force the installation of the requested Python, even if it is already installed.
|
/// Reinstall the requested Python version, if it's already installed.
|
||||||
#[arg(long, short)]
|
#[arg(long, short, alias = "force")]
|
||||||
pub force: bool,
|
pub reinstall: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Args)]
|
#[derive(Args)]
|
||||||
|
|
|
@ -26,7 +26,7 @@ use crate::printer::Printer;
|
||||||
/// Download and install Python versions.
|
/// Download and install Python versions.
|
||||||
pub(crate) async fn install(
|
pub(crate) async fn install(
|
||||||
targets: Vec<String>,
|
targets: Vec<String>,
|
||||||
force: bool,
|
reinstall: bool,
|
||||||
native_tls: bool,
|
native_tls: bool,
|
||||||
connectivity: Connectivity,
|
connectivity: Connectivity,
|
||||||
preview: PreviewMode,
|
preview: PreviewMode,
|
||||||
|
@ -96,7 +96,7 @@ pub(crate) async fn install(
|
||||||
installation.key().green(),
|
installation.key().green(),
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
if force {
|
if reinstall {
|
||||||
writeln!(
|
writeln!(
|
||||||
printer.stderr(),
|
printer.stderr(),
|
||||||
"Uninstalling {}",
|
"Uninstalling {}",
|
||||||
|
|
|
@ -712,7 +712,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
|
||||||
|
|
||||||
commands::python_install(
|
commands::python_install(
|
||||||
args.targets,
|
args.targets,
|
||||||
args.force,
|
args.reinstall,
|
||||||
globals.native_tls,
|
globals.native_tls,
|
||||||
globals.connectivity,
|
globals.connectivity,
|
||||||
globals.preview,
|
globals.preview,
|
||||||
|
|
|
@ -359,16 +359,16 @@ impl PythonListSettings {
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub(crate) struct PythonInstallSettings {
|
pub(crate) struct PythonInstallSettings {
|
||||||
pub(crate) targets: Vec<String>,
|
pub(crate) targets: Vec<String>,
|
||||||
pub(crate) force: bool,
|
pub(crate) reinstall: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PythonInstallSettings {
|
impl PythonInstallSettings {
|
||||||
/// Resolve the [`PythonInstallSettings`] from the CLI and filesystem configuration.
|
/// Resolve the [`PythonInstallSettings`] from the CLI and filesystem configuration.
|
||||||
#[allow(clippy::needless_pass_by_value)]
|
#[allow(clippy::needless_pass_by_value)]
|
||||||
pub(crate) fn resolve(args: PythonInstallArgs, _filesystem: Option<FilesystemOptions>) -> Self {
|
pub(crate) fn resolve(args: PythonInstallArgs, _filesystem: Option<FilesystemOptions>) -> Self {
|
||||||
let PythonInstallArgs { targets, force } = args;
|
let PythonInstallArgs { targets, reinstall } = args;
|
||||||
|
|
||||||
Self { targets, force }
|
Self { targets, reinstall }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,8 +301,8 @@ fn help_subsubcommand() {
|
||||||
any Python versions. If not, it will install the latest stable version of Python.
|
any Python versions. If not, it will install the latest stable version of Python.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-f, --force
|
-r, --reinstall
|
||||||
Force the installation of the requested Python, even if it is already installed
|
Reinstall the requested Python version, if it's already installed
|
||||||
|
|
||||||
-q, --quiet
|
-q, --quiet
|
||||||
Do not print any output
|
Do not print any output
|
||||||
|
@ -462,8 +462,8 @@ fn help_flag_subsubcommand() {
|
||||||
[TARGETS]... The Python version(s) to install
|
[TARGETS]... The Python version(s) to install
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-f, --force
|
-r, --reinstall
|
||||||
Force the installation of the requested Python, even if it is already installed
|
Reinstall the requested Python version, if it's already installed
|
||||||
-q, --quiet
|
-q, --quiet
|
||||||
Do not print any output
|
Do not print any output
|
||||||
-v, --verbose...
|
-v, --verbose...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue