mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Add conversion from lockfile Distribution
to Metadata
(#4706)
## Summary Splitting this out from https://github.com/astral-sh/uv/pull/4495 because it's also useful to reuse the `uv pip tree` code for `uv tree`.
This commit is contained in:
parent
4b19319485
commit
a380e8e4df
2 changed files with 176 additions and 28 deletions
|
@ -253,6 +253,12 @@ impl RequirementSource {
|
|||
}
|
||||
}
|
||||
|
||||
/// Construct a [`RequirementSource`] for a URL source, given a URL parsed into components.
|
||||
pub fn from_verbatim_parsed_url(parsed_url: ParsedUrl) -> Self {
|
||||
let verbatim_url = VerbatimUrl::from_url(Url::from(parsed_url.clone()));
|
||||
RequirementSource::from_parsed_url(parsed_url, verbatim_url)
|
||||
}
|
||||
|
||||
/// Convert the source to a [`VerbatimParsedUrl`], if it's a URL source.
|
||||
pub fn to_verbatim_parsed_url(&self) -> Option<VerbatimParsedUrl> {
|
||||
match &self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue