mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +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
|
@ -5,6 +5,7 @@ use anyhow::{Context, Result};
|
|||
use clap::Parser;
|
||||
use fs_err as fs;
|
||||
|
||||
use distribution_types::IndexUrls;
|
||||
use platform_host::Platform;
|
||||
use puffin_build::{SourceBuild, SourceBuildContext};
|
||||
use puffin_cache::{Cache, CacheArgs};
|
||||
|
@ -12,7 +13,6 @@ use puffin_client::RegistryClientBuilder;
|
|||
use puffin_dispatch::BuildDispatch;
|
||||
use puffin_interpreter::Virtualenv;
|
||||
use puffin_traits::{BuildContext, BuildKind};
|
||||
use pypi_types::IndexUrls;
|
||||
|
||||
#[derive(Parser)]
|
||||
pub(crate) struct BuildArgs {
|
||||
|
|
|
@ -9,7 +9,9 @@ use itertools::{Either, Itertools};
|
|||
use rustc_hash::FxHashMap;
|
||||
use tracing::info;
|
||||
|
||||
use distribution_types::{CachedDist, Dist, DistributionMetadata, Name, Resolution, VersionOrUrl};
|
||||
use distribution_types::{
|
||||
CachedDist, Dist, DistributionMetadata, IndexUrls, Name, Resolution, VersionOrUrl,
|
||||
};
|
||||
use install_wheel_rs::linker::LinkMode;
|
||||
use pep508_rs::Requirement;
|
||||
use platform_host::Platform;
|
||||
|
@ -23,7 +25,6 @@ use puffin_interpreter::Virtualenv;
|
|||
use puffin_normalize::PackageName;
|
||||
use puffin_resolver::DistFinder;
|
||||
use puffin_traits::{BuildContext, OnceMap};
|
||||
use pypi_types::IndexUrls;
|
||||
|
||||
#[derive(Parser)]
|
||||
pub(crate) struct InstallManyArgs {
|
||||
|
|
|
@ -5,20 +5,18 @@ use anstream::println;
|
|||
use anyhow::{Context, Result};
|
||||
use chrono::{DateTime, Utc};
|
||||
use clap::{Parser, ValueEnum};
|
||||
|
||||
use fs_err::File;
|
||||
use itertools::Itertools;
|
||||
use petgraph::dot::{Config as DotConfig, Dot};
|
||||
|
||||
use distribution_types::IndexUrls;
|
||||
use pep508_rs::Requirement;
|
||||
use platform_host::Platform;
|
||||
|
||||
use puffin_cache::{Cache, CacheArgs};
|
||||
use puffin_client::RegistryClientBuilder;
|
||||
use puffin_dispatch::BuildDispatch;
|
||||
use puffin_interpreter::Virtualenv;
|
||||
use puffin_resolver::{Manifest, ResolutionOptions, Resolver};
|
||||
use pypi_types::IndexUrls;
|
||||
|
||||
#[derive(ValueEnum, Default, Clone)]
|
||||
pub(crate) enum ResolveCliFormat {
|
||||
|
|
|
@ -11,6 +11,7 @@ use tokio::time::Instant;
|
|||
use tracing::{info, info_span, span, Level, Span};
|
||||
use tracing_indicatif::span_ext::IndicatifSpanExt;
|
||||
|
||||
use distribution_types::IndexUrls;
|
||||
use pep508_rs::Requirement;
|
||||
use platform_host::Platform;
|
||||
use puffin_cache::{Cache, CacheArgs};
|
||||
|
@ -19,7 +20,6 @@ use puffin_dispatch::BuildDispatch;
|
|||
use puffin_interpreter::Virtualenv;
|
||||
use puffin_normalize::PackageName;
|
||||
use puffin_traits::BuildContext;
|
||||
use pypi_types::IndexUrls;
|
||||
|
||||
#[derive(Parser)]
|
||||
pub(crate) struct ResolveManyArgs {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue