Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-rich-argparse for 
openSUSE:Factory checked in at 2026-02-18 17:04:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rich-argparse (Old)
 and      /work/SRC/openSUSE:Factory/.python-rich-argparse.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-rich-argparse"

Wed Feb 18 17:04:37 2026 rev:2 rq:1333717 version:1.7.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-rich-argparse/python-rich-argparse.changes    
    2025-09-11 14:39:06.587211123 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-rich-argparse.new.1977/python-rich-argparse.changes
      2026-02-18 17:04:54.128405966 +0100
@@ -1,0 +2,8 @@
+Wed Feb 18 09:54:45 UTC 2026 - Daniel Garcia <[email protected]>
+
+- update to 1.7.2:
+  * PR-171 Fix colors overlapping with Python 3.14.0+ which enabled
+    colors by default in the help formatter.
+- Add upstream patch fix-tests.patch, gh#hamdanal/rich-argparse#178
+
+-------------------------------------------------------------------

Old:
----
  rich_argparse-1.7.1.tar.gz

New:
----
  fix-tests.patch
  rich_argparse-1.7.2.tar.gz

----------(New B)----------
  New:    colors by default in the help formatter.
- Add upstream patch fix-tests.patch, gh#hamdanal/rich-argparse#178
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-rich-argparse.spec ++++++
--- /var/tmp/diff_new_pack.VcYUSY/_old  2026-02-18 17:04:58.968607421 +0100
+++ /var/tmp/diff_new_pack.VcYUSY/_new  2026-02-18 17:04:58.968607421 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-rich-argparse
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,17 @@
 
 
 Name:           python-rich-argparse
-Version:        1.7.1
+Version:        1.7.2
 Release:        0
 Summary:        Rich help formatters for argparse and optparse
 License:        MIT
 URL:            https://github.com/hamdanal/rich-argparse
 Source:         
https://files.pythonhosted.org/packages/source/r/rich-argparse/rich_argparse-%{version}.tar.gz
-BuildRequires:  python-rpm-macros
+# PATCH-FIX-UPSTREAM fix-tests.patch 
https://github.com/hamdanal/rich-argparse/pull/178
+Patch0:         fix-tests.patch
 BuildRequires:  %{python_module hatchling >= 1.11.0}
 BuildRequires:  %{python_module pip}
+BuildRequires:  python-rpm-macros
 # SECTION test requirements
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module rich >= 11.0.0}

++++++ fix-tests.patch ++++++
>From 92fe8a5f5fb754ad27b20ead065b8bf9fa10fc1c Mon Sep 17 00:00:00 2001
From: Ali Hamdan <[email protected]>
Date: Sun, 25 Jan 2026 11:12:30 +0100
Subject: [PATCH 1/2] Update pre-commit and fix nightly tests

---
 .pre-commit-config.yaml |  4 ++--
 pyproject.toml          |  1 +
 tests/test_argparse.py  | 12 ++++--------
 3 files changed, 7 insertions(+), 10 deletions(-)

Index: rich_argparse-1.7.2/pyproject.toml
===================================================================
--- rich_argparse-1.7.2.orig/pyproject.toml
+++ rich_argparse-1.7.2/pyproject.toml
@@ -68,6 +68,7 @@ flake8-tidy-imports.ban-relative-imports
 python_version = "3.8"
 strict = true
 local_partial_types = true
+allow_redefinition_new = true
 
 [[tool.mypy.overrides]]
 module = ["tests.*"]
Index: rich_argparse-1.7.2/tests/test_argparse.py
===================================================================
--- rich_argparse-1.7.2.orig/tests/test_argparse.py
+++ rich_argparse-1.7.2/tests/test_argparse.py
@@ -899,11 +899,11 @@ def test_rich_renderables():
 
     This is a \x1b[1mdescription\x1b[0m
 
-    
\x1b[33m──────────────────────────────────────────────────────────────────────────────────────────────────\x1b[0m
+    
\x1b[2m--------------------------------------------------------------------------------------------------\x1b[0m
 
-     \x1b[1m \x1b[0m\x1b[1mfoo\x1b[0m\x1b[1m \x1b[0m \x1b[1m 
\x1b[0m\x1b[1mbar\x1b[0m
-     ━━━━━━━━━━━
-      1     2
+    \x1b[36m \x1b[0m\x1b[36mfoo\x1b[0m\x1b[1m \x1b[0m\x1b[36m 
\x1b[0m\x1b[36mbar\x1b[0m
+    \x1b[36m ────────\x1b[0m
+    \x1b[36m \x1b[0m1   \x1b[36m \x1b[0m2
 
     \x1b[38;5;208mOptional Arguments:\x1b[0m
       \x1b[36m-h\x1b[0m, \x1b[36m--help\x1b[0m  \x1b[39mshow this help message 
and exit\x1b[0m

++++++ rich_argparse-1.7.1.tar.gz -> rich_argparse-1.7.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/CHANGELOG.md 
new/rich_argparse-1.7.2/CHANGELOG.md
--- old/rich_argparse-1.7.1/CHANGELOG.md        2020-02-02 01:00:00.000000000 
+0100
+++ new/rich_argparse-1.7.2/CHANGELOG.md        2020-02-02 01:00:00.000000000 
+0100
@@ -1,5 +1,11 @@
 # Change Log
 
+## 1.7.2 - 2025-11-01
+
+### Fixes
+- [PR-171](https://github.com/hamdanal/rich-argparse/pull/171)
+  Fix colors overlapping with Python 3.14.0+ which enabled colors by default 
in the help formatter.
+
 ## 1.7.1 - 2025-05-25
 
 ### Fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/PKG-INFO 
new/rich_argparse-1.7.2/PKG-INFO
--- old/rich_argparse-1.7.1/PKG-INFO    2020-02-02 01:00:00.000000000 +0100
+++ new/rich_argparse-1.7.2/PKG-INFO    2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: rich-argparse
-Version: 1.7.1
+Version: 1.7.2
 Summary: Rich help formatters for argparse and optparse
 Project-URL: Homepage, https://github.com/hamdanal/rich-argparse
 Project-URL: Documentation, 
https://github.com/hamdanal/rich-argparse#rich-argparse
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/pyproject.toml 
new/rich_argparse-1.7.2/pyproject.toml
--- old/rich_argparse-1.7.1/pyproject.toml      2020-02-02 01:00:00.000000000 
+0100
+++ new/rich_argparse-1.7.2/pyproject.toml      2020-02-02 01:00:00.000000000 
+0100
@@ -4,7 +4,7 @@
 
 [project]
 name = "rich-argparse"
-version = "1.7.1"
+version = "1.7.2"
 description = "Rich help formatters for argparse and optparse"
 authors = [
   {name="Ali Hamdan", email="[email protected]"},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/rich_argparse/_argparse.py 
new/rich_argparse-1.7.2/rich_argparse/_argparse.py
--- old/rich_argparse-1.7.1/rich_argparse/_argparse.py  2020-02-02 
01:00:00.000000000 +0100
+++ new/rich_argparse-1.7.2/rich_argparse/_argparse.py  2020-02-02 
01:00:00.000000000 +0100
@@ -12,6 +12,7 @@
 from rich_argparse._common import (
     _HIGHLIGHTS,
     _fix_legacy_win_text,
+    _strip_codes,
     rich_fill,
     rich_strip,
     rich_wrap,
@@ -114,6 +115,12 @@
     def console(self, console: r.Console) -> None:
         self._console = console
 
+    if sys.version_info >= (3, 14):  # pragma: >=3.14 cover
+
+        def _set_color(self, color: bool) -> None:
+            # Override to disable color setting in argparse.HelpFormatter for 
Python 3.14+
+            return super()._set_color(False)
+
     class _Section(argparse.HelpFormatter._Section):
         def __init__(
             self, formatter: RichHelpFormatter, parent: Self | None, heading: 
str | None = None
@@ -216,16 +223,15 @@
             return
         if prefix is None:
             prefix = self._format_usage(usage="", actions=(), groups=(), 
prefix=None).rstrip("\n")
+        prefix = _strip_codes(prefix)
         prefix_end = ": " if prefix.endswith(": ") else ""
         prefix = prefix[: len(prefix) - len(prefix_end)]
-        prefix = 
r.strip_control_codes(type(self).group_name_formatter(prefix)) + prefix_end
+        prefix = type(self).group_name_formatter(prefix) + prefix_end
 
         usage_spans = [r.Span(0, len(prefix.rstrip()), "argparse.groups")]
-        usage_text = r.strip_control_codes(
-            self._format_usage(usage, actions, groups, prefix=prefix)
-        )
+        usage_text = _strip_codes(self._format_usage(usage, actions, groups, 
prefix=prefix))
         if usage is None:  # get colour spans for generated usage
-            prog = r.strip_control_codes(f"{self._prog}")
+            prog = _strip_codes(f"{self._prog}")
             if actions:
                 prog_start = usage_text.index(prog, len(prefix))
                 usage_spans.append(r.Span(prog_start, prog_start + len(prog), 
"argparse.prog"))
@@ -287,7 +293,7 @@
         pos = start
 
         def find_span(_string: str) -> tuple[int, int]:
-            stripped = r.strip_control_codes(_string)
+            stripped = _strip_codes(_string)
             _start = text.index(stripped, pos)
             _end = _start + len(stripped)
             return _start, _end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/rich_argparse/_common.py 
new/rich_argparse-1.7.2/rich_argparse/_common.py
--- old/rich_argparse-1.7.1/rich_argparse/_common.py    2020-02-02 
01:00:00.000000000 +0100
+++ new/rich_argparse-1.7.2/rich_argparse/_common.py    2020-02-02 
01:00:00.000000000 +0100
@@ -42,6 +42,11 @@
     return r.Text("\n").join(indent + line for line in lines)
 
 
+def _strip_codes(text: str) -> str:
+    """Remove ANSI color codes and control codes from a string."""
+    return r.re_ansi.sub("", r.strip_control_codes(text))
+
+
 def _initialize_win_colors() -> bool:  # pragma: no cover
     global _windows_console_fixed
     assert sys.platform == "win32"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/tests/conftest.py 
new/rich_argparse-1.7.2/tests/conftest.py
--- old/rich_argparse-1.7.1/tests/conftest.py   2020-02-02 01:00:00.000000000 
+0100
+++ new/rich_argparse-1.7.2/tests/conftest.py   2020-02-02 01:00:00.000000000 
+0100
@@ -24,7 +24,7 @@
 
 @pytest.fixture()
 def force_color():
-    with patch("rich.console.Console.is_terminal", return_value=True):
+    with patch.dict(os.environ, {"FORCE_COLOR": "1"}):
         yield
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rich_argparse-1.7.1/tests/test_argparse.py 
new/rich_argparse-1.7.2/tests/test_argparse.py
--- old/rich_argparse-1.7.1/tests/test_argparse.py      2020-02-02 
01:00:00.000000000 +0100
+++ new/rich_argparse-1.7.2/tests/test_argparse.py      2020-02-02 
01:00:00.000000000 +0100
@@ -696,18 +696,38 @@
     assert rich_child1.format_usage() == (
         "\x1b[38;5;208mUsage:\x1b[0m \x1b[38;5;244mPROG sp1\x1b[0m 
[\x1b[36m-h\x1b[0m]\n"
     )
-    assert rich_child2.format_usage() == "usage: PROG sp2 [-h]\n"
+    if sys.version_info < (3, 14):  # pragma: <3.14 cover
+        assert rich_child2.format_usage() == "usage: PROG sp2 [-h]\n"
+    else:  # pragma: >=3.14 cover
+        # Python 3.14 adds ANSI color codes to the default usage message
+        assert (
+            rich_child2.format_usage()
+            == "\x1b[1;34musage: \x1b[0m\x1b[1;35mPROG sp2\x1b[0m 
[\x1b[32m-h\x1b[0m]\n"
+        )
 
     # Parent uses original formatter
     orig_parent = ArgumentParser("PROG")
     orig_subparsers = orig_parent.add_subparsers()
     orig_child1 = orig_subparsers.add_parser("sp1", 
formatter_class=RichHelpFormatter)
     orig_child2 = orig_subparsers.add_parser("sp2")
-    assert orig_parent.format_usage() == ("usage: PROG [-h] {sp1,sp2} ...\n")
+    if sys.version_info < (3, 14):  # pragma: <3.14 cover
+        assert orig_parent.format_usage() == ("usage: PROG [-h] {sp1,sp2} 
...\n")
+    else:  # pragma: >=3.14 cover
+        # Python 3.14 adds ANSI color codes to the default usage message
+        assert orig_parent.format_usage() == (
+            "\x1b[1;34musage: \x1b[0m\x1b[1;35mPROG\x1b[0m [\x1b[32m-h\x1b[0m] 
\x1b[32m{sp1,sp2} ...\x1b[0m\n"
+        )
     assert orig_child1.format_usage() == (
         "\x1b[38;5;208mUsage:\x1b[0m \x1b[38;5;244mPROG sp1\x1b[0m 
[\x1b[36m-h\x1b[0m]\n"
     )
-    assert orig_child2.format_usage() == "usage: PROG sp2 [-h]\n"
+    if sys.version_info < (3, 14):  # pragma: <3.14 cover
+        assert orig_child2.format_usage() == "usage: PROG sp2 [-h]\n"
+    else:  # pragma: >=3.14 cover
+        # Python 3.14 adds ANSI color codes to the default usage message
+        assert (
+            orig_child2.format_usage()
+            == "\x1b[1;34musage: 
\x1b[0m\x1b[1;35m\x1b[1;34m\x1b[0m\x1b[1;35mPROG\x1b[0m sp2\x1b[0m 
[\x1b[32m-h\x1b[0m]\n"
+        )
 
 
 @pytest.mark.parametrize("ct", string.printable)

Reply via email to