mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 11:07:59 +00:00
Split File into internal and external type (#729)
## Summary This PR makes the `pypi_types::File` a response-only type (i.e., a type that's only used when deserializing over the wire), and adds a separate internal `File` type. Right now, the representations are similar, but already, we can avoid the "lenient" deserialization on our internal `File` type, and avoid the special-casing of the property names that's required in the JSON. Over time, we can evolve this representation entirely separately from the representation we receive from PyPI and other indexes.
This commit is contained in:
parent
6ff21374dc
commit
188ab75769
27 changed files with 81 additions and 47 deletions
|
|
@ -7,12 +7,11 @@ use rustc_hash::FxHashMap;
|
|||
use thiserror::Error;
|
||||
use url::Url;
|
||||
|
||||
use distribution_types::{BuiltDist, PathBuiltDist, PathSourceDist, SourceDist};
|
||||
use distribution_types::{BuiltDist, IndexUrl, PathBuiltDist, PathSourceDist, SourceDist};
|
||||
use pep508_rs::Requirement;
|
||||
use puffin_distribution::DistributionDatabaseError;
|
||||
use puffin_normalize::PackageName;
|
||||
use puffin_traits::OnceMap;
|
||||
use pypi_types::IndexUrl;
|
||||
|
||||
use crate::pubgrub::{PubGrubPackage, PubGrubReportFormatter, PubGrubVersion};
|
||||
use crate::version_map::VersionMap;
|
||||
|
|
@ -142,7 +141,7 @@ impl std::fmt::Display for NoSolutionError {
|
|||
impl NoSolutionError {
|
||||
/// Update the available versions attached to the error using the given package version index.
|
||||
///
|
||||
/// Only packages used in the error's deriviation tree will be retrieved.
|
||||
/// Only packages used in the error's derivation tree will be retrieved.
|
||||
pub(crate) fn update_available_versions(
|
||||
mut self,
|
||||
package_versions: &OnceMap<PackageName, (IndexUrl, VersionMap)>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue