Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Toralf Förster
On 12/11/23 21:38, Ulrich Mueller wrote: The standard is defined by sno-color.org. http://no-color.org -- Toralf PGP 23217DA7 9B888F45 OpenPGP_signature.asc Description: OpenPGP digital signature

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Ulrich Mueller
> On Mon, 11 Dec 2023, Eli Schwartz wrote: >> "Command-line software which adds ANSI color to its output by default >> should check for a NO_COLOR environment variable that, when present >> and not an empty string (regardless of its value), prevents the >> addition of ANSI color." --

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Eli Schwartz
On 12/11/23 2:27 PM, Michał Górny wrote: > That looks wrong. Per [1]: > >> […] NO_COLOR environment variable that, when present and not an empty > string (regardless of its value), prevents the addition of ANSI color. > > So hey, I'm actually fixing pytest ;-). > > [1] https://no-color.org/

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Eli Schwartz
On 12/11/23 2:30 PM, Ulrich Mueller wrote: >> On Mon, 11 Dec 2023, Eli Schwartz wrote: > >>> + local color=yes >>> + [[ ${NO_COLOR} ]] && color=no > >> [[ -v NO_COLOR ]] > > No, this would give the wrong result if NO_COLOR is set to an empty > value. [[ ${NO_COLOR} ]] or [[ -n

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Ulrich Mueller
> On Mon, 11 Dec 2023, Eli Schwartz wrote: >> +local color=yes >> +[[ ${NO_COLOR} ]] && color=no > [[ -v NO_COLOR ]] No, this would give the wrong result if NO_COLOR is set to an empty value. [[ ${NO_COLOR} ]] or [[ -n ${NO_COLOR} ]] is the correct test: "Command-line software

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Michał Górny
On Mon, 2023-12-11 at 13:57 -0500, Eli Schwartz wrote: > On 12/2/23 7:44 AM, Michał Górny 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

Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-11 Thread Eli Schwartz
On 12/2/23 7:44 AM, Michał Górny 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. > > Signed-off-by: Michał Górny

[gentoo-dev] [PATCH] python-utils-r1.eclass: epytest, use NO_COLOR rather than NOCOLOR

2023-12-02 Thread Michał Górny
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. Signed-off-by: Michał Górny --- eclass/python-utils-r1.eclass | 11