mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-23 05:05:02 +00:00
Track file index (#452)
Track the index (or at least its url) where we got a file from across the source code. Fixes #448
This commit is contained in:
parent
6fd582f8b9
commit
46bb18f06e
9 changed files with 86 additions and 39 deletions
|
@ -22,6 +22,7 @@ rfc2047-decoder = { workspace = true }
|
|||
serde = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
indoc = { version = "2.0.4" }
|
||||
|
|
17
crates/pypi-types/src/index_url.rs
Normal file
17
crates/pypi-types/src/index_url.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
use url::Url;
|
||||
|
||||
/// The url of an index, newtype'd to avoid mixing it with file urls
|
||||
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
|
||||
pub struct IndexUrl(Url);
|
||||
|
||||
impl From<Url> for IndexUrl {
|
||||
fn from(url: Url) -> Self {
|
||||
Self(url)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<IndexUrl> for Url {
|
||||
fn from(index: IndexUrl) -> Self {
|
||||
index.0
|
||||
}
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
pub use direct_url::{ArchiveInfo, DirectUrl, VcsInfo, VcsKind};
|
||||
pub use index_url::IndexUrl;
|
||||
pub use lenient_requirement::LenientVersionSpecifiers;
|
||||
pub use metadata::{Error, Metadata21};
|
||||
pub use simple_json::{File, SimpleJson, Yanked};
|
||||
|
||||
mod direct_url;
|
||||
mod index_url;
|
||||
mod lenient_requirement;
|
||||
mod metadata;
|
||||
mod simple_json;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue