Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-typer for openSUSE:Factory 
checked in at 2025-09-08 09:56:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-typer (Old)
 and      /work/SRC/openSUSE:Factory/.python-typer.new.1977 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-typer"

Mon Sep  8 09:56:26 2025 rev:26 rq:1303004 version:0.17.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-typer/python-typer.changes        
2025-09-01 17:16:47.587391491 +0200
+++ /work/SRC/openSUSE:Factory/.python-typer.new.1977/python-typer.changes      
2025-09-08 09:56:32.895959392 +0200
@@ -2 +2,7 @@
-Sat Aug 30 14:32:00 UTC 2025 - Matthias Bach <[email protected]>
+Sat Sep  6 09:01:49 UTC 2025 - Matthias Bach <[email protected]> - 0.17.4
+
+- Update to 0.17.4
+  * Make sure rich.markup is imported when rendering help text.
+
+-------------------------------------------------------------------
+Sat Aug 30 14:32:00 UTC 2025 - Matthias Bach <[email protected]> - 0.17.3

Old:
----
  typer-0.17.3.tar.gz

New:
----
  typer-0.17.4.tar.gz

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

Other differences:
------------------
++++++ python-typer.spec ++++++
--- /var/tmp/diff_new_pack.TerHFE/_old  2025-09-08 09:56:34.312018248 +0200
+++ /var/tmp/diff_new_pack.TerHFE/_new  2025-09-08 09:56:34.316018415 +0200
@@ -26,7 +26,7 @@
 %endif
 %{?sle15_python_module_pythons}
 Name:           python-typer
-Version:        0.17.3
+Version:        0.17.4
 Release:        0
 Summary:        Typer, build great CLIs. Easy to code. Based on Python type 
hints
 License:        MIT

++++++ typer-0.17.3.tar.gz -> typer-0.17.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/PKG-INFO new/typer-0.17.4/PKG-INFO
--- old/typer-0.17.3/PKG-INFO   1970-01-01 01:00:00.000000000 +0100
+++ new/typer-0.17.4/PKG-INFO   1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: typer
-Version: 0.17.3
+Version: 0.17.4
 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints.
 Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <[email protected]>
 Classifier: Intended Audience :: Information Technology
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/pyproject.toml 
new/typer-0.17.4/pyproject.toml
--- old/typer-0.17.3/pyproject.toml     2025-08-30 14:35:08.346016400 +0200
+++ new/typer-0.17.4/pyproject.toml     2025-09-05 20:14:27.780933100 +0200
@@ -42,7 +42,7 @@
     "rich >=10.11.0",
 ]
 readme = "README.md"
-version = "0.17.3"
+version = "0.17.4"
 
 [project.urls]
 Homepage = "https://github.com/fastapi/typer";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/requirements-tests.txt 
new/typer-0.17.4/requirements-tests.txt
--- old/typer-0.17.3/requirements-tests.txt     2025-08-30 14:34:51.968851000 
+0200
+++ new/typer-0.17.4/requirements-tests.txt     2025-09-05 20:14:22.912761200 
+0200
@@ -6,7 +6,7 @@
 pytest-xdist >=1.32.0,<4.0.0
 pytest-sugar >=0.9.4,<1.2.0
 mypy ==1.4.1
-ruff ==0.12.10
+ruff ==0.12.11
 # Needed explicitly by typer-slim
 rich >=10.11.0
 shellingham >=1.3.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/tests/test_rich_utils.py 
new/typer-0.17.4/tests/test_rich_utils.py
--- old/typer-0.17.3/tests/test_rich_utils.py   2025-08-30 14:34:51.971851300 
+0200
+++ new/typer-0.17.4/tests/test_rich_utils.py   2025-09-05 20:14:22.914761300 
+0200
@@ -1,3 +1,5 @@
+import sys
+
 import typer
 import typer.completion
 from typer.testing import CliRunner
@@ -79,3 +81,21 @@
     assert "Hello Rick" in result.stdout
     assert "First: option_1_default" in result.stdout
     assert "Second: Morty" in result.stdout
+
+
+def test_rich_markup_import_regression():
+    # Remove rich.markup if it was imported by other tests
+    if "rich" in sys.modules:
+        rich_module = sys.modules["rich"]
+        if hasattr(rich_module, "markup"):
+            delattr(rich_module, "markup")
+
+    app = typer.Typer(rich_markup_mode=None)
+
+    @app.command()
+    def main(bar: str):
+        pass  # pragma: no cover
+
+    result = runner.invoke(app, ["--help"])
+    assert "Usage" in result.stdout
+    assert "BAR" in result.stdout
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/typer/__init__.py 
new/typer-0.17.4/typer/__init__.py
--- old/typer-0.17.3/typer/__init__.py  2025-08-30 14:34:51.979851200 +0200
+++ new/typer-0.17.4/typer/__init__.py  2025-09-05 20:14:22.923761600 +0200
@@ -1,6 +1,6 @@
 """Typer, build great CLIs. Easy to code. Based on Python type hints."""
 
