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 2026-05-21 18:25:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-typer (Old) and /work/SRC/openSUSE:Factory/.python-typer.new.2084 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typer" Thu May 21 18:25:30 2026 rev:34 rq:1354105 version:0.25.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-typer/python-typer.changes 2026-04-28 11:53:41.534835235 +0200 +++ /work/SRC/openSUSE:Factory/.python-typer.new.2084/python-typer.changes 2026-05-21 18:25:53.791005723 +0200 @@ -1,0 +2,9 @@ +Tue May 19 21:10:19 UTC 2026 - Dirk Müller <[email protected]> + +- update to 0.25.1: + * Add Typer Library Skill for Agents. +- update to 0.25.0: + * Don't truncate code lines in traceback when formatted with + Rich. + +------------------------------------------------------------------- Old: ---- typer-0.24.2.tar.gz New: ---- typer-0.25.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typer.spec ++++++ --- /var/tmp/diff_new_pack.2Sav5V/_old 2026-05-21 18:25:55.851090332 +0200 +++ /var/tmp/diff_new_pack.2Sav5V/_new 2026-05-21 18:25:55.871091153 +0200 @@ -25,7 +25,7 @@ %endif %{?sle15_python_module_pythons} Name: python-typer -Version: 0.24.2 +Version: 0.25.1 Release: 0 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints License: MIT ++++++ typer-0.24.2.tar.gz -> typer-0.25.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/PKG-INFO new/typer-0.25.1/PKG-INFO --- old/typer-0.24.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.25.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: typer -Version: 0.24.2 +Version: 0.25.1 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]> License-Expression: MIT @@ -31,7 +31,7 @@ Requires-Python: >=3.10 Requires-Dist: click>=8.2.1 Requires-Dist: shellingham>=1.3.0 -Requires-Dist: rich>=12.3.0 +Requires-Dist: rich>=13.8.0 Requires-Dist: annotated-doc>=0.0.2 Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/pyproject.toml new/typer-0.25.1/pyproject.toml --- old/typer-0.24.2/pyproject.toml 2026-04-22 19:45:31.531579000 +0200 +++ new/typer-0.25.1/pyproject.toml 2026-04-30 21:32:15.839749800 +0200 @@ -39,11 +39,11 @@ dependencies = [ "click >= 8.2.1", "shellingham >=1.3.0", - "rich >=12.3.0", + "rich >=13.8.0", "annotated-doc >=0.0.2", ] readme = "README.md" -version = "0.24.2" +version = "0.25.1" [project.urls] Homepage = "https://github.com/fastapi/typer" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/tests/assets/type_error_rich.py new/typer-0.25.1/tests/assets/type_error_rich.py --- old/typer-0.24.2/tests/assets/type_error_rich.py 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.25.1/tests/assets/type_error_rich.py 2026-04-30 21:32:12.710700800 +0200 @@ -0,0 +1,14 @@ +import typer +import typer.main + +app = typer.Typer() + + [email protected]() +def main(name: str = "morty"): + # The line below will cause TypeError because you cannot concatenate string and integer. + print(name + 3) + + +if __name__ == "__main__": + app() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/tests/test_tracebacks.py new/typer-0.25.1/tests/test_tracebacks.py --- old/typer-0.24.2/tests/test_tracebacks.py 2026-04-22 19:45:28.372724800 +0200 +++ new/typer-0.25.1/tests/test_tracebacks.py 2026-04-30 21:32:12.712700800 +0200 @@ -62,3 +62,46 @@ assert "typer.main.get_command(broken_app)()" in result.stderr assert "print(name + 3)" in result.stderr assert 'TypeError: can only concatenate str (not "int") to str' in result.stderr + + +def test_rich_exceptions_dont_truncate_code_on_wide_terminal(): + file_path = Path(__file__).parent / "assets/type_error_rich.py" + result = subprocess.run( + [sys.executable, "-m", "coverage", "run", str(file_path)], + capture_output=True, + encoding="utf-8", + env={ + **os.environ, + "TERMINAL_WIDTH": "120", + "TYPER_STANDARD_TRACEBACK": "", + "_TYPER_STANDARD_TRACEBACK": "", + }, + ) + + assert ( + "# The line below will cause TypeError because you cannot concatenate string and integer." + in result.stderr + ) + + +def test_rich_exceptions_wrap_words_on_small_width_terminal(): + file_path = Path(__file__).parent / "assets/type_error_rich.py" + result = subprocess.run( + [sys.executable, "-m", "coverage", "run", str(file_path)], + capture_output=True, + encoding="utf-8", + env={ + **os.environ, + "TERMINAL_WIDTH": "80", + "TYPER_STANDARD_TRACEBACK": "", + "_TYPER_STANDARD_TRACEBACK": "", + }, + ) + + # Long line is wrapped, so the full line is not in the output, but parts of it are. + assert "# The line below will cause TypeError because you cannot" in result.stderr + assert "concatenate string and integer." in result.stderr + assert ( + "# The line below will cause TypeError because you cannot concatenate string and integer." + not in result.stderr + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/typer/.agents/skills/typer/SKILL.md new/typer-0.25.1/typer/.agents/skills/typer/SKILL.md --- old/typer-0.24.2/typer/.agents/skills/typer/SKILL.md 1970-01-01 01:00:00.000000000 +0100 +++ new/typer-0.25.1/typer/.agents/skills/typer/SKILL.md 2026-04-30 21:32:12.721279400 +0200 @@ -0,0 +1,266 @@ +--- +name: typer +description: Typer best practices and conventions. Use when working with Typer CLIs. Keeps Typer code clean and up to date with the latest features and patterns, updated with new versions. Write new code or refactor and update old code. +--- + +# Typer + +Official Typer skill to write code with best practices, keeping up to date with new versions and features. + +## Installing typer + +In a virtual environment, `pip install typer` (with pip) or `uv pip install typer` (with uv). For your library/project, add `typer` to the dependencies in `pyproject.toml`. + +Do not install `typer-slim` or `typer-cli`, they are both deprecated and will now simply install `typer`. + +Typer supports Python 3.10 and above. + +## Use an explicit `Typer` app + +For maximum generalizability, create an explicit Typer app and register subcommand(s), instead of using `typer.run`: + +```python +import typer + +app = typer.Typer() + + [email protected]() +def hello(): + print(f"Hello World") + + +if __name__ == "__main__": + app() +``` + +instead of: + +```python +# DO NOT DO THIS: Not extensible. Use Typer() instead. +import typer + + +def main(): + print(f"Hello World") + + +if __name__ == "__main__": + typer.run(main) +``` + +## Execute the app + +To execute the app in the terminal, run + +```bash +python main.py +``` + +When multiple commands are registered to the Typer app, you have to add the command name: + +```bash +python main.py hello +``` + +To see the automatically generated help documentation, run + +```bash +python main.py --help +``` + +or set `no_args_is_help` to `True` when creating the `Typer()` add to automatically show the help when running a command without any arguments. + +## Use `Annotated` + +Always prefer the `Annotated` style for declarations of CLI arguments and options. + +It allows us to pass additional metadata that can be used by Typer. + +```python +from typing import Annotated + +import typer + +app = typer.Typer() + + [email protected]() +def hello(name: Annotated[str, typer.Argument()] = "World"): + # Note that name is an optional Argument, as a default is provided + print(f"Hello {name}") + + +if __name__ == "__main__": + app() +``` + +This program can be run as-is, or can provide a specific name: + +```bash +python main.py +python main.py Rick +``` + +An older way of setting a default value is this: +```python +# DO NOT DO THIS: old style. Use Annotated instead. + [email protected]() +def main(name: str = typer.Argument(default="World")): + # Note that name is an optional Argument, as a default is provided + print(f"Hello {name}") +``` + +Similarly, the old style could use ellipsis (...) to explicitely mark an argument as required. + +```python +# DO NOT DO THIS: old style. Use Annotated without a default value instead. + [email protected]() +def main(name: str = typer.Argument(default=...)): + # Note that name is now a required Argument + print(f"Hello {name}") +``` + +## CLI Options + +CLI options are declared in a similar fashion as arguments, but will be called on the CLI with a single dash (single letter) or 2 dashes (full name): + +```python +from typing import Annotated + +import typer + +app = typer.Typer() + + [email protected]() +def main(user_name: Annotated[str, typer.Option("--name", "-n")]): + # On the CLI, the required user name can be specified with -n or --name + print(f"Hello {user_name}") + + +if __name__ == "__main__": + app() +``` + +You can run this program as such: + +```bash +python main.py -n "Rick" +python main.py --name "Morty" +``` + +### CLI options with multiple values + +By declaring a CLI option as a list, it can receive multiple values: + +```python +from typing import Annotated + +import typer + +app = typer.Typer() + + [email protected]() +def main(user: Annotated[list[str] | None, typer.Option()] = None): + if not user: + print(f"No users provided!") + raise typer.Abort() + for u in user: + print(f"Processing user: {u}") + + +if __name__ == "__main__": + app() +``` + +This can be executed like so: + +```bash +python main.py --user Rick --user Morty --user Summer +``` + +## Rich + +By default, Rich can be used with its custom markup syntax to set colors and styles, e.g. + +```python +from rich import print + +print("[bold red]Alert![/bold red] [green]Portal gun[/green] shooting! :boom:") +``` + +Typer supports using Rich formatting in the docstrings and the help messages of CLI arguments and CLI options. + + +```python +from typing import Annotated + +import typer + +app = typer.Typer(rich_markup_mode="rich") + + [email protected]() +def create( + username: Annotated[ + str, typer.Argument(help="The username to be [green]created[/green]") + ], +): + """ + [bold green]Create[/bold green] a new [italic]shiny[/italic] user. :sparkles: + + This requires a [underline]username[/underline]. + """ + print(f"Creating user: {username}") + + [email protected](help="[bold red]Delete[/bold red] a user with [italic]USERNAME[/italic].") +def delete( + username: Annotated[ + str, typer.Argument(help="The username to be [red]deleted[/red]") + ], +): + """ + Some internal utility function to delete. + """ + print(f"Deleting user: {username}") + + +if __name__ == "__main__": + app() +``` + +To disable Rich formatting, set `rich_markup_mode` to `None` when creating a `Typer()` app. By default (when no value is given), Rich formatting is enabled. + +### Rich markdown + +You can also set `rich_markup_mode` to `"markdown"` to use Markdown in the docstring: + +```python +from typing import Annotated + +import typer + +app = typer.Typer(rich_markup_mode="markdown") + [email protected](help="**Delete** a user with *USERNAME*.") +def delete( + username: Annotated[str, typer.Argument(help="The username to be **deleted** :boom:")] +): + print(f"Deleting user: {username}") + +if __name__ == "__main__": + app() +``` + +## Click + +Originally, Typer was built on Click. However, going forward Typer will vendor Click. As such, Click extensions should not be used anymore. + +Other settings of `Option` and `Argument` that came from Click but shouldn't be used in Typer anymore, include: `expose_value`, `shell_complete`, `show_choices`, `errors`, `prompt_required`, `is_flag`, `flag_value` and `allow_from_autoenv`. + +Code bases using these should be refactored to use pure Typer functionality. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/typer/__init__.py new/typer-0.25.1/typer/__init__.py --- old/typer-0.24.2/typer/__init__.py 2026-04-22 19:45:28.381250900 +0200 +++ new/typer-0.25.1/typer/__init__.py 2026-04-30 21:32:12.721279400 +0200 @@ -1,6 +1,6 @@ """Typer, build great CLIs. Easy to code. Based on Python type hints.""" -__version__ = "0.24.2" +__version__ = "0.25.1" from shutil import get_terminal_size as get_terminal_size diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer-0.24.2/typer/rich_utils.py new/typer-0.25.1/typer/rich_utils.py --- old/typer-0.24.2/typer/rich_utils.py 2026-04-22 19:45:28.381578700 +0200 +++ new/typer-0.25.1/typer/rich_utils.py 2026-04-30 21:32:12.721701000 +0200 @@ -749,5 +749,7 @@ show_locals=exception_config.pretty_exceptions_show_locals, suppress=internal_dir_names, width=MAX_WIDTH, + code_width=None, + word_wrap=True, ) return rich_tb
