-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Provide a FORCE_COLOR variable? #502
Comments
I'm for it. Since there isn't a well-established environment variable for
this, let's use `NOX_FORCE_COLOR`.
…On Fri, Oct 22, 2021 at 3:38 PM Henry Schreiner ***@***.***> wrote:
*How would this feature be useful?*
On GitHub Actions, getting nox to print out color is a bit painful. You
have to remember to add a --forcecolor every invocation (I happen to have
one that does a ton of nox calls).
*Describe the solution you'd like*
A new variable, either FORCECOLOR, or NOXCOLOR, something like that,
could be added to imply --forcecolor. If both FORCECOLOR and NOCOLOR were
set, NOCOLOR would take precedence. From a quick search, tox does not
have this, and pytest uses --color=yes/no/auto, also without an
environment variable. MyPy secretly provides MYPY_FORCE_COLOR. So feel
free to say no. :)
*Describe alternatives you've considered*
I would be very happy if nox simply used color output on GitHub Actions,
not requiring any workaround. Though I think having a way to force color is
still nice, though not as critical as NOCOLOR.
I also tried TERM=xterm-color, which was mentioned in python/mypy#7771
<python/mypy#7771>, but that did not produce
color output.
My suggestions to PRs ratio is not great right now, so I'll try to fix
that in the near future! 😳
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#502>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB5I43GWOVX62ME3EA4AC3UIG4STANCNFSM5GRH5NRQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Backing up a bit, let's talk this through:
|
If we automatically got colors on CI, that would be great. Though you might need to be careful that piping to a log would be colorized (which is not the end of the world, with NOCOLOR available too, and likely rare on CI which logs already). Better CI detection doesn't have to be exclude adding NOX_FORCE_COLOR, though :) |
TERM does not seem to be checked, at least I don't see it. Here's what Rich does: https://github.com/willmcgugan/rich/blob/3331f2a0072f8772de48ff89d139efb0c67583b5/rich/console.py#L753 I don't know if it automatically prints color in CI, though. |
I think you meant Nox supports
Light preference for Edit: added pytest, tox, colorama |
Yep, I did. I'm aware of the standard 1, and I'd have Footnotes
|
Not that Rich is a color support library, not an application, which is why. Do any of those libraries support both |
That's also how I take it.
+1 |
How would this feature be useful?
On GitHub Actions, getting nox to print out color is a bit painful. You have to remember to add a
--forcecolor
every invocation (I happen to have one that does a ton of nox calls).Describe the solution you'd like
A new variable, either
FORCE_COLOR
, orNOX_FORCE_COLOR
, something like that, could be added to imply--forcecolor
. If bothFORCE_COLOR
andNO_COLOR
were set,NO_COLOR
would take precedence. From a quick search, tox does not have this, and pytest uses--color=yes/no/auto
,also without an environment variable(FORCE_COLOR
). MyPy secretly providesMYPY_FORCE_COLOR
. So feel free to say no. :)Describe alternatives you've considered
I would be very happy if nox simply used color output on GitHub Actions, not requiring any workaround. Though I think having a way to force color is still nice, though not as critical as
NO_COLOR
.I also tried
TERM=xterm-color
, which was mentioned in python/mypy#7771, but that did not produce color output.My suggestions to PRs ratio is not great right now, so I'll try to fix that in the near future! 😳
The text was updated successfully, but these errors were encountered: