Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nolar
Copy link
Owner

@nolar nolar commented May 12, 2025

Click 8.2.0 has been released 2 days ago: 2025-05-10. It has introduced a few changes that are irrelevant for Kopf, but broke the CI end2end tests:

Specifically:

Keep stdout and stderr streams independent in CliRunner. Always collect stderr output and never raise an exception. Add a new output stream to simulate what the user sees in its terminal. Removes the mix_stderr parameter in CliRunner.

Hence, switch from .stdout to .output in the end2end tests. The expected logs go to stderr, but they were previously visible in .stdout, so I used whatever worked.

Choice is now generic and supports any iterable value. This allows you to use enums and other non-str values.

This failed the mypy checks. The proper fix would be to remake LogFormatParamType to inhert from click.Choice[loggers.LogFormat] (the enum). But this requires the strict dependency for click>=8.2.0 for Kopf, since the type was not a generic in 8.1.x and before. However, Click 8.2.0 also drops the support for the yet-alive Python 3.9, which should be supported in Kopf till October 2025. So, I cannot make Kopf depend on click>=8.2.0 yet.

Therefore, suppress the line for the time being. Get back to that line when Python 3.9 is dropped from Kopf.

nolar added 2 commits May 12, 2025 11:38
Click 8.2.0 strictly separated stdout & stderr. The logs were in stderr, but were visible in stdout, too. Now, use the proper "output" for the mixed stream when the specific stream is irrelevant (almost always).

Signed-off-by: Sergey Vasilyev <[email protected]>
@nolar nolar enabled auto-merge May 12, 2025 09:54
@nolar nolar merged commit 0c90af1 into main May 12, 2025
26 checks passed
@nolar nolar deleted the click-8.2.0 branch May 12, 2025 09:55
nolar added a commit that referenced this pull request Nov 5, 2025
nolar added a commit that referenced this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants