From 0502ba0339dc3c6b7bc448a9fd49ba0a35c15ec8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 2 May 2025 17:30:27 +0300 Subject: [PATCH 1/3] Add argparse color help to What's New --- Doc/whatsnew/3.14.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 2f8b652d47e428..d2afce208b8f17 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -698,6 +698,15 @@ argparse and subparser names if mistyped by the user. (Contributed by Savannah Ostrowski in :gh:`124456`.) +* Introduced the optional *color* parameter to + :class:`argparse.ArgumentParser`, enabling color for help text. + This can be controlled via the :envvar:`PYTHON_COLORS` environment + variable as well as the canonical |NO_COLOR|_ + and |FORCE_COLOR|_ environment variables. + See also :ref:`using-on-controlling-color`. + (Contributed by Hugo van Kemenade in :gh:`130645`.) + + ast --- From a816568b77d05080233f94947f0cc5fbdd46c95c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 May 2025 00:02:11 +0300 Subject: [PATCH 2/3] List PyREPL syntax highlighting and new color things in release highlights --- Doc/whatsnew/3.14.rst | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index d2afce208b8f17..8ed42fffc1c878 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -71,7 +71,12 @@ Summary -- release highlights * :ref:`PEP 761: Discontinuation of PGP signatures ` * :ref:`PEP 765: Disallow return/break/continue that exit a finally block ` * :ref:`PEP 768: Safe external debugger interface for CPython ` -* :ref:`A new type of interpreter ` +* :ref:`A new type of interpreter ` +* :ref:`Syntax highlighting in PyREPL `, + color output in :ref:`unittest `, + :ref:`json ` and + :ref:`calendar ` CLIs, and in + :ref:`argparse ` help Incompatible changes @@ -560,6 +565,9 @@ For further information on how to build Python, see (Contributed by Ken Jin in :gh:`128563`, with ideas on how to implement this in CPython by Mark Shannon, Garrett Gu, Haoran Xu, and Josh Haberman.) + +.. _whatsnew314-pyrepl-highlighting: + Syntax highlighting in PyREPL ----------------------------- @@ -698,6 +706,8 @@ argparse and subparser names if mistyped by the user. (Contributed by Savannah Ostrowski in :gh:`124456`.) + .. _whatsnew314-color-argparse: + * Introduced the optional *color* parameter to :class:`argparse.ArgumentParser`, enabling color for help text. This can be controlled via the :envvar:`PYTHON_COLORS` environment @@ -732,6 +742,9 @@ bdb * The :mod:`bdb` module now supports the :mod:`sys.monitoring` backend. (Contributed by Tian Gao in :gh:`124533`.) + + .. _whatsnew314-color-calendar: + calendar -------- @@ -1030,6 +1043,8 @@ json See the :ref:`JSON command-line interface ` documentation. (Contributed by Trey Hunner in :gh:`122873`.) + .. _whatsnew314-color-json: + * By default, the output of the :ref:`JSON command-line interface ` is highlighted in color. This can be controlled via the :envvar:`PYTHON_COLORS` environment variable as well as the canonical @@ -1476,6 +1491,8 @@ unicodedata * The Unicode database has been updated to Unicode 16.0.0. +.. _whatsnew314-color-unittest: + unittest -------- From ed581dfefd5e8c08bd54c0fce9ae46a5d6e6414f Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 3 May 2025 11:59:37 +0300 Subject: [PATCH 3/3] Simplify --- Doc/whatsnew/3.14.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index 8ed42fffc1c878..51d59b9fc88bc3 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -73,10 +73,10 @@ Summary -- release highlights * :ref:`PEP 768: Safe external debugger interface for CPython ` * :ref:`A new type of interpreter ` * :ref:`Syntax highlighting in PyREPL `, - color output in :ref:`unittest `, + and color output in :ref:`unittest `, + :ref:`argparse `, :ref:`json ` and - :ref:`calendar ` CLIs, and in - :ref:`argparse ` help + :ref:`calendar ` CLIs Incompatible changes