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:
Charlie Marsh 2023-12-25 15:42:28 -05:00 committed by GitHub
parent 6ff21374dc
commit 188ab75769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 81 additions and 47 deletions

View file

@ -6,13 +6,12 @@ use fs_err as fs;
use rustc_hash::FxHashMap;
use tracing::warn;
use distribution_types::{CachedRegistryDist, CachedWheel};
use distribution_types::{CachedRegistryDist, CachedWheel, IndexUrls};
use pep440_rs::Version;
use platform_tags::Tags;
use puffin_cache::{Cache, CacheBucket, WheelCache};
use puffin_fs::directories;
use puffin_normalize::PackageName;
use pypi_types::IndexUrls;
/// A local index of distributions that originate from a registry, like `PyPI`.
#[derive(Debug)]