From aea8b0ae6c3463cc3cdc5012709dc6f2e748b0dd Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 17 Apr 2024 15:05:10 -0400 Subject: [PATCH] Rename `--compile` to `--compile-bytecode` (#3102) ## Summary With an alias for backwards compatibility. It's clearer and matches the setting in the TOML configuration (where `compile` was deemed too vague). --- crates/uv/src/cli.rs | 26 ++++++++++++++++++-------- crates/uv/src/settings.rs | 12 ++++++------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/crates/uv/src/cli.rs b/crates/uv/src/cli.rs index 0c23a7a07..d494bb72d 100644 --- a/crates/uv/src/cli.rs +++ b/crates/uv/src/cli.rs @@ -771,11 +771,16 @@ pub(crate) struct PipSyncArgs { /// /// The compile option will process the entire site-packages directory for consistency and /// (like pip) ignore all errors. - #[arg(long, overrides_with("no_compile"))] - pub(crate) compile: bool, + #[arg(long, alias = "compile", overrides_with("no_compile_bytecode"))] + pub(crate) compile_bytecode: bool, - #[arg(long, overrides_with("compile"), hide = true)] - pub(crate) no_compile: bool, + #[arg( + long, + alias = "no_compile", + overrides_with("compile_bytecode"), + hide = true + )] + pub(crate) no_compile_bytecode: bool, /// Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs. #[arg(long, short = 'C', alias = "config-settings")] @@ -1105,11 +1110,16 @@ pub(crate) struct PipInstallArgs { /// /// The compile option will process the entire site-packages directory for consistency and /// (like pip) ignore all errors. - #[arg(long, overrides_with("no_compile"))] - pub(crate) compile: bool, + #[arg(long, alias = "compile", overrides_with("no_compile_bytecode"))] + pub(crate) compile_bytecode: bool, - #[arg(long, overrides_with("compile"), hide = true)] - pub(crate) no_compile: bool, + #[arg( + long, + alias = "no_compile", + overrides_with("compile_bytecode"), + hide = true + )] + pub(crate) no_compile_bytecode: bool, /// Settings to pass to the PEP 517 build backend, specified as `KEY=VALUE` pairs. #[arg(long, short = 'C', alias = "config-settings")] diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 377b8c872..fac3eff45 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -256,8 +256,8 @@ impl PipSyncSettings { build, no_binary, only_binary, - compile, - no_compile, + compile_bytecode, + no_compile_bytecode, config_setting, strict, no_strict, @@ -300,7 +300,7 @@ impl PipSyncSettings { config_settings.into_iter().collect::() }), link_mode, - compile_bytecode: flag(compile, no_compile), + compile_bytecode: flag(compile_bytecode, no_compile_bytecode), require_hashes: flag(require_hashes, no_require_hashes), ..PipOptions::default() }, @@ -378,8 +378,8 @@ impl PipInstallSettings { build, no_binary, only_binary, - compile, - no_compile, + compile_bytecode, + no_compile_bytecode, config_setting, strict, no_strict, @@ -440,7 +440,7 @@ impl PipInstallSettings { }), exclude_newer, link_mode, - compile_bytecode: flag(compile, no_compile), + compile_bytecode: flag(compile_bytecode, no_compile_bytecode), require_hashes: flag(require_hashes, no_require_hashes), ..PipOptions::default() },