mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25: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.
|
||||
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)]
|
||||
|
|
|
@ -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 {}",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue