From f202823f3e75b7cd04c312d001ef4dd2b989a876 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 20 Nov 2023 19:22:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=F0=9F=A7=AA=20Unset=20`FORCE=5FCOL?= =?UTF-8?q?OR`=20on=20Bash=20level=20@=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a hack to work around the inability of `Rich` -- and by extension `pip` -- to allow overriding a `FORCE_COLOR` environment variable, made available globally. The following **doesn't** actually work: $ NO_COLOR=1 FORCE_COLOR= python -m pip install yarl --no-color --dry-run --no-deps --report - --quiet | jq --raw-output .install[].download_info.url Ref: https://github.com/Textualize/rich/issues/2622 --- .github/workflows/ci-cd.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f53f93d9..653bcfae 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -167,14 +167,21 @@ jobs: # NOTE: preference here via https://no-color.org. # NOTE: Setting `FORCE_COLOR` to any value (including 0, an empty # NOTE: string, or a "YAML null" `~`) doesn't have any effect and - # NOTE: `pip` (through its verndored copy of `rich`) treats the presence - # NOTE: of the variable as "force-color" regardless. + # NOTE: `pip` (through its verndored copy of `rich`) treats the + # NOTE: presence of the variable as "force-color" regardless. + # + # NOTE: This doesn't actually work either, so we'll resort to unsetting + # NOTE: in the Bash script. + # NOTE: Ref: https://github.com/Textualize/rich/issues/2622 NO_COLOR: 1 id: wheel-file run: > echo -n path= | tee -a "${GITHUB_OUTPUT}" + unset FORCE_COLOR + + python -X utf8 -u -I