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:
Caíque Porfirio 2024-07-11 22:06:54 -03:00 committed by GitHub
parent c345484c93
commit 9643fb99d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 13 deletions

View file

@ -2205,9 +2205,9 @@ pub struct PythonInstallArgs {
/// installed any Python versions. If not, it will install the latest stable version of Python.
pub targets: Vec<String>,
/// Force the installation of the requested Python, even if it is already installed.
#[arg(long, short)]
pub force: bool,
/// Reinstall the requested Python version, if it's already installed.
#[arg(long, short, alias = "force")]
pub reinstall: bool,
}
#[derive(Args)]

View file

@ -26,7 +26,7 @@ use crate::printer::Printer;
/// Download and install Python versions.
pub(crate) async fn install(
targets: Vec<String>,
force: bool,
reinstall: bool,
native_tls: bool,
connectivity: Connectivity,
preview: PreviewMode,
@ -96,7 +96,7 @@ pub(crate) async fn install(
installation.key().green(),
)?;
}
if force {
if reinstall {
writeln!(
printer.stderr(),
"Uninstalling {}",

View file

@ -712,7 +712,7 @@ async fn run(cli: Cli) -> Result<ExitStatus> {
commands::python_install(
args.targets,
args.force,
args.reinstall,
globals.native_tls,
globals.connectivity,
globals.preview,

View file

@ -359,16 +359,16 @@ impl PythonListSettings {
#[derive(Debug, Clone)]
pub(crate) struct PythonInstallSettings {
pub(crate) targets: Vec<String>,
pub(crate) force: bool,
pub(crate) reinstall: bool,
}
impl PythonInstallSettings {
/// Resolve the [`PythonInstallSettings`] from the CLI and filesystem configuration.
#[allow(clippy::needless_pass_by_value)]
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 }
}
}

View file

@ -301,8 +301,8 @@ fn help_subsubcommand() {
any Python versions. If not, it will install the latest stable version of Python.
Options:
-f, --force
Force the installation of the requested Python, even if it is already installed
-r, --reinstall
Reinstall the requested Python version, if it's already installed
-q, --quiet
Do not print any output
@ -462,8 +462,8 @@ fn help_flag_subsubcommand() {
[TARGETS]... The Python version(s) to install
Options:
-f, --force
Force the installation of the requested Python, even if it is already installed
-r, --reinstall
Reinstall the requested Python version, if it's already installed
-q, --quiet
Do not print any output
-v, --verbose...