-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Color support on Windows: TerminalWriter (PY_COLORS), colorama (PYCHARM_HOSTED) #1468
Comments
We'd happy to fix this if someone can investigate and come up with a PR for it. |
I'd be happy to investigate if I have any reference. Currently, |
Here is a minimal reproducer GitHub Actions workflow: name: "tox"
on: [push]
jobs:
tox:
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ ubuntu, windows ]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/setup-python@v1
with:
python-version: 3.7
- uses: actions/checkout@v1
- run: pip3 install tox --progress-bar off
- run: tox -e py37-test
- run: tox -e py37-test
env:
PY_COLORS: 1 |
Upon further investigation, it seems that Lines 101 to 102 in 9ee972e
Lines 72 to 75 in 9ee972e
Lines 77 to 83 in 9ee972e
Line 38 in 9ee972e
Hence,
Looking at the source of This issue might be related to the fact that Unfortunately, colorama is currently not installed as a dependency; users need to do it explicitly. Moreover, it seems to be used only when a tty is available: As a result, it might be a bug in
An alternative solution to properly honouring |
Closed via #1471 |
@gaborbernat, note that this was not closed automatically on purpose. #1471 is just a quick fix and it might seem to work, but I believe that this issue needs to remain open. Let me elaborate: With the current version of TerminalWriter, ensuring that colorama is installed will avoid Hence, the current This is an effort to bring TerminalWriter to tox's codebase and clean it up so that Hence, as commented above, I think that it would make sense if colorama supported Anyway, I later found #1400. It seems that |
My available efforts at the moment are aimed at fixing this as part of #1394, but that probably will take a while (ETA September). |
I think this has been fixed on version 4 by using the colorama package. |
While running several tests with
tox
on GitHub Actions environments, tox's output is not coloured by default (see actions/starter-workflows#114). SettingPY_COLORS: 1
(#1009) works for jobs running on GNU/Linux (ubuntu-latest
). Unfortunately, it seems not to be effective onwindows-latest
.ubuntu-latest
: https://github.com/1138-4EB/vunit/runs/326860648#step:5:29windows-latest
: https://github.com/1138-4EB/vunit/runs/326860617#step:7:31Note that, in those examples, the output of the commands executed by tox is coloured because
--color=yes
is explicitly passed topytest
through{posargs}
.The text was updated successfully, but these errors were encountered: