13 Commits

Author SHA256 Message Date
171a331e70 Accepting request 1330910 from devel:languages:python
- Add pythons_for_pypi macro

OBS-URL: https://build.opensuse.org/request/show/1330910
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-click?expand=0&rev=29
2026-02-06 20:29:58 +00:00
c74a94a481 - Add pythons_for_pypi macro
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=71
2026-02-04 10:43:10 +00:00
2a1df83c5b Accepting request 1329782 from devel:languages:python
- Run tests in a subpackage, this allows to exclude build in different
  distributions

OBS-URL: https://build.opensuse.org/request/show/1329782
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-click?expand=0&rev=28
2026-01-30 17:22:04 +00:00
d5e58e270e - Run tests in a subpackage, this allows to exclude build in different
distributions

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=69
2026-01-29 09:08:14 +00:00
d0a81c0a94 Accepting request 1318239 from devel:languages:python
- Update to 8.3.1
  * Don’t discard pager arguments by correctly using subprocess.Popen.
  * Replace Sentinel.UNSET default values by None as they’re passed
    through the Context.invoke() method.
  * Fix conversion of Sentinel.UNSET happening too early, which caused
    incorrect behavior for multiple parameters using the same name.
  * Hide Sentinel.UNSET values as None when looking up for other
    parameters through the context inside parameter callbacks.
  * Fix rendering when prompt and confirm parameter prompt_suffix is empty.
  * When Sentinel.UNSET is found during parsing, it will skip calls to
    type_cast_value.

OBS-URL: https://build.opensuse.org/request/show/1318239
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-click?expand=0&rev=27
2025-11-18 14:29:24 +00:00
4c3161c651 - Update to 8.3.1
* Don’t discard pager arguments by correctly using subprocess.Popen.
  * Replace Sentinel.UNSET default values by None as they’re passed
    through the Context.invoke() method.
  * Fix conversion of Sentinel.UNSET happening too early, which caused
    incorrect behavior for multiple parameters using the same name.
  * Hide Sentinel.UNSET values as None when looking up for other
    parameters through the context inside parameter callbacks.
  * Fix rendering when prompt and confirm parameter prompt_suffix is empty.
  * When Sentinel.UNSET is found during parsing, it will skip calls to
    type_cast_value.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=67
2025-11-17 13:42:26 +00:00
128eca6232 Accepting request 1307244 from devel:languages:python
- 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.

Revert to 8.2.1, version 8.2.2 was yanked because Unintended change in
behavior of boolean options and None
https://pypi.org/project/click/8.2.2/
(and if I read `osc log` I would know dgarcia did this already)

OBS-URL: https://build.opensuse.org/request/show/1307244
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-click?expand=0&rev=26
2025-09-26 20:24:20 +00:00
8df0488fc9 - 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.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=65
2025-09-26 04:28:28 +00:00
4994069796 Revert to 8.2.1, version 8.2.2 was yanked because Unintended change in
behavior of boolean options and None
https://pypi.org/project/click/8.2.2/
(and if I read `osc log` I would know dgarcia did this already)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=64
2025-08-09 07:10:28 +00:00
17b6353beb Accepting request 1298502 from devel:languages:python
revert

OBS-URL: https://build.opensuse.org/request/show/1298502
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=63
2025-08-09 07:08:18 +00:00
33f90a5284 - Update to 8.2.2:
- Fix reconciliation of default, flag_value and type parameters
    for flag options, as well as parsing and normalization of
    environment variables. #2952 #2956
  - Fix typing issue in BadParameter and MissingParameter
    exceptions for the parameter param_hint that did not allow
    for a sequence of string where the underlying functino
    _join_param_hints allows for it. #2777 #2990
  - Use the value of Enum choices to render their default value
    in help screen. #2911 #3004
  - Fix completion for the Z shell (zsh) for completion items
    containing colons. #2703 #2846
  - Don't include envvar in error hint when not configured. #2971
    #2972
  - Fix a rare race in click.testing.StreamMixer's finalization
    that manifested as a ValueError on close in a multi-threaded
    test session. #2993 #2991

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=62
2025-08-08 19:05:29 +00:00
90d07df29f Accepting request 1298127 from devel:languages:python
Revert to 8.2.1, version 8.2.2 was yanked because Unintended change in
behavior of boolean options and None
https://pypi.org/project/click/8.2.2/

