Add --exclude-newer to installer arguments (#4785)

## Summary

We already support this in `pip sync` and have it stubbed to `None` in
`sync.
This commit is contained in:
Charlie Marsh 2024-07-03 14:05:05 -04:00 committed by GitHub
parent 37f15367bb
commit d24b075b2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 11 deletions

View file

@ -668,13 +668,6 @@ pub struct PipSyncArgs {
#[command(flatten)]
pub refresh: RefreshArgs,
/// Limit candidate packages to those that were uploaded prior to the given date.
///
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and UTC dates in the same
/// format (e.g., `2006-12-02`).
#[arg(long, env = "UV_EXCLUDE_NEWER")]
pub exclude_newer: Option<ExcludeNewer>,
/// Require a matching hash for each requirement.
///
/// Hash-checking mode is all or nothing. If enabled, _all_ requirements must be provided
@ -2228,6 +2221,13 @@ pub struct InstallerArgs {
#[arg(long, short = 'C', alias = "config-settings")]
pub config_setting: Option<Vec<ConfigSettingEntry>>,
/// Limit candidate packages to those that were uploaded prior to the given date.
///
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and UTC dates in the same
/// format (e.g., `2006-12-02`).
#[arg(long, env = "UV_EXCLUDE_NEWER")]
pub exclude_newer: Option<ExcludeNewer>,
/// The method to use when installing packages from the global cache.
///
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and

View file

@ -76,6 +76,7 @@ impl From<InstallerArgs> for PipOptions {
index_strategy,
keyring_provider,
config_setting,
exclude_newer,
link_mode,
compile_bytecode,
no_compile_bytecode,
@ -88,6 +89,7 @@ impl From<InstallerArgs> for PipOptions {
keyring_provider,
config_settings: config_setting
.map(|config_settings| config_settings.into_iter().collect::<ConfigSettings>()),
exclude_newer,
link_mode,
compile_bytecode: flag(compile_bytecode, no_compile_bytecode),
..PipOptions::from(index_args)
@ -174,6 +176,7 @@ pub fn installer_options(installer_args: InstallerArgs, build_args: BuildArgs) -
index_strategy,
keyring_provider,
config_setting,
exclude_newer,
link_mode,
compile_bytecode,
no_compile_bytecode,
@ -208,6 +211,7 @@ pub fn installer_options(installer_args: InstallerArgs, build_args: BuildArgs) -
keyring_provider,
config_settings: config_setting
.map(|config_settings| config_settings.into_iter().collect::<ConfigSettings>()),
exclude_newer,
link_mode,
compile_bytecode: flag(compile_bytecode, no_compile_bytecode),
no_build: flag(no_build, build),