diff --git a/click-8.2.1-clirunner.patch b/click-8.2.1-clirunner.patch deleted file mode 100644 index 3663ded..0000000 --- a/click-8.2.1-clirunner.patch +++ /dev/null @@ -1,106 +0,0 @@ - -github.com/pallets/click/issues/2939 -github.com/pallets/click/pull/2940 - - -From 93c6966eb3a575c2b600434d1cc9f4b3aee505ac Mon Sep 17 00:00:00 2001 -From: Antoine Lambert -Date: Thu, 22 May 2025 22:14:23 +0200 -Subject: [PATCH] testing/CliRunner: Fix regression related to EOF introduced - in 262bdf0 - -Commit 262bdf0 ensured to raise an EOFError exception on end of input -to simulate tty behavior and avoid blocking prompt during tests when -no more input is available. - -However the introduced implementation has a side effect when testing a -click command having a File type option or argument and when it is set -to stdin: the command ends up with error due to the Abort exception -being raised when the stdin EOFError exception is caught. - -To prevent this undesirable side effect, prefer to raise the EOFError -exceptions directly from the prompts functions inside the CliRunner -class instead of doing it in the method overriding the iterator protcol -for the _NamedTextIOWrapper class. - -Restore previous implementation of a test broken by changes of 262bdf0. - -Fixes #2939. ---- - CHANGES.rst | 5 +++++ - src/click/testing.py | 17 ++++++++--------- - tests/test_chain.py | 4 ++-- - 3 files changed, 15 insertions(+), 11 deletions(-) - -diff --git a/CHANGES.rst b/CHANGES.rst -index 1b8af9a5f..decdc2d91 100644 ---- a/CHANGES.rst -+++ b/CHANGES.rst -@@ -1,5 +1,10 @@ - .. currentmodule:: click - -+Version 8.2.2 -+------------- -+ -+- Fix regression related to EOF handling in CliRunner. :issue:`2939` -+ - Version 8.2.1 - ------------- - -diff --git a/src/click/testing.py b/src/click/testing.py -index 7c0e8741e..e57eacc5d 100644 ---- a/src/click/testing.py -+++ b/src/click/testing.py -@@ -116,13 +116,6 @@ def name(self) -> str: - def mode(self) -> str: - return self._mode - -- def __next__(self) -> str: # type: ignore -- try: -- line = super().__next__() -- except StopIteration as e: -- raise EOFError() from e -- return line -- - - def make_input_stream( - input: str | bytes | t.IO[t.Any] | None, charset: str -@@ -348,7 +341,10 @@ def isolation( - @_pause_echo(echo_input) # type: ignore - def visible_input(prompt: str | None = None) -> str: - sys.stdout.write(prompt or "") -- val = next(text_input).rstrip("\r\n") -+ try: -+ val = next(text_input).rstrip("\r\n") -+ except StopIteration as e: -+ raise EOFError() from e - sys.stdout.write(f"{val}\n") - sys.stdout.flush() - return val -@@ -357,7 +353,10 @@ def visible_input(prompt: str | None = None) -> str: - def hidden_input(prompt: str | None = None) -> str: - sys.stdout.write(f"{prompt or ''}\n") - sys.stdout.flush() -- return next(text_input).rstrip("\r\n") -+ try: -+ return next(text_input).rstrip("\r\n") -+ except StopIteration as e: -+ raise EOFError() from e - - @_pause_echo(echo_input) # type: ignore - def _getchar(echo: bool) -> str: -diff --git a/tests/test_chain.py b/tests/test_chain.py -index ba11b7e2a..702eaaa3e 100644 ---- a/tests/test_chain.py -+++ b/tests/test_chain.py -@@ -163,8 +163,8 @@ def processor(iterator): - return processor - - result = runner.invoke(cli, args, input=input) -- # last two lines are '' and 'Aborted!' -- assert result.output.splitlines()[:-2] == expect -+ assert not result.exception -+ assert result.output.splitlines() == expect - - - def test_args_and_chain(runner): diff --git a/click-8.2.1.tar.gz b/click-8.2.1.tar.gz deleted file mode 100644 index e5429d5..0000000 --- a/click-8.2.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202 -size 286342 diff --git a/click-8.3.0.tar.gz b/click-8.3.0.tar.gz new file mode 100644 index 0000000..b469ffd --- /dev/null +++ b/click-8.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7b8232224eba16f4ebe410c25ced9f7875cb5f3263ffc93cc3e8da705e229c4 +size 276943 diff --git a/python-click.changes b/python-click.changes index a9c14ab..b96f009 100644 --- a/python-click.changes +++ b/python-click.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Fri Sep 26 04:26:21 UTC 2025 - Steve Kowalik + +- Update to 8.3.0: + * Improved flag option handling: Reworked the relationship between + flag_value and default parameters for better consistency. + * Show correct auto complete value for nargs option in combination with + flag option. + * Fix handling of quoted and escaped parameters in Fish autocompletion. + * Properly forward exception information to resources registered with + click.core.Context.with_resource(). + * Fix regression related to EOF handling in CliRunner. +- Drop patch click-8.2.1-clirunner.patch, included upstream. + ------------------------------------------------------------------- Sat Aug 9 07:09:03 UTC 2025 - Matej Cepl diff --git a/python-click.spec b/python-click.spec index 6f298fd..e69c6c6 100644 --- a/python-click.spec +++ b/python-click.spec @@ -18,14 +18,12 @@ %{?sle15_python_module_pythons} Name: python-click -Version: 8.2.1 +Version: 8.3.0 Release: 0 Summary: A wrapper around optparse for command line utilities License: BSD-3-Clause URL: https://github.com/pallets/click Source: https://files.pythonhosted.org/packages/source/c/click/click-%{version}.tar.gz -## see github.com/pallets/click/issues/2939, github.com/pallets/click/pull/2940 -Patch0: click-8.2.1-clirunner.patch BuildRequires: %{python_module base >= 3.10} BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip}