mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Merge branch 'main' into self-update-json
This commit is contained in:
commit
51bd377d94
2 changed files with 15 additions and 0 deletions
|
@ -18,11 +18,16 @@ use uv_redacted::DisplaySafeUrl;
|
|||
use crate::Pep508Url;
|
||||
|
||||
/// A wrapper around [`Url`] that preserves the original string.
|
||||
///
|
||||
/// The original string is not preserved after serialization/deserialization.
|
||||
#[derive(Debug, Clone, Eq)]
|
||||
pub struct VerbatimUrl {
|
||||
/// The parsed URL.
|
||||
url: DisplaySafeUrl,
|
||||
/// The URL as it was provided by the user.
|
||||
///
|
||||
/// Even if originally set, this will be [`None`] after
|
||||
/// serialization/deserialization.
|
||||
given: Option<ArcStr>,
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use std::fmt::Formatter;
|
|||
use std::sync::Arc;
|
||||
|
||||
use indexmap::IndexSet;
|
||||
use itertools::Itertools;
|
||||
use owo_colors::OwoColorize;
|
||||
use pubgrub::{
|
||||
DefaultStringReporter, DerivationTree, Derived, External, Range, Ranges, Reporter, Term,
|
||||
|
@ -409,6 +410,15 @@ impl NoSolutionError {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get the packages that are involved in this error.
|
||||
pub fn packages(&self) -> impl Iterator<Item = &PackageName> {
|
||||
self.error
|
||||
.packages()
|
||||
.into_iter()
|
||||
.filter_map(|p| p.name())
|
||||
.unique()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for NoSolutionError {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue