Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-typer-slim for openSUSE:Factory checked in at 2025-05-31 19:14:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-typer-slim (Old) and /work/SRC/openSUSE:Factory/.python-typer-slim.new.16005 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-typer-slim" Sat May 31 19:14:19 2025 rev:12 rq:1280710 version:0.16.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-typer-slim/python-typer-slim.changes 2025-05-23 14:27:29.320797860 +0200 +++ /work/SRC/openSUSE:Factory/.python-typer-slim.new.16005/python-typer-slim.changes 2025-05-31 19:14:19.824468888 +0200 @@ -1,0 +2,7 @@ +Tue May 27 19:13:12 UTC 2025 - Matthias Bach <ma...@marix.org> - 0.16.0 + +- Update to 0.16.0 + * Add compatibility with Click 8.2. +- Remove support-click-8.2.patch as it is no longer needed. + +------------------------------------------------------------------- Old: ---- support-click-8.2.patch typer_slim-0.15.3.tar.gz New: ---- typer_slim-0.16.0.tar.gz BETA DEBUG BEGIN: Old: * Add compatibility with Click 8.2. - Remove support-click-8.2.patch as it is no longer needed. BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-typer-slim.spec ++++++ --- /var/tmp/diff_new_pack.qBMXBJ/_old 2025-05-31 19:14:20.496496660 +0200 +++ /var/tmp/diff_new_pack.qBMXBJ/_new 2025-05-31 19:14:20.500496826 +0200 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} Name: python-typer-slim -Version: 0.15.3 +Version: 0.16.0 Release: 0 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints License: MIT @@ -27,8 +27,6 @@ Source: https://files.pythonhosted.org/packages/source/t/typer_slim/typer_slim-%{version}.tar.gz Source2: %{name}-rpmlintrc Patch0: set-proper-pythonpath-for-tutorial-script-tests.patch -# PATCH-FIX-UPSTREAM Based on gh#fastapi/typer#1222 -Patch1: support-click-8.2.patch BuildRequires: %{python_module click} BuildRequires: %{python_module coverage} BuildRequires: %{python_module pdm-backend} @@ -71,10 +69,8 @@ %check # the completion tests fail as build runs in sh which is not supported -# Broken with click 8.2.0: -# - test_enum/test_tutorial003 -# - test_script_completion_run and test_completion_show_invalid_shell -%pytest -k 'not (test_show_completion or test_install_completion or (test_enum and test_tutorial003) or test_script_completion_run or test_completion_show_invalid_shell)' +# test_invalid_score stumbles over linebreaks in the output +%pytest -k 'not (test_show_completion or test_install_completion or test_invalid_score)' %files %{python_files} %doc README.md ++++++ typer_slim-0.15.3.tar.gz -> typer_slim-0.16.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/PKG-INFO new/typer_slim-0.16.0/PKG-INFO --- old/typer_slim-0.15.3/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/typer_slim-0.16.0/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: typer-slim -Version: 0.15.3 +Version: 0.16.0 Summary: Typer, build great CLIs. Easy to code. Based on Python type hints. Author-Email: =?utf-8?q?Sebasti=C3=A1n_Ram=C3=ADrez?= <tiang...@gmail.com> Classifier: Intended Audience :: Information Technology diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/docs_src/testing/app01/test_main.py new/typer_slim-0.16.0/docs_src/testing/app01/test_main.py --- old/typer_slim-0.15.3/docs_src/testing/app01/test_main.py 2025-04-28 23:40:40.375423700 +0200 +++ new/typer_slim-0.16.0/docs_src/testing/app01/test_main.py 2025-05-26 16:30:15.241240700 +0200 @@ -8,5 +8,5 @@ def test_app(): result = runner.invoke(app, ["Camila", "--city", "Berlin"]) assert result.exit_code == 0 - assert "Hello Camila" in result.stdout - assert "Let's have a coffee in Berlin" in result.stdout + assert "Hello Camila" in result.output + assert "Let's have a coffee in Berlin" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/docs_src/testing/app02/test_main.py new/typer_slim-0.16.0/docs_src/testing/app02/test_main.py --- old/typer_slim-0.15.3/docs_src/testing/app02/test_main.py 2025-04-28 23:40:40.375423700 +0200 +++ new/typer_slim-0.16.0/docs_src/testing/app02/test_main.py 2025-05-26 16:30:15.241240700 +0200 @@ -8,4 +8,4 @@ def test_app(): result = runner.invoke(app, ["Camila"], input="cam...@example.com\n") assert result.exit_code == 0 - assert "Hello Camila, your email is: cam...@example.com" in result.stdout + assert "Hello Camila, your email is: cam...@example.com" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/docs_src/testing/app02_an/test_main.py new/typer_slim-0.16.0/docs_src/testing/app02_an/test_main.py --- old/typer_slim-0.15.3/docs_src/testing/app02_an/test_main.py 2025-04-28 23:40:40.375423700 +0200 +++ new/typer_slim-0.16.0/docs_src/testing/app02_an/test_main.py 2025-05-26 16:30:15.242240700 +0200 @@ -8,4 +8,4 @@ def test_app(): result = runner.invoke(app, ["Camila"], input="cam...@example.com\n") assert result.exit_code == 0 - assert "Hello Camila, your email is: cam...@example.com" in result.stdout + assert "Hello Camila, your email is: cam...@example.com" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/docs_src/testing/app03/test_main.py new/typer_slim-0.16.0/docs_src/testing/app03/test_main.py --- old/typer_slim-0.15.3/docs_src/testing/app03/test_main.py 2025-04-28 23:40:40.375423700 +0200 +++ new/typer_slim-0.16.0/docs_src/testing/app03/test_main.py 2025-05-26 16:30:15.242240700 +0200 @@ -12,4 +12,4 @@ def test_app(): result = runner.invoke(app, ["--name", "Camila"]) assert result.exit_code == 0 - assert "Hello Camila" in result.stdout + assert "Hello Camila" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/pyproject.toml new/typer_slim-0.16.0/pyproject.toml --- old/typer_slim-0.15.3/pyproject.toml 2025-04-28 23:40:43.030433700 +0200 +++ new/typer_slim-0.16.0/pyproject.toml 2025-05-26 16:30:17.718270300 +0200 @@ -40,7 +40,7 @@ "typing-extensions >= 3.7.4.3", ] readme = "README.md" -version = "0.15.3" +version = "0.16.0" [project.urls] Homepage = "https://github.com/fastapi/typer" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_completion/test_completion_show.py new/typer_slim-0.16.0/tests/test_completion/test_completion_show.py --- old/typer_slim-0.15.3/tests/test_completion/test_completion_show.py 2025-04-28 23:40:40.378423700 +0200 +++ new/typer_slim-0.16.0/tests/test_completion/test_completion_show.py 2025-05-26 16:30:15.245240700 +0200 @@ -146,4 +146,4 @@ shellingham, "detect_shell", return_value=("xshell", "/usr/bin/xshell") ): result = runner.invoke(app, ["--show-completion"]) - assert "Shell xshell not supported" in result.stdout + assert "Shell xshell not supported" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_others.py new/typer_slim-0.16.0/tests/test_others.py --- old/typer_slim-0.15.3/tests/test_others.py 2025-04-28 23:40:40.378423700 +0200 +++ new/typer_slim-0.16.0/tests/test_others.py 2025-05-26 16:30:15.245240700 +0200 @@ -243,7 +243,7 @@ result = runner.invoke(app, ["Hello", "2", "invalid"]) - assert "Invalid value for 'ARG3': 'invalid' is not a valid integer" in result.stdout + assert "Invalid value for 'ARG3': 'invalid' is not a valid integer" in result.output result = runner.invoke(app, ["Hello", "2", "3", "--arg4", "--arg5"]) assert ( "arg1: <class 'str'> Hello\narg2: <class 'int'> 2\narg3: <class 'int'> 3\narg4: <class 'bool'> True\narg5: <class 'bool'> True\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py 2025-04-28 23:40:40.379423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py 2025-05-26 16:30:15.246240600 +0200 @@ -31,7 +31,7 @@ typer.core.rich = None result = runner.invoke(app) assert result.exit_code != 0 - assert "Error: Missing argument 'NAME'" in result.stdout + assert "Error: Missing argument 'NAME'" in result.output typer.core.rich = rich diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py 2025-04-28 23:40:40.379423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py 2025-05-26 16:30:15.246240600 +0200 @@ -31,7 +31,7 @@ typer.core.rich = None result = runner.invoke(app) assert result.exit_code != 0 - assert "Error: Missing argument 'NAME'" in result.stdout + assert "Error: Missing argument 'NAME'" in result.output typer.core.rich = rich diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py 2025-04-28 23:40:40.380423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py 2025-05-26 16:30:15.246240600 +0200 @@ -31,7 +31,7 @@ typer.core.rich = None result = runner.invoke(app) assert result.exit_code != 0 - assert "Error: Missing argument 'NAME'" in result.stdout + assert "Error: Missing argument 'NAME'" in result.output typer.core.rich = rich diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_commands/test_index/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_commands/test_index/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_commands/test_index/test_tutorial003.py 2025-04-28 23:40:40.381423700 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_commands/test_index/test_tutorial003.py 2025-05-26 16:30:15.247240800 +0200 @@ -12,7 +12,6 @@ def test_no_arg(): result = runner.invoke(app) - assert result.exit_code == 0 assert "[OPTIONS] COMMAND [ARGS]..." in result.output assert "Commands" in result.output assert "create" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py new/typer_slim-0.16.0/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py 2025-04-28 23:40:40.381423700 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py 2025-05-26 16:30:15.248240700 +0200 @@ -30,7 +30,7 @@ def test_invalid_args(): result = runner.invoke(app, ["Draco", "Hagrid"]) assert result.exit_code != 0 - assert "Argument 'names' takes 3 values" in result.stdout + assert "Argument 'names' takes 3 values" in result.output def test_valid_args(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py 2025-04-28 23:40:40.381423700 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py 2025-05-26 16:30:15.248240700 +0200 @@ -32,7 +32,7 @@ def test_invalid_args(): result = runner.invoke(app, ["Draco", "Hagrid"]) assert result.exit_code != 0 - assert "Argument 'names' takes 3 values" in result.stdout + assert "Argument 'names' takes 3 values" in result.output def test_valid_args(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial001.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial001.py 2025-05-26 16:30:15.249240600 +0200 @@ -21,7 +21,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py 2025-05-26 16:30:15.249240600 +0200 @@ -21,7 +21,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial003.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial003.py 2025-05-26 16:30:15.249240600 +0200 @@ -23,7 +23,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py 2025-05-26 16:30:15.249240600 +0200 @@ -23,7 +23,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial004.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial004.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial004.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial004.py 2025-05-26 16:30:15.249240600 +0200 @@ -23,7 +23,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py 2025-04-28 23:40:40.382423900 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py 2025-05-26 16:30:15.249240600 +0200 @@ -23,7 +23,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_required/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_required/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_required/test_tutorial001.py 2025-04-28 23:40:40.383423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_required/test_tutorial001.py 2025-05-26 16:30:15.250240800 +0200 @@ -16,7 +16,7 @@ def test_1(): result = runner.invoke(app, ["Camila"]) assert result.exit_code != 0 - assert "Missing option '--lastname'." in result.output + assert "Missing option '--lastname'" in result.output def test_option_lastname(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py 2025-04-28 23:40:40.383423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_required/test_tutorial001_an.py 2025-05-26 16:30:15.250240800 +0200 @@ -16,7 +16,7 @@ def test_1(): result = runner.invoke(app, ["Camila"]) assert result.exit_code != 0 - assert "Missing option '--lastname'." in result.output + assert "Missing option '--lastname'" in result.output def test_option_lastname(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_version/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_version/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_version/test_tutorial003.py 2025-04-28 23:40:40.383423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_version/test_tutorial003.py 2025-05-26 16:30:15.250240800 +0200 @@ -22,7 +22,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_3(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py 2025-04-28 23:40:40.383423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_options/test_version/test_tutorial003_an.py 2025-05-26 16:30:15.250240800 +0200 @@ -22,7 +22,8 @@ def test_2(): result = runner.invoke(app, ["--name", "rick"]) assert result.exit_code != 0 - assert "Invalid value for '--name': Only Camila is allowed" in result.output + assert "Invalid value for '--name'" in result.output + assert "Only Camila is allowed" in result.output def test_3(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py 2025-04-28 23:40:40.384423700 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py 2025-05-26 16:30:15.251240700 +0200 @@ -30,7 +30,7 @@ assert result.exit_code != 0 assert ( "Invalid value for 'BIRTH:[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]':" - in result.stdout + in result.output ) assert "'july-19-1989' does not match the formats" in result.output assert "%Y-%m-%d" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py 2025-04-28 23:40:40.384423700 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py 2025-05-26 16:30:15.251240700 +0200 @@ -26,10 +26,17 @@ assert "Training neural network of type: conv" in result.output +def test_main_default(): + result = runner.invoke(app) + assert result.exit_code == 0 + assert "Training neural network of type: simple" in result.output + + def test_invalid_case(): result = runner.invoke(app, ["--network", "CONV"]) assert result.exit_code != 0 - assert "Invalid value for '--network': 'CONV' is not one of" in result.output + assert "Invalid value for '--network'" in result.output + assert "'CONV' is not one of" in result.output assert "simple" in result.output assert "conv" in result.output assert "lstm" in result.output @@ -38,7 +45,8 @@ def test_invalid_other(): result = runner.invoke(app, ["--network", "capsule"]) assert result.exit_code != 0 - assert "Invalid value for '--network': 'capsule' is not one of" in result.output + assert "Invalid value for '--network'" in result.output + assert "'capsule' is not one of" in result.output assert "simple" in result.output assert "conv" in result.output assert "lstm" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py 2025-04-28 23:40:40.385424000 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py 2025-05-26 16:30:15.252240700 +0200 @@ -35,7 +35,8 @@ def test_invalid(): result = runner.invoke(app, ["Camila", "--age", "15.3"]) assert result.exit_code != 0 - assert "Invalid value for '--age': '15.3' is not a valid integer" in result.output + assert "Invalid value for '--age'" in result.output + assert "'15.3' is not a valid integer" in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py 2025-04-28 23:40:40.385424000 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py 2025-05-26 16:30:15.252240700 +0200 @@ -53,16 +53,15 @@ def test_invalid_age(): result = runner.invoke(app, ["5", "--age", "15"]) assert result.exit_code != 0 - assert "Invalid value for '--age': 15 is not in the range x>=18" in result.output + assert "Invalid value for '--age'" in result.output + assert "15 is not in the range x>=18" in result.output def test_invalid_score(): result = runner.invoke(app, ["5", "--age", "20", "--score", "100.5"]) assert result.exit_code != 0 - assert ( - "Invalid value for '--score': 100.5 is not in the range x<=100." - in result.output - ) + assert "Invalid value for '--score'" in result.output + assert "100.5 is not in the range x<=100." in result.output def test_negative_score(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py 2025-04-28 23:40:40.385424000 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py 2025-05-26 16:30:15.252240700 +0200 @@ -53,16 +53,15 @@ def test_invalid_age(): result = runner.invoke(app, ["5", "--age", "15"]) assert result.exit_code != 0 - assert "Invalid value for '--age': 15 is not in the range x>=18" in result.output + assert "Invalid value for '--age'" in result.output + assert "15 is not in the range x>=18" in result.output def test_invalid_score(): result = runner.invoke(app, ["5", "--age", "20", "--score", "100.5"]) assert result.exit_code != 0 - assert ( - "Invalid value for '--score': 100.5 is not in the range x<=100." - in result.output - ) + assert "Invalid value for '--score'" in result.output + assert "100.5 is not in the range x<=100." in result.output def test_negative_score(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py 2025-04-28 23:40:40.385424000 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py 2025-05-26 16:30:15.252240700 +0200 @@ -19,7 +19,8 @@ config_file.unlink() result = runner.invoke(app, ["--config", f"{config_file}"]) assert result.exit_code != 0 - assert "Invalid value for '--config': File" in result.output + assert "Invalid value for '--config'" in result.output + assert "File" in result.output assert "does not exist" in result.output @@ -35,7 +36,8 @@ def test_dir(): result = runner.invoke(app, ["--config", "./"]) assert result.exit_code != 0 - assert "Invalid value for '--config': File './' is a directory." in result.output + assert "Invalid value for '--config'" in result.output + assert "File './' is a directory." in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py 2025-04-28 23:40:40.385424000 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py 2025-05-26 16:30:15.252240700 +0200 @@ -19,7 +19,8 @@ config_file.unlink() result = runner.invoke(app, ["--config", f"{config_file}"]) assert result.exit_code != 0 - assert "Invalid value for '--config': File" in result.output + assert "Invalid value for '--config'" in result.output + assert "File" in result.output assert "does not exist" in result.output @@ -35,7 +36,8 @@ def test_dir(): result = runner.invoke(app, ["--config", "./"]) assert result.exit_code != 0 - assert "Invalid value for '--config': File './' is a directory." in result.output + assert "Invalid value for '--config'" in result.output + assert "File './' is a directory." in result.output def test_script(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_terminating/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_terminating/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_terminating/test_tutorial003.py 2025-04-28 23:40:40.386423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_terminating/test_tutorial003.py 2025-05-26 16:30:15.253240800 +0200 @@ -38,8 +38,8 @@ typer.core.rich = None result = runner.invoke(app, ["root"]) assert result.exit_code == 1 - assert "The root user is reserved" in result.stdout - assert "Aborted!" in result.stdout + assert "The root user is reserved" in result.output + assert "Aborted!" in result.output typer.core.rich = rich diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_using_click/test_tutorial003.py new/typer_slim-0.16.0/tests/test_tutorial/test_using_click/test_tutorial003.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_using_click/test_tutorial003.py 2025-04-28 23:40:40.386423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_using_click/test_tutorial003.py 2025-05-26 16:30:15.253240800 +0200 @@ -10,7 +10,7 @@ def test_cli(): result = runner.invoke(mod.typer_click_object, []) - assert "Missing command" in result.stdout + assert "Missing command" in result.output def test_help(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_tutorial/test_using_click/test_tutorial004.py new/typer_slim-0.16.0/tests/test_tutorial/test_using_click/test_tutorial004.py --- old/typer_slim-0.15.3/tests/test_tutorial/test_using_click/test_tutorial004.py 2025-04-28 23:40:40.386423800 +0200 +++ new/typer_slim-0.16.0/tests/test_tutorial/test_using_click/test_tutorial004.py 2025-05-26 16:30:15.253240800 +0200 @@ -10,9 +10,9 @@ def test_cli(): result = runner.invoke(mod.cli, []) - assert "Usage" in result.stdout - assert "dropdb" in result.stdout - assert "sub" in result.stdout + assert "Usage" in result.output + assert "dropdb" in result.output + assert "sub" in result.output def test_typer(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/tests/test_types.py new/typer_slim-0.16.0/tests/test_types.py --- old/typer_slim-0.15.3/tests/test_types.py 1970-01-01 01:00:00.000000000 +0100 +++ new/typer_slim-0.16.0/tests/test_types.py 2025-05-26 16:30:15.253240800 +0200 @@ -0,0 +1,34 @@ +from enum import Enum + +import typer +from typer.testing import CliRunner + +app = typer.Typer(context_settings={"token_normalize_func": str.lower}) + + +class User(str, Enum): + rick = "Rick" + morty = "Morty" + + +@app.command() +def hello(name: User = User.rick) -> None: + print(f"Hello {name.value}!") + + +runner = CliRunner() + + +def test_enum_choice() -> None: + # This test is only for coverage of the new custom TyperChoice class + result = runner.invoke(app, ["--name", "morty"], catch_exceptions=False) + assert result.exit_code == 0 + assert "Hello Morty!" in result.output + + result = runner.invoke(app, ["--name", "Rick"]) + assert result.exit_code == 0 + assert "Hello Rick!" in result.output + + result = runner.invoke(app, ["--name", "RICK"]) + assert result.exit_code == 0 + assert "Hello Rick!" in result.output diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/__init__.py new/typer_slim-0.16.0/typer/__init__.py --- old/typer_slim-0.15.3/typer/__init__.py 2025-04-28 23:40:40.386423800 +0200 +++ new/typer_slim-0.16.0/typer/__init__.py 2025-05-26 16:30:15.253240800 +0200 @@ -1,6 +1,6 @@ """Typer, build great CLIs. Easy to code. Based on Python type hints.""" -__version__ = "0.15.3" +__version__ = "0.16.0" from shutil import get_terminal_size as get_terminal_size diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/_completion_classes.py new/typer_slim-0.16.0/typer/_completion_classes.py --- old/typer_slim-0.15.3/typer/_completion_classes.py 2025-04-28 23:40:40.387423800 +0200 +++ new/typer_slim-0.16.0/typer/_completion_classes.py 2025-05-26 16:30:15.253240800 +0200 @@ -17,6 +17,14 @@ ) try: + from click.shell_completion import split_arg_string as click_split_arg_string +except ImportError: # pragma: no cover + # TODO: when removing support for Click < 8.2, remove this import + from click.parser import ( # type: ignore[no-redef] + split_arg_string as click_split_arg_string, + ) + +try: import shellingham except ImportError: # pragma: no cover shellingham = None @@ -43,7 +51,7 @@ } def get_completion_args(self) -> Tuple[List[str], str]: - cwords = click.parser.split_arg_string(os.environ["COMP_WORDS"]) + cwords = click_split_arg_string(os.environ["COMP_WORDS"]) cword = int(os.environ["COMP_CWORD"]) args = cwords[1:cword] @@ -80,7 +88,7 @@ def get_completion_args(self) -> Tuple[List[str], str]: completion_args = os.getenv("_TYPER_COMPLETE_ARGS", "") - cwords = click.parser.split_arg_string(completion_args) + cwords = click_split_arg_string(completion_args) args = cwords[1:] if args and not completion_args.endswith(" "): incomplete = args[-1] @@ -131,7 +139,7 @@ def get_completion_args(self) -> Tuple[List[str], str]: completion_args = os.getenv("_TYPER_COMPLETE_ARGS", "") - cwords = click.parser.split_arg_string(completion_args) + cwords = click_split_arg_string(completion_args) args = cwords[1:] if args and not completion_args.endswith(" "): incomplete = args[-1] @@ -185,7 +193,7 @@ def get_completion_args(self) -> Tuple[List[str], str]: completion_args = os.getenv("_TYPER_COMPLETE_ARGS", "") incomplete = os.getenv("_TYPER_COMPLETE_WORD_TO_COMPLETE", "") - cwords = click.parser.split_arg_string(completion_args) + cwords = click_split_arg_string(completion_args) args = cwords[1:-1] if incomplete else cwords[1:] return args, incomplete diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/_types.py new/typer_slim-0.16.0/typer/_types.py --- old/typer_slim-0.15.3/typer/_types.py 1970-01-01 01:00:00.000000000 +0100 +++ new/typer_slim-0.16.0/typer/_types.py 2025-05-26 16:30:15.254240800 +0200 @@ -0,0 +1,27 @@ +from enum import Enum +from typing import Generic, TypeVar, Union + +import click + +ParamTypeValue = TypeVar("ParamTypeValue") + + +class TyperChoice(click.Choice, Generic[ParamTypeValue]): # type: ignore[type-arg] + def normalize_choice( + self, choice: ParamTypeValue, ctx: Union[click.Context, None] + ) -> str: + # Click 8.2.0 added a new method `normalize_choice` to the `Choice` class + # to support enums, but it uses the enum names, while Typer has always used the + # enum values. + # This class overrides that method to maintain the previous behavior. + # In Click: + # normed_value = choice.name if isinstance(choice, Enum) else str(choice) + normed_value = str(choice.value) if isinstance(choice, Enum) else str(choice) + + if ctx is not None and ctx.token_normalize_func is not None: + normed_value = ctx.token_normalize_func(normed_value) + + if not self.case_sensitive: + normed_value = normed_value.casefold() + + return normed_value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/core.py new/typer_slim-0.16.0/typer/core.py --- old/typer_slim-0.15.3/typer/core.py 2025-04-28 23:40:40.387423800 +0200 +++ new/typer_slim-0.16.0/typer/core.py 2025-05-26 16:30:15.254240800 +0200 @@ -329,7 +329,7 @@ # to support Arguments if self.hidden: return None - name = self.make_metavar() + name = self.make_metavar(ctx=ctx) help = self.help or "" extra = [] if self.show_envvar: @@ -375,7 +375,7 @@ help = f"{help} {extra_str}" if help else f"{extra_str}" return name, help - def make_metavar(self) -> str: + def make_metavar(self, ctx: Union[click.Context, None] = None) -> str: # Modified version of click.core.Argument.make_metavar() # to include Argument name if self.metavar is not None: @@ -383,7 +383,16 @@ var = (self.name or "").upper() if not self.required: var = f"[{var}]" - type_var = self.type.get_metavar(self) + # TODO: When deprecating Click < 8.2, remove this + signature = inspect.signature(self.type.get_metavar) + if "ctx" in signature.parameters: + # Click >= 8.2 + type_var = self.type.get_metavar(self, ctx=ctx) # type: ignore[arg-type] + else: + # Click < 8.2 + type_var = self.type.get_metavar(self) # type: ignore[call-arg] + # TODO: /When deprecating Click < 8.2, remove this, uncomment the line below + # type_var = self.type.get_metavar(self, ctx=ctx) if type_var: var += f":{type_var}" if self.nargs != 1: @@ -480,6 +489,14 @@ ) -> Optional[Union[Any, Callable[[], Any]]]: return _extract_default_help_str(self, ctx=ctx) + def make_metavar(self, ctx: Union[click.Context, None] = None) -> str: + signature = inspect.signature(super().make_metavar) + if "ctx" in signature.parameters: + # Click >= 8.2 + return super().make_metavar(ctx=ctx) # type: ignore[arg-type] + # Click < 8.2 + return super().make_metavar() # type: ignore[call-arg] + def get_help_record(self, ctx: click.Context) -> Optional[Tuple[str, str]]: # Duplicate all of Click's logic only to modify a single line, to allow boolean # flags with only names for False values as it's currently supported by Typer @@ -498,7 +515,7 @@ any_prefix_is_slash = True if not self.is_flag and not self.count: - rv += f" {self.make_metavar()}" + rv += f" {self.make_metavar(ctx=ctx)}" return rv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/main.py new/typer_slim-0.16.0/typer/main.py --- old/typer_slim-0.15.3/typer/main.py 2025-04-28 23:40:40.387423800 +0200 +++ new/typer_slim-0.16.0/typer/main.py 2025-05-26 16:30:15.254240800 +0200 @@ -15,6 +15,7 @@ from uuid import UUID import click +from typer._types import TyperChoice from ._typing import get_args, get_origin, is_union from .completion import get_completion_inspect_parameters @@ -787,7 +788,12 @@ atomic=parameter_info.atomic, ) elif lenient_issubclass(annotation, Enum): - return click.Choice( + # The custom TyperChoice is only needed for Click < 8.2.0, to parse the + # command line values matching them to the enum values. Click 8.2.0 added + # support for enum values but reading enum names. + # Passing here the list of enum values (instead of just the enum) accounts for + # Click < 8.2.0. + return TyperChoice( [item.value for item in annotation], case_sensitive=parameter_info.case_sensitive, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/typer_slim-0.15.3/typer/rich_utils.py new/typer_slim-0.16.0/typer/rich_utils.py --- old/typer_slim-0.15.3/typer/rich_utils.py 2025-04-28 23:40:40.388423700 +0200 +++ new/typer_slim-0.16.0/typer/rich_utils.py 2025-05-26 16:30:15.254240800 +0200 @@ -370,7 +370,13 @@ # Column for a metavar, if we have one metavar = Text(style=STYLE_METAVAR, overflow="fold") - metavar_str = param.make_metavar() + # TODO: when deprecating Click < 8.2, make ctx required + signature = inspect.signature(param.make_metavar) + if "ctx" in signature.parameters: + metavar_str = param.make_metavar(ctx=ctx) + else: + # Click < 8.2 + metavar_str = param.make_metavar() # type: ignore[call-arg] # Do it ourselves if this is a positional argument if (