Fix an issue with Click 8.0.0 for custom type double-conversion #769
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.
Presumably caused by this change in Click:
Previously, the default string was converted to the default value of the parameter only once. With Click 8.0.0, first, the default string ("full") is converted to its typed (enum), and then its enum is converted again as a regular value.
According to the docs (from a quote below), this is a violation of the conversion contract from Click's side — i.e. not only a string is passed:
With this fix, if a value is already of the proper type, do not convert it and use it "as is".
As an immediate workaround for bleeding cases when Kopf upgrade is not possible and older versions are required, restrict
click<8.0.0
in your requirements.Fixes #767. Replaces #768.