From b0678aa6fc3940ee9f6dfce01ad78ae36aecbc59 Mon Sep 17 00:00:00 2001 From: konsti Date: Wed, 1 Nov 2023 16:54:47 +0100 Subject: [PATCH] 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. --- crates/puffin-dev/src/resolve_cli.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/puffin-dev/src/resolve_cli.rs b/crates/puffin-dev/src/resolve_cli.rs index e74e14311..29de6b803 100644 --- a/crates/puffin-dev/src/resolve_cli.rs +++ b/crates/puffin-dev/src/resolve_cli.rs @@ -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(()) }