OBS-URL: https://build.opensuse.org/request/show/1298127
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=61
2025-08-07 11:42:35 +00:00
4c1da6bdc6 Accepting request 1297475 from home:nkrapp:branches:devel:languages:python
- Update to 8.2.2
  * Fix reconciliation of default, flag_value and type parameters for
    flag options, as well as parsing and normalization of environment variables.
    #2952 #2956
  * Fix typing issue in BadParameter and MissingParameter exceptions for the
    parameter param_hint that did not allow for a sequence of string where the
    underlying functino _join_param_hints allows for it. #2777 #2990
  * Use the value of Enum choices to render their default value in help
    screen. #2911 #3004
  * Fix completion for the Z shell (zsh) for completion items containing
    colons. #2703 #2846
  * Don't include envvar in error hint when not configured. #2971 #2972
  * Fix a rare race in click.testing.StreamMixer's finalization that manifested
    as a ValueError on close in a multi-threaded test session.
    #2993 #2991
- drop upstream changelog entry from patch

OBS-URL: https://build.opensuse.org/request/show/1297475
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-click?expand=0&rev=60
2025-08-05 18:43:12 +00:00
6 changed files with 78 additions and 115 deletions

3
_multibuild Normal file
View File

@@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@@ -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 <anlambert@softwareheritage.org>
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):

Binary file not shown.

3
click-8.3.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a
size 295065

View File

@@ -1,3 +1,51 @@
-------------------------------------------------------------------
Wed Feb 4 10:40:58 UTC 2026 - Daniel Garcia <daniel.garcia@suse.com>
- Add pythons_for_pypi macro
-------------------------------------------------------------------
Thu Jan 29 09:04:24 UTC 2026 - Daniel Garcia <daniel.garcia@suse.com>
- Run tests in a subpackage, this allows to exclude build in different
distributions
-------------------------------------------------------------------
Mon Nov 17 08:34:57 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 8.3.1
* Dont discard pager arguments by correctly using subprocess.Popen.
* Replace Sentinel.UNSET default values by None as theyre passed
through the Context.invoke() method.
* Fix conversion of Sentinel.UNSET happening too early, which caused
incorrect behavior for multiple parameters using the same name.
* Hide Sentinel.UNSET values as None when looking up for other
parameters through the context inside parameter callbacks.
* Fix rendering when prompt and confirm parameter prompt_suffix is empty.
* When Sentinel.UNSET is found during parsing, it will skip calls to
type_cast_value.
-------------------------------------------------------------------
Fri Sep 26 04:26:21 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- 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 <mcepl@cepl.eu>
Revert to 8.2.1, version 8.2.2 was yanked because Unintended change in
behavior of boolean options and None
https://pypi.org/project/click/8.2.2/
(and if I read `osc log` I would know dgarcia did this already)
-------------------------------------------------------------------
Tue Jun 8 15:09:58 UTC 2025 - Friedrich Haubensak <hsk17@mail.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-click
#
# 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
@@ -16,22 +16,32 @@
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%{?pythons_for_pypi}
%{?sle15_python_module_pythons}
Name: python-click
Version: 8.2.1
Name: python-click%{psuffix}
Version: 8.3.1
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}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
%if %{with test}
BuildRequires: %{python_module click == %{version}}
BuildRequires: %{python_module pytest}
%endif
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
@@ -47,20 +57,28 @@ defaults out of the box.
%autosetup -p1 -n click-%{version}
%build
%if %{without test}
%pyproject_wheel
%endif
%install
%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
export LANG=en_US.UTF-8
%pytest -rs --tb=short
%endif
%if %{without test}
%files %{python_files}
%license LICENSE.txt
%doc CHANGES.rst README.md
%{python_sitelib}/click
%{python_sitelib}/click-%{version}.dist-info
%endif
%changelog