MYPY_FORCE_COLOR only colours output on Windows, not macOS/Ubuntu
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
When using MYPY_FORCE_COLOR (or FORCE_COLOR with master) on GitHub Actions (which is not a tty), colour only shows up for Windows, and not for Ubuntu or macOS.
To Reproduce
Test with a worklflow something like this:
name: Test
on: [push, pull_request, workflow_dispatch]
env:
MYPY_FORCE_COLOR: 1
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [
"3.7",
"3.10",
]
os: [
windows-latest,
macOS-latest,
ubuntu-latest,
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install mypy
- name: Test
run: |
mypy test.py
Expected Behavior
Colour output for all three operating systems.
Actual Behavior
Colour output only for Windows:
And not for Ubuntu:
Nor macOS:
For example: https://github.com/hugovk/test/actions/runs/3185917456
Your Environment
- Mypy version used: 0.982
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini(and other config files): none - Python version used: 3.7 and 3.10
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den bereitgestellten GitHub Actions-Workflow mit gesetztem MYPY_FORCE_COLOR unter Windows, macOS und Ubuntu zu reproduzieren, und verfolge dann die von mypy verwendete Befehlszeilen-Farbbehandlung. Erledigt ist die Aufgabe, wenn die erzwungene Farbausgabe auf allen drei Betriebssystemen konsistent erscheint, auch wenn der Befehl nicht in einem TTY ausgeführt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- cli
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100