Skip to content

Commit 4e09aa3

Browse files
committed
Add support for relative durations in exclude-newer
1 parent ba46a44 commit 4e09aa3

File tree

19 files changed

+1874
-201
lines changed

19 files changed

+1874
-201
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 99 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use uv_pypi_types::VerbatimParsedUrl;
2828
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
2929
use uv_redacted::DisplaySafeUrl;
3030
use uv_resolver::{
31-
AnnotationStyle, ExcludeNewerPackageEntry, ExcludeNewerTimestamp, ForkStrategy, PrereleaseMode,
31+
AnnotationStyle, ExcludeNewerPackageEntry, ExcludeNewerValue, ForkStrategy, PrereleaseMode,
3232
ResolutionMode,
3333
};
3434
use uv_settings::PythonInstallMirrors;
@@ -3041,15 +3041,27 @@ pub struct VenvArgs {
30413041

30423042
/// Limit candidate packages to those that were uploaded prior to the given date.
30433043
///
3044-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
3045-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
3044+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
3045+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
3046+
/// (e.g., `24 hours`, `1 week`, `30 days`).
3047+
///
3048+
/// Relative durations do not respect semantics of the local time zone and are always resolved
3049+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
3050+
/// ignored). Calendar units such as months and years are not allowed.
30463051
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER)]
3047-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
3052+
pub exclude_newer: Option<ExcludeNewerValue>,
30483053

