MYPY_FORCE_COLOR only colours output on Windows, not macOS/Ubuntu
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo il workflow di GitHub Actions fornito con MYPY_FORCE_COLOR impostato su Windows, macOS e Ubuntu, quindi traccia la gestione dei colori da riga di comando utilizzata da mypy. Il lavoro è completato quando l'output a colori forzato appare in modo coerente su tutti e tre i sistemi operativi, anche quando il comando non viene eseguito in un TTY.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100