-
-
Notifications
You must be signed in to change notification settings - Fork 743
👽️ Ensure compatibility with Click 8.2 #1145
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
Conversation
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.
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. |
Thanks so much for the initial work on this, @theMarix! This will definitely be useful. We'll continue working on your branch directly if that's OK, to get the PR in good shape. |
Of course. That's why I submitted in the first place. I sadly don't have the capacity and context knowledge to adopt all the tests in a realistic time. Use as much or as little of my submission as is useful to you and feel free to modify the branch as makes sense. |
Click's 8.2 release plan: pallets/click#2789 |
Should be solved by fastapi/typer#1145
Better error output in test that failed when trying out click v8.2. See fastapi/typer#1145 to follow support a bit.
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.11.8 → v0.11.9](astral-sh/ruff-pre-commit@v0.11.8...v0.11.9) * Avoid click v8.2 - no support for this in typer now Better error output in test that failed when trying out click v8.2. See fastapi/typer#1145 to follow support a bit. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Casper Welzel Andersen <[email protected]>
8.2.0 has some behaviour changes that makes typer not work properly. See fastapi/typer#1145 Signed-off-by: Rafa Porres Molina <[email protected]>
…typer compatibility see: modelcontextprotocol/python-sdk#688 (comment) and related PR fastapi/typer#1145
@theMarix, can we promote this to a non-draft PR so it can get some attention? The Click 8.2.0 incompatibility issue is now impacting projects using Typer since it was dropped this week. |
@devinnasar , the PR is currently in draft mode because it is not in a mergable state. The code works on 8.2, but not all tests will pass. |
8.2.0 has some behaviour changes that makes typer not work properly. See fastapi/typer#1145 Signed-off-by: Rafa Porres Molina <[email protected]>
This has become obsoleted by #1222 . |
Creating this as a heads up regarding a compatibility problem with Click 8.2.0. Click changes the signature of the
make_metavar
andget_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.