From ef5664b8e474c0871e9419518c07ba8bc1e198ff Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 20 Nov 2023 19:09:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A1Use=20`NO=5FCOLOR`=20to=20override?= =?UTF-8?q?=20`FORCE=5FCOLOR`=20@=20pip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, the underlying use of Rich in pip causes this library to treat any presence of the `FORCE_COLOR` env var as a sign it's running in a terminal, even if it's empty. Additionally, GitHub Actions workflows don't have a syntax to unset a globally set environment variable. This means it'll remain in the environment and we can only unset it on the Bash script level. Hopefully, `NO_COLOR` will just work. Ref: https://no-color.org --- .github/workflows/ci-cd.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index e696a774..f53f93d9 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -163,9 +163,13 @@ jobs: - name: Determine pre-compiled compatible wheel env: # NOTE: When `pip` is forced to colorize output piped into `jq`, - # NOTE: the latter can't parse it. So we're disabling it here to - # NOTE: override the value set in the workflow globally. - FORCE_COLOR: ~ + # NOTE: the latter can't parse it. So we're overriding the color + # 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. + NO_COLOR: 1 id: wheel-file run: > echo -n path= | tee -a "${GITHUB_OUTPUT}"