-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I am using the get_metavar function to generate a custom metavar for some types. This was working fine, but upgrading Click to 8.2.0 broke our script. Unlike some other functions (e.g., get_missing_message), this is not even mentioned in the documentation that such a parameter was introduced. See (docs link):
Overall, such changes to the public documented API should not add mandatory parameters because that is adding breaking changes into a minor release. I get that this was added to enable a new feature, but I think you should consider using it as an optional parameter, which still adds a benefit of a new feature, while not introducing breaking changes to the public API.
Steps to reproduce:
- Use click 8.1.x
- Call
get_metavarto get some custom metavar (get_metavarhas one parameter -param) - Update to 8.2.0
- CLI crashes because a new mandatory parameter was introduced
Expected behavior:
No breaking changes to the public API in minor release, and better document the new parameter as you do for other functions.
Environment:
- Python version: 3.13
- Click version: 8.2.0