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

[Feature Request] Standardized color awareness via the ${FORCE_COLOR} and ${NO_COLOR} environment variables #393

Open
leycec opened this issue May 29, 2024 · 0 comments

Comments

@leycec
Copy link
Member

leycec commented May 29, 2024

This feature request to my older self ...hi, older self! really hope you got your hair back somehow is to remind myself that Python supports various environment variables to globally control color output across both the Python interpreter itself and third-party packages:

  • ${NO_COLOR}, first introduced under Python 3.13 and taking precedence over ${FORCE_COLOR}.
  • ${FORCE_COLOR}, first introduced under [we have no idea].
  • ${PYTHON_COLOR}, which is unique to the Python interpreter itself and thus irrelevant for our purposes. Begone, foulest environment variable!

@beartype currently supports a @beartype-specific ${BEARTYPE_IS_COLOR} tri-state environment variable enabling end users to externally control colourization of @beartype output. That's great – but insufficient. Instead, @beartype should:

  1. If ${BEARTYPE_IS_COLOR} is explicitly set, defer to that.
  2. Else if ${NO_COLOR} is explicitly set, defer to that.
  3. Else if ${FORCE_COLOR} is explicitly set, defer to that.

Beartype: I have a blistering headache already and it's only Tuesday. 🥴

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

No branches or pull requests

1 participant