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

Add support for the NO_COLOR environment variable #355

Closed
akaihola opened this issue Apr 10, 2022 · 3 comments · Fixed by #356
Closed

Add support for the NO_COLOR environment variable #355

akaihola opened this issue Apr 10, 2022 · 3 comments · Fixed by #356

Comments

@akaihola
Copy link
Owner

pypa/pip#10909 is so far the "highest profile" discussion I've found on this topic.

It seems that pip and colorama are going to support only FORCE_COLOR=<anything> and NO_COLOR=<anything>, but not PY_COLORS.

On the other hand, Pytest does support PY_COLORS={1|0} and NO_COLOR=<anything> (with PY_COLORS taking precedence).

So in the end it may be best to do the same as Pytest:

  • PY_COLORS={1|0} (taking precedence over other options)
  • NO_COLOR=<anything>
  • and possibly FORCE_COLOR=<anything> (similar to pip and colorama)

As for the true/false discussion, I'm going to make the call to only support PY_COLORS={0|1} for now. Thanks @MatthijsBurgh for initiating the discussion and motivating me to look further into the topic!

Originally posted by @akaihola in #353 (comment)

@MatthijsBurgh
Copy link
Collaborator

Good job. I can only agree with the suggestion. So you want to keep #353 to only support the PY_COLORS and implement the suggested behavior in a new PR?

@akaihola
Copy link
Owner Author

keep #353 to only support the PY_COLORS and implement the suggested behavior in a new PR?

Yes @MatthijsBurgh I think I'd like to have these in separate issues.

The other question then is whether to

@MatthijsBurgh
Copy link
Collaborator

I think option 2/3 is the best one. I think both should be included in the same release. And I think the version should be a minor version bump. So it will be 1.5.0 or 1.6.0 depending on whether you want to wait for this feature or release a version without it for now.

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

Successfully merging a pull request may close this issue.

2 participants