mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-28 02:40:11 +00:00
Refactor distribution types to return Result (#470)
## Summary A variety of small refactors to the distribution types crate to (1) return `Result` if we find an invalid wheel, rather than treating it as a source distribution with a `.whl` suffix, and (2) DRY up some repeated code around URLs.
This commit is contained in:
parent
f0841cdb6e
commit
f1aa70d9d3
12 changed files with 119 additions and 97 deletions
|
|
@ -50,6 +50,9 @@ pub enum ResolveError {
|
|||
#[error("Package `{0}` attempted to resolve via URL: {1}. URL dependencies must be expressed as direct requirements or constraints. Consider adding `{0} @ {1}` to your dependencies or constraints file.")]
|
||||
DisallowedUrl(PackageName, Url),
|
||||
|
||||
#[error(transparent)]
|
||||
DistributionType(#[from] distribution_types::Error),
|
||||
|
||||
#[error("Failed to fetch wheel metadata from: {filename}")]
|
||||
RegistryBuiltDist {
|
||||
filename: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue