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

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

hanna-kruppe
Copy link
Contributor

@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
Contributor 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.

Copy link
Owner

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

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

Sorry for the delay getting back to this, I had lots going on. Thank you for the PR!

All changes look good to me. So yeah, depending on the used clap version, some dependencies might be duplicated, but I don't think we can do anything about that. In the latest version, the dependency tree looks fairly small, without any duplicates, so that's good. Lets just merge and release this. One can still deal with breaking changes of these packages later.

@LukasKalbertodt LukasKalbertodt merged commit 57d60db into LukasKalbertodt:master Oct 5, 2024
@hanna-kruppe hanna-kruppe deleted the anstream branch October 5, 2024 09:54
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?
2 participants