Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tackle compatibility issues with Click 8.2 #1145

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theMarix
Copy link
Contributor

@theMarix theMarix commented Feb 6, 2025

Creating this as a heads up regarding a compatibility problem with Click 8.2.0. Click changes the signature of the make_metavar and get_metavar functions.

This PR provides compatibility with both older and newer versions of Click by verifying the function signature.

Click also changed behaviour in various ways that are breaking tests even though Typer itself works as expected. The PR so far tackles the trivial cases. However, there are still tests remaining that will need a closer look to ensure compatibility.

Click 8.2 now expects the context to be passed to the make_metavar method. To enable Typer to be used both with new and old versions of Click, this passes the parameter conditionally. For the make_metavar override to stay compatible, pass the parameter through via catchall for
    positional arguments.
@svlandeg svlandeg added bug Something isn't working click Related to Click functionality labels Feb 7, 2025
@theMarix
Copy link
Contributor Author

theMarix commented Feb 7, 2025

I am not sure how much time I'll have to look into those additional failing tests. Anybody feel free to adopt (parts of) this for a proper fix.

@svlandeg svlandeg self-assigned this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working click Related to Click functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants