Show dev resolve output (#277)

Show the resolution in a concise format for puffin-dev. Note that this
doesn't affect the main puffin output, it's just more convenient for me
when developing.
This commit is contained in:
konsti 2023-11-01 16:54:47 +01:00 committed by GitHub
parent d1af90163b
commit b0678aa6fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@ use std::path::{Path, PathBuf};
use clap::Parser;
use directories::ProjectDirs;
use itertools::Itertools;
use pep508_rs::Requirement;
use platform_host::Platform;
@ -34,7 +35,10 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> anyhow::Result<()> {
fs::canonicalize(venv.python_executable())?,
);
build_dispatch.resolve(&args.requirements).await?;
let mut resolution = build_dispatch.resolve(&args.requirements).await?;
resolution.sort_unstable_by(|a, b| a.name.cmp(&b.name));
// Concise format for dev
println!("{}", resolution.iter().map(ToString::to_string).join(" "));
Ok(())
}