From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id ACC39158013 for ; Mon, 11 Dec 2023 19:27:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1789F2BC03D; Mon, 11 Dec 2023 19:27:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CFFCF2BC014 for ; Mon, 11 Dec 2023 19:27:25 +0000 (UTC) Message-ID: <15796cf6bdf1633a50e10ac52083462f177a7767.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Mon, 11 Dec 2023 20:27:14 +0100 In-Reply-To: <4c6f48a8-ba55-4ae4-b4fa-ebbaae95c155@gmail.com> References: <20231202124443.244613-1-mgorny@gentoo.org> <4c6f48a8-ba55-4ae4-b4fa-ebbaae95c155@gmail.com> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-iQgprbyiuP1S7gzs6u5C" User-Agent: Evolution 3.50.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 56e95a1f-2b98-46d7-b2ef-f834c9ecb84c X-Archives-Hash: 6c137a854b1517b2b8fb04ce44969d11 --=-iQgprbyiuP1S7gzs6u5C Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2023-12-11 at 13:57 -0500, Eli Schwartz wrote: > On 12/2/23 7:44 AM, Micha=C5=82 G=C3=B3rny wrote: > > Update epytest to respect the modern NO_COLOR variable rather than > > Portage's old NOCOLOR. Adjust it to correctly check whether it is set > > at all rather than to a specific value, to match the behavior of pytest > > itself. > >=20 > > Signed-off-by: Micha=C5=82 G=C3=B3rny > > --- > > eclass/python-utils-r1.eclass | 11 ++--------- > > 1 file changed, 2 insertions(+), 9 deletions(-) > >=20 > > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.ecl= ass > > index 394f64a5d139..da9cb820840f 100644 > > --- a/eclass/python-utils-r1.eclass > > +++ b/eclass/python-utils-r1.eclass > > @@ -1336,15 +1336,8 @@ epytest() { > > _python_check_EPYTHON > > _python_check_occluded_packages > > =20 > > - local color > > - case ${NOCOLOR} in > > - true|yes) > > - color=3Dno > > - ;; > > - *) > > - color=3Dyes > > - ;; > > - esac > > + local color=3Dyes > > + [[ ${NO_COLOR} ]] && color=3Dno >=20 >=20 > [[ -v NO_COLOR ]] >=20 > This is processed by the pytest code: >=20 > ``` > if "NO_COLOR" in os.environ: > return False > ``` >=20 That looks wrong. Per [1]: > [=E2=80=A6] NO_COLOR environment variable that, when present and not an e= mpty string (regardless of its value), prevents the addition of ANSI color. So hey, I'm actually fixing pytest ;-). [1] https://no-color.org/ --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-iQgprbyiuP1S7gzs6u5C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmV3YpISHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOsXQH/jbQ/pLrlOodj6smEeDq5opl3PYpTEdg CSMilFyqaobBIzxfxwJiMg4Qd0VpLoREGoFyebeP80YcwBZ8nNRnk2RZSHCDF4Jz fzUvn0cbJdeIIDDumSS0Hj2z9O7drGUuwDmkrKyvwMIEKLqna8+9pWL0fT0VQGPi 7VKxPCg2wCZvhLgvmvcfz+pPyDwJt8yNKBiqk8jGGhjkIut3/XLJdZjiglm6jRR3 y1Wl/lPnNemE8mrgU2ZhoPxKE5WfF6l+0si+yk7xI81swiX7GssgI8ApwhqF9fae uH4j3O4OjNe18DSWXrJx6Pu6fc7U7gU5I2Z7pWg2fwcbhjRhdtUBvCE= =0zGo -----END PGP SIGNATURE----- --=-iQgprbyiuP1S7gzs6u5C--