3049-
/// Limit candidate packages for a specific package to those that were uploaded prior to the given date.
3054+
/// Limit candidate packages for a specific package to those that were uploaded prior to the
3055+
/// given date.
3056+
///
3057+
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339
3058+
/// timestamp (e.g., `2006-12-02T02:07:43Z`), a local date in the same format (e.g.,
3059+
/// `2006-12-02`) which use your system's configured time zone, or relative duration (e.g., `24
3060+
/// hours`, `1 week`, `30 days`).
30503061
///
3051-
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
3052-
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
3062+
/// Relative durations do not respect semantics of the local time zone and are always resolved
3063+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
3064+
/// ignored). Calendar units such as months and years are not allowed.
30533065
///
30543066
/// Can be provided multiple times for different packages.
30553067
#[arg(long)]
@@ -5517,15 +5529,27 @@ pub struct ToolUpgradeArgs {
55175529

55185530
/// Limit candidate packages to those that were uploaded prior to the given date.
55195531
///
5520-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
5521-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
5532+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
5533+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
5534+
/// (e.g., `24 hours`, `1 week`, `30 days`).
5535+
///
5536+
/// Relative durations do not respect semantics of the local time zone and are always resolved
5537+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
5538+
/// ignored). Calendar units such as months and years are not allowed.
55225539
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
5523-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
5540+
pub exclude_newer: Option<ExcludeNewerValue>,
55245541

5525-
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
5542+
/// Limit candidate packages for specific packages to those that were uploaded prior to the
5543+
/// given date.
55265544
///
5527-
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
5528-
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
5545+
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339
5546+
/// timestamp (e.g., `2006-12-02T02:07:43Z`), a local date in the same format (e.g.,
5547+
/// `2006-12-02`) which use your system's configured time zone, or relative duration (e.g., `24
5548+
/// hours`, `1 week`, `30 days`).
5549+
///
5550+
/// Relative durations do not respect semantics of the local time zone and are always resolved
5551+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
5552+
/// ignored). Calendar units such as months and years are not allowed.
55295553
///
55305554
/// Can be provided multiple times for different packages.
55315555
#[arg(long, help_heading = "Resolver options")]
@@ -6451,15 +6475,27 @@ pub struct InstallerArgs {
64516475

64526476
/// Limit candidate packages to those that were uploaded prior to the given date.
64536477
///
6454-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
6455-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
6478+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
6479+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
6480+
/// (e.g., `24 hours`, `1 week`, `30 days`).
6481+
///
6482+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6483+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6484+
/// ignored). Calendar units such as months and years are not allowed.
64566485
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
6457-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
6486+
pub exclude_newer: Option<ExcludeNewerValue>,
64586487

6459-
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
6488+
/// Limit candidate packages for specific packages to those that were uploaded prior to the
6489+
/// given date.
6490+
///
6491+
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339
6492+
/// timestamp (e.g., `2006-12-02T02:07:43Z`), a local date in the same format (e.g.,
6493+
/// `2006-12-02`) which use your system's configured time zone, or relative duration (e.g., `24
6494+
/// hours`, `1 week`, `30 days`).
64606495
///
6461-
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
6462-
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
6496+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6497+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6498+
/// ignored). Calendar units such as months and years are not allowed.
64636499
///
64646500
/// Can be provided multiple times for different packages.
64656501
#[arg(long, help_heading = "Resolver options")]
@@ -6671,15 +6707,27 @@ pub struct ResolverArgs {
66716707

66726708
/// Limit candidate packages to those that were uploaded prior to the given date.
66736709
///
6674-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
6675-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
6710+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
6711+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
6712+
/// (e.g., `24 hours`, `1 week`, `30 days`).
6713+
///
6714+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6715+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6716+
/// ignored). Calendar units such as months and years are not allowed.
66766717
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
6677-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
6718+
pub exclude_newer: Option<ExcludeNewerValue>,
66786719

6679-
/// Limit candidate packages for a specific package to those that were uploaded prior to the given date.
6720+
/// Limit candidate packages for specific packages to those that were uploaded prior to the
6721+
/// given date.
6722+
///
6723+
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339
6724+
/// timestamp (e.g., `2006-12-02T02:07:43Z`), a local date in the same format (e.g.,
6725+
/// `2006-12-02`) which use your system's configured time zone, or relative duration (e.g., `24
6726+
/// hours`, `1 week`, `30 days`).
66806727
///
6681-
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
6682-
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
6728+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6729+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6730+
/// ignored). Calendar units such as months and years are not allowed.
66836731
///
66846732
/// Can be provided multiple times for different packages.
66856733
#[arg(long, help_heading = "Resolver options")]
@@ -6887,15 +6935,27 @@ pub struct ResolverInstallerArgs {
68876935

68886936
/// Limit candidate packages to those that were uploaded prior to the given date.
68896937
///
6890-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
6891-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
6938+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
6939+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
6940+
/// (e.g., `24 hours`, `1 week`, `30 days`).
6941+
///
6942+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6943+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6944+
/// ignored). Calendar units such as months and years are not allowed.
68926945
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
6893-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
6946+
pub exclude_newer: Option<ExcludeNewerValue>,
68946947

6895-
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
6948+
/// Limit candidate packages for specific packages to those that were uploaded prior to the
6949+
/// given date.
68966950
///
6897-
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
6898-
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
6951+
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339
6952+
/// timestamp (e.g., `2006-12-02T02:07:43Z`), a local date in the same format (e.g.,
6953+
/// `2006-12-02`) which use your system's configured time zone, or relative duration (e.g., `24
6954+
/// hours`, `1 week`, `30 days`).
6955+
///
6956+
/// Relative durations do not respect semantics of the local time zone and are always resolved
6957+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
6958+
/// ignored). Calendar units such as months and years are not allowed.
68996959
///
69006960
/// Can be provided multiple times for different packages.
69016961
#[arg(long, help_heading = "Resolver options")]
@@ -6995,10 +7055,15 @@ pub struct FetchArgs {
69957055

69967056
/// Limit candidate packages to those that were uploaded prior to the given date.
69977057
///
6998-
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
6999-
/// format (e.g., `2006-12-02`) in your system's configured time zone.
7058+
/// Accepts RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`), local dates in the same format
7059+
/// (e.g., `2006-12-02`) which use your system's configured time zone, and relative durations
7060+
/// (e.g., `24 hours`, `1 week`, `30 days`).
7061+
///
7062+
/// Relative durations do not respect semantics of the local time zone and are always resolved
7063+
/// to a fixed number of seconds assuming that a day is 24 hours (i.e., DST transitions are
7064+
/// ignored). Calendar units such as months and years are not allowed.
70007065
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
7001-
pub exclude_newer: Option<ExcludeNewerTimestamp>,
7066+
pub exclude_newer: Option<ExcludeNewerValue>,
70027067
}
70037068

70047069
#[derive(Args)]

0 commit comments

Comments
 (0)