Work around changes in Click 8.2.0 #1174
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.This failed the mypy checks. The proper fix would be to remake
LogFormatParamType
to inhert fromclick.Choice[loggers.LogFormat]
(the enum). But this requires the strict dependency forclick>=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 onclick>=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.