Move ExcludeNewer into its own type (#3041)

## Summary

This makes it easier to add (e.g.) JSON Schema derivations to the type.

If we have support for other dates in the future, we can generalize it
to a `UserDate` or similar.
This commit is contained in:
Charlie Marsh 2024-04-15 16:24:08 -04:00 committed by GitHub
parent 37a43f4b48
commit 1f626bfc73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 96 additions and 61 deletions

View file

@ -3,7 +3,7 @@ use std::path::PathBuf;
use anstream::println;
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
use clap::{Parser, ValueEnum};
use fs_err::File;
use itertools::Itertools;
@ -17,7 +17,7 @@ use uv_configuration::{ConfigSettings, NoBinary, NoBuild, SetupPyStrategy};
use uv_dispatch::BuildDispatch;
use uv_installer::SitePackages;
use uv_interpreter::PythonEnvironment;
use uv_resolver::{FlatIndex, InMemoryIndex, Manifest, Options, Resolver};
use uv_resolver::{ExcludeNewer, FlatIndex, InMemoryIndex, Manifest, Options, Resolver};
use uv_types::{BuildIsolation, HashStrategy, InFlight};
#[derive(ValueEnum, Default, Clone)]
@ -42,7 +42,7 @@ pub(crate) struct ResolveCliArgs {
#[command(flatten)]
cache_args: CacheArgs,
#[arg(long)]
exclude_newer: Option<DateTime<Utc>>,
exclude_newer: Option<ExcludeNewer>,
#[clap(long, short, env = "UV_INDEX_URL")]
index_url: Option<IndexUrl>,
#[clap(long, env = "UV_EXTRA_INDEX_URL")]