Remove the flat index types (#7759)

## Summary

I think these really don't pull their weight.
This commit is contained in:
Charlie Marsh 2024-10-15 16:30:37 -07:00 committed by GitHub
parent d31b995511
commit a034a8b83b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 158 additions and 315 deletions

View file

@ -14,7 +14,7 @@ use uv_configuration::{
ConfigSettingEntry, ExportFormat, IndexStrategy, KeyringProviderType, PackageNameSpecifier,
TargetTriple, TrustedHost, TrustedPublishing, VersionControlSystem,
};
use uv_distribution_types::{FlatIndexLocation, Index, IndexUrl};
use uv_distribution_types::{Index, IndexUrl};
use uv_normalize::{ExtraName, PackageName};
use uv_pep508::Requirement;
use uv_pypi_types::VerbatimParsedUrl;
@ -786,18 +786,6 @@ fn parse_index_url(input: &str) -> Result<Maybe<IndexUrl>, String> {
}
}
/// Parse a string into an [`FlatIndexLocation`], mapping the empty string to `None`.
fn parse_flat_index(input: &str) -> Result<Maybe<FlatIndexLocation>, String> {
if input.is_empty() {
Ok(Maybe::None)
} else {
match FlatIndexLocation::from_str(input) {
Ok(url) => Ok(Maybe::Some(url)),
Err(err) => Err(err.to_string()),
}
}
}
/// Parse a string into an [`Index`], mapping the empty string to `None`.
fn parse_index_source(input: &str) -> Result<Maybe<Index>, String> {
if input.is_empty() {
@ -3897,10 +3885,10 @@ pub struct IndexArgs {
long,
short,
env = EnvVars::UV_FIND_LINKS,
value_parser = parse_flat_index,
value_parser = parse_index_url,
help_heading = "Index options"
)]
pub find_links: Option<Vec<Maybe<FlatIndexLocation>>>,
pub find_links: Option<Vec<Maybe<IndexUrl>>>,
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
/// provided via `--find-links`.