Skip to content

Commit b813db0

Browse files
committed
Avoid ANSI codes in debug! messages
1 parent d4806ee commit b813db0

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

crates/uv-installer/src/satisfies.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::borrow::Cow;
22
use std::fmt::Debug;
33

4-
use owo_colors::OwoColorize;
4+
55
use same_file::is_same_file;
66
use tracing::{debug, trace};
77
use url::Url;
@@ -399,18 +399,18 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
399399

400400
if let Some(current) = current_tag {
401401
let message = if let Some(pretty) = current.pretty() {
402-
format!("{} (`{}`)", pretty.cyan(), current.cyan())
402+
format!("{pretty} (`{current}`)")
403403
} else {
404-
format!("`{}`", current.cyan())
404+
format!("`{current}`")
405405
};
406406

407407
Some(format!(
408408
"The distribution is compatible with {}, but you're using {}",
409409
wheel_tags
410410
.map(|tag| if let Some(pretty) = tag.pretty() {
411-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
411+
format!("{pretty} (`{tag}`)")
412412
} else {
413-
format!("`{}`", tag.cyan())
413+
format!("`{tag}`")
414414
})
415415
.collect::<Vec<_>>()
416416
.join(", "),
@@ -421,9 +421,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
421421
"The distribution requires {}",
422422
wheel_tags
423423
.map(|tag| if let Some(pretty) = tag.pretty() {
424-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
424+
format!("{pretty} (`{tag}`)")
425425
} else {
426-
format!("`{}`", tag.cyan())
426+
format!("`{tag}`")
427427
})
428428
.collect::<Vec<_>>()
429429
.join(", ")
@@ -436,17 +436,17 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
436436

437437
if let Some(current) = current_tag {
438438
let message = if let Some(pretty) = current.pretty() {
439-
format!("{} (`{}`)", pretty.cyan(), current.cyan())
439+
format!("{pretty} (`{current}`)")
440440
} else {
441-
format!("`{}`", current.cyan())
441+
format!("`{current}`")
442442
};
443443
Some(format!(
444444
"The distribution is compatible with {}, but you're using {}",
445445
wheel_tags
446446
.map(|tag| if let Some(pretty) = tag.pretty() {
447-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
447+
format!("{pretty} (`{tag}`)")
448448
} else {
449-
format!("`{}`", tag.cyan())
449+
format!("`{tag}`")
450450
})
451451
.collect::<Vec<_>>()
452452
.join(", "),
@@ -457,9 +457,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
457457
"The distribution requires {}",
458458
wheel_tags
459459
.map(|tag| if let Some(pretty) = tag.pretty() {
460-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
460+
format!("{pretty} (`{tag}`)")
461461
} else {
462-
format!("`{}`", tag.cyan())
462+
format!("`{tag}`")
463463
})
464464
.collect::<Vec<_>>()
465465
.join(", ")
@@ -472,17 +472,17 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
472472

473473
if let Some(current) = current_tag {
474474
let message = if let Some(pretty) = current.pretty() {
475-
format!("{} (`{}`)", pretty.cyan(), current.cyan())
475+
format!("{pretty} (`{current}`)")
476476
} else {
477-
format!("`{}`", current.cyan())
477+
format!("`{current}`")
478478
};
479479
Some(format!(
480480
"The distribution is compatible with {}, but you're on {}",
481481
wheel_tags
482482
.map(|tag| if let Some(pretty) = tag.pretty() {
483-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
483+
format!("{pretty} (`{tag}`)")
484484
} else {
485-
format!("`{}`", tag.cyan())
485+
format!("`{tag}`")
486486
})
487487
.collect::<Vec<_>>()
488488
.join(", "),
@@ -493,9 +493,9 @@ fn generate_dist_compatibility_hint(wheel_tags: &ExpandedTags, tags: &Tags) -> O
493493
"The distribution requires {}",
494494
wheel_tags
495495
.map(|tag| if let Some(pretty) = tag.pretty() {
496-
format!("{} (`{}`)", pretty.cyan(), tag.cyan())
496+
format!("{pretty} (`{tag}`)")
497497
} else {
498-
format!("`{}`", tag.cyan())
498+
format!("`{tag}`")
499499
})
500500
.collect::<Vec<_>>()
501501
.join(", ")

crates/uv/src/commands/python/install.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ pub(crate) async fn install(
312312
.peekable();
313313

314314
if matching_installations.peek().is_none() {
315-
debug!("No installation found for request `{}`", request.cyan());
315+
debug!("No installation found for request `{}`", request);
316316
unsatisfied.push(Cow::Borrowed(request));
317317
}
318318

@@ -325,7 +325,7 @@ pub(crate) async fn install(
325325
python_downloads_json_url.as_deref(),
326326
) {
327327
Ok(request) => {
328-
debug!("Will reinstall `{}`", installation.key().green());
328+
debug!("Will reinstall `{}`", installation.key());
329329
unsatisfied.push(Cow::Owned(request));
330330
}
331331
Err(err) => {
@@ -344,8 +344,8 @@ pub(crate) async fn install(
344344
// If we have real requests, just ignore the existing installation
345345
debug!(
346346
"Ignoring match `{}` for request `{}` due to `--reinstall` flag",
347-
installation.key().green(),
348-
request.cyan()
347+
installation.key(),
348+
request
349349
);
350350
unsatisfied.push(Cow::Borrowed(request));
351351
break;
@@ -368,12 +368,12 @@ pub(crate) async fn install(
368368
}) {
369369
debug!(
370370
"Found `{}` for request `{}`",
371-
installation.key().green(),
372-
request.cyan(),
371+
installation.key(),
372+
request,
373373
);
374374
Either::Left(installation)
375375
} else {
376-
debug!("No installation found for request `{}`", request.cyan());
376+
debug!("No installation found for request `{}`", request);
377377
Either::Right(Cow::Borrowed(request))
378378
}
379379
})
@@ -395,7 +395,7 @@ pub(crate) async fn install(
395395
debug!(
396396
"Found download `{}` for request `{}`",
397397
request.download,
398-
request.cyan(),
398+
request,
399399
);
400400
})
401401
.map(|request| request.download)

0 commit comments

Comments
 (0)