-__version__ = "0.17.3"
+__version__ = "0.17.4"
 
 from shutil import get_terminal_size as get_terminal_size
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/typer/core.py 
new/typer-0.17.4/typer/core.py
--- old/typer-0.17.3/typer/core.py      2025-08-30 14:34:51.980851400 +0200
+++ new/typer-0.17.4/typer/core.py      2025-09-05 20:14:22.923761600 +0200
@@ -372,7 +372,9 @@
             extra_str = f"[{extra_str}]"
             if rich is not None:
                 # This is needed for when we want to export to HTML
-                extra_str = rich.markup.escape(extra_str).strip()
+                from . import rich_utils
+
+                extra_str = rich_utils.escape_before_html_export(extra_str)
 
             help = f"{help}  {extra_str}" if help else f"{extra_str}"
         return name, help
@@ -583,7 +585,9 @@
             extra_str = f"[{extra_str}]"
             if rich is not None:
                 # This is needed for when we want to export to HTML
-                extra_str = rich.markup.escape(extra_str).strip()
+                from . import rich_utils
+
+                extra_str = rich_utils.escape_before_html_export(extra_str)
 
             help = f"{help}  {extra_str}" if help else f"{extra_str}"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/typer/main.py 
new/typer-0.17.4/typer/main.py
--- old/typer-0.17.3/typer/main.py      2025-08-30 14:34:51.980851400 +0200
+++ new/typer-0.17.4/typer/main.py      2025-09-05 20:14:22.923761600 +0200
@@ -75,28 +75,19 @@
         return
     typer_path = os.path.dirname(__file__)
     click_path = os.path.dirname(click.__file__)
-    supress_internal_dir_names = [typer_path, click_path]
+    internal_dir_names = [typer_path, click_path]
     exc = exc_value
     if rich:
-        from rich.traceback import Traceback
-
         from . import rich_utils
 
-        rich_tb = Traceback.from_exception(
-            type(exc),
-            exc,
-            exc.__traceback__,
-            show_locals=exception_config.pretty_exceptions_show_locals,
-            suppress=supress_internal_dir_names,
-            width=rich_utils.MAX_WIDTH,
-        )
+        rich_tb = rich_utils.get_traceback(exc, exception_config, 
internal_dir_names)
         console_stderr = rich_utils._get_rich_console(stderr=True)
         console_stderr.print(rich_tb)
         return
     tb_exc = traceback.TracebackException.from_exception(exc)
     stack: List[FrameSummary] = []
     for frame in tb_exc.stack:
-        if any(frame.filename.startswith(path) for path in 
supress_internal_dir_names):
+        if any(frame.filename.startswith(path) for path in internal_dir_names):
             if not exception_config.pretty_exceptions_short:
                 # Hide the line for internal libraries, Typer and Click
                 stack.append(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/typer-0.17.3/typer/rich_utils.py 
new/typer-0.17.4/typer/rich_utils.py
--- old/typer-0.17.3/typer/rich_utils.py        2025-08-30 14:34:51.980851400 
+0200
+++ new/typer-0.17.4/typer/rich_utils.py        2025-09-05 20:14:22.924761500 
+0200
@@ -16,11 +16,14 @@
 from rich.emoji import Emoji
 from rich.highlighter import RegexHighlighter
 from rich.markdown import Markdown
+from rich.markup import escape
 from rich.padding import Padding
 from rich.panel import Panel
 from rich.table import Table
 from rich.text import Text
 from rich.theme import Theme
+from rich.traceback import Traceback
+from typer.models import DeveloperExceptionConfig
 
 if sys.version_info >= (3, 9):
     from typing import Literal
@@ -727,6 +730,11 @@
     console.print(ABORTED_TEXT, style=STYLE_ABORTED)
 
 
+def escape_before_html_export(input_text: str) -> str:
+    """Ensure that the input string can be used for HTML export."""
+    return escape(input_text).strip()
+
+
 def rich_to_html(input_text: str) -> str:
     """Print the HTML version of a rich-formatted input string.
 
@@ -744,3 +752,19 @@
     """Remove rich tags and render a pure text representation"""
     console = _get_rich_console()
     return "".join(segment.text for segment in 
console.render(text)).rstrip("\n")
+
+
+def get_traceback(
+    exc: BaseException,
+    exception_config: DeveloperExceptionConfig,
+    internal_dir_names: List[str],
+) -> Traceback:
+    rich_tb = Traceback.from_exception(
+        type(exc),
+        exc,
+        exc.__traceback__,
+        show_locals=exception_config.pretty_exceptions_show_locals,
+        suppress=internal_dir_names,
+        width=MAX_WIDTH,
+    )
+    return rich_tb

Reply via email to