-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Remove Crayons per issue 3741, use click echo functions instead #5178
Conversation
I think in the long run we need to deprecate the colorblind environment variable and replace it with a more appropriately named variable. However we do need to consider that we likely had already broken that variable with the current usages of click styling. @oz123 can you think of a way to support disabling the click styling at a global level in pipenv based on enabling a specific flag? |
The appropriate name would be NO_COLOR, see here: https://no-color.org/ rich, which is already used by pip supports it. In the long run, I would like us to use the same infrastructure as pip, hence I would vote in favor using coloring, and progress bars from rich. It's more work, but it is more sustainable for us. As for globally disabling click colors as long we use it, we can steal some code from the click-extras project and monkey patch click to disable the color function. This already supports the familiar no color. Side note; colorblinded users can simply disable colors globally in their tty or use tee:
|
This was originally printed with "yellow" foreground.
if environments.PIPENV_COLORBLIND: | ||
crayons.disable() | ||
#if environments.PIPENV_COLORBLIND: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the spot where it previously switched the NO_COLOR behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am implementing a conditional monkeypatch in this spot on style and secho, they are used separately for composing messages that aren't all one color, also tests for each for the old and new variables. Should an issue be created for deprecating PIPENV_COLORBLIND?
Thank you for contributing to Pipenv!
The issue
Remove crayons per issue 3741
Fixes #3741
The fix
Use click.echo, click.secho, click.style instead
The checklist