mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Use anstream
to avoid writing colorized output (#415)
A more robust solution to avoiding colorized output by ensuring we write to `stdout` and `stderr` via the [`anstream`](https://docs.rs/anstream/latest/anstream/) crate. Closes https://github.com/astral-sh/puffin/issues/393.
This commit is contained in:
parent
76a41066ac
commit
0af2f7e39f
7 changed files with 17 additions and 14 deletions
|
@ -23,6 +23,7 @@ puffin-interpreter = { path = "../puffin-interpreter" }
|
|||
pypi-types = { path = "../pypi-types" }
|
||||
puffin-traits = { path = "../puffin-traits" }
|
||||
|
||||
anstream = { workspace = true }
|
||||
anyhow = { workspace = true }
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
colored = { workspace = true }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anstream::println;
|
||||
use clap::Parser;
|
||||
use directories::ProjectDirs;
|
||||
use itertools::Itertools;
|
||||
|
@ -46,8 +47,12 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> anyhow::Result<()> {
|
|||
|
||||
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(" "));
|
||||
#[allow(clippy::print_stderr, clippy::ignored_unit_patterns)]
|
||||
{
|
||||
println!("{}", resolution.iter().map(ToString::to_string).join(" "));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue