From 695ea3017fee084c9d2ec17d9b28f8af905e3b63 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+KotlinIsland@users.noreply.github.com> Date: Thu, 8 Dec 2022 09:16:30 +1000 Subject: [PATCH] =?UTF-8?q?(=F0=9F=8E=81)=20canwecolor=F0=9F=9A=80=20(#140?= =?UTF-8?q?51)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last time i checked it wasn't the 1960's. So I think the CI could be colorized. Configured pytest, tox, mypy(#7771) and pipĀ¹ (I already already colorized black and isort when I initially added them) 1: Pip doesn't work yet https://github.com/pypa/pip/issues/10909, so this is just a placedholder for when it (hopefully) soon will. Co-authored-by: KotlinIsland --- .github/workflows/test.yml | 10 ++++++++++ tox.ini | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3fdb83ff15b4..9cc2d82ad911 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,6 +102,16 @@ jobs: name: ${{ matrix.name }} env: TOX_SKIP_MISSING_INTERPRETERS: False + # Rich (pip) + FORCE_COLOR: 1 + # Tox + PY_COLORS: 1 + # Mypy (see https://github.com/python/mypy/issues/7771) + TERM: xterm-color + MYPY_FORCE_COLOR: 1 + MYPY_FORCE_TERMINAL_WIDTH: 200 + # Pytest + PYTEST_ADDOPTS: --color=yes steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/tox.ini b/tox.ini index 92810bed9981..a155ec726386 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ minversion = 3.8.0 skip_missing_interpreters = {env:TOX_SKIP_MISSING_INTERPRETERS:True} envlist = - py36, py37, py38, py39, @@ -14,7 +13,7 @@ isolated_build = true [testenv] description = run the test driver with {basepython} -passenv = PYTEST_XDIST_WORKER_COUNT PROGRAMDATA PROGRAMFILES(X86) +passenv = PYTEST_XDIST_WORKER_COUNT PROGRAMDATA PROGRAMFILES(X86) PYTEST_ADDOPTS deps = -rtest-requirements.txt commands = python -m pytest {posargs} @@ -27,6 +26,7 @@ commands = [testenv:type] description = type check ourselves +passenv = TERM MYPY_FORCE_COLOR MYPY_FORCE_TERMINAL_WIDTH commands = python -m mypy --config-file mypy_self_check.ini -p mypy -p mypyc python -m mypy --config-file mypy_self_check.ini misc --exclude misc/fix_annotate.py --exclude misc/async_matrix.py --exclude misc/sync-typeshed.py