2586f655bb
First, replace all usages in files in-place. I used my editor for this. If someone wants to add a one-liner that'd be fun. Then, update directory and file names: ``` # Run twice for nested directories find . -type d -print0 | xargs -0 rename s/puffin/uv/g find . -type d -print0 | xargs -0 rename s/puffin/uv/g # Update files find . -type f -print0 | xargs -0 rename s/puffin/uv/g ``` Then add all the files again ``` # Add all the files again git add crates git add python/uv # This one needs a force-add git add -f crates/uv-trampoline ```
42 lines
1019 B
Rust
42 lines
1019 B
Rust
use std::str::FromStr;
|
|
|
|
use anstream::println;
|
|
use anyhow::Result;
|
|
use clap::Parser;
|
|
|
|
use distribution_filename::WheelFilename;
|
|
use distribution_types::{BuiltDist, DirectUrlBuiltDist};
|
|
use pep508_rs::VerbatimUrl;
|
|
use uv_cache::{Cache, CacheArgs};
|
|
use uv_client::RegistryClientBuilder;
|
|
|
|
#[derive(Parser)]
|
|
pub(crate) struct WheelMetadataArgs {
|
|
url: VerbatimUrl,
|
|
#[command(flatten)]
|
|
cache_args: CacheArgs,
|
|
}
|
|
|
|
pub(crate) async fn wheel_metadata(args: WheelMetadataArgs) -> Result<()> {
|
|
let cache_dir = Cache::try_from(args.cache_args)?;
|
|
|
|
let client = RegistryClientBuilder::new(cache_dir.clone()).build();
|
|
|
|
let filename = WheelFilename::from_str(
|
|
args.url
|
|
.path()
|
|
.rsplit_once('/')
|
|
.unwrap_or(("", args.url.path()))
|
|
.1,
|
|
)?;
|
|
|
|
let metadata = client
|
|
.wheel_metadata(&BuiltDist::DirectUrl(DirectUrlBuiltDist {
|
|
filename,
|
|
url: args.url,
|
|
}))
|
|
.await?;
|
|
println!("{metadata:?}");
|
|
Ok(())
|
|
}
|