Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from termcolor to anstream #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hanna-kruppe
Copy link

@hanna-kruppe hanna-kruppe commented Jun 29, 2024

Tested by running the simple example with various flags and environment variables, writing to a tty/pipe/file. I have not tested Windows console support but anstream explicitly supports both legacy wincon and the new ANSI capabilities, and I guess people are exercising that support via clap.

I also tested the new MSRV by running these commands (1.64 does not work):

rm Cargo.lock
CARGO_RESOLVER_SOMETHING_LIKE_PRECEDENCE=something-like-rust-version cargo +nightly -Zmsrv-policy check
cargo +1.65 test

Fix #42

escape8259 = "0.5.2"
anstream = "0.6.14"
Copy link
Author

@hanna-kruppe hanna-kruppe Jun 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this achieves de-duplication for everyone using clap v4.4.6 or later. Earlier clap versions (for MSRV) work, they might just pull in two versions of anstream. That's alright for me, but raises the question of what happens if and when anstream has another semver-breaking release and clap adopts that. This is purely hypothetical at this point, but I think I'd prefer libtest-mimic to follow latest clap as much as feasible. Alternatively, if the breaking changes don't affect the API subset used in libtest-mimic, it could support a range of anstream versions, just like some crates depend on itertools = ">= 0.10, <= 0.12" or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch from termcolor to anstream, like clap?
1 participant