Click 8.2.0 incompatibility causing exception in _print_options_panel #1215
Replies: 10 comments 4 replies
-
Observing the same error in the pipelines. Pinning to click <8.2.0 resolves |
Beta Was this translation helpful? Give feedback.
-
Yup, the new click 8.2.0 release totally broke our app using Typer as well. I would also like to bring up that click dropped support for Python 3.7, 3.8 and 3.9 with this release, and Typer is still supporting Python >= 3.7. Not sure how that will affect Typer. |
Beta Was this translation helpful? Give feedback.
-
The required patch to make the above work again would be this one: --- typer/rich_utils.py.old 2025-05-11 23:26:44.218001227 +0200
+++ typer/rich_utils.py.new 2025-05-11 23:24:46.288897856 +0200
@@ -370,7 +370,7 @@
# Column for a metavar, if we have one
metavar = Text(style=STYLE_METAVAR, overflow="fold")
- metavar_str = param.make_metavar()
+ metavar_str = param.make_metavar(ctx)
# Do it ourselves if this is a positional argument
if ( Not sure however what else the upgrade broke. The change apparently is due to new line 300 in |
Beta Was this translation helpful? Give feedback.
-
I think the solution would be to pin click < 8.2.0 in pyproject.toml as the PR to support click 8.2.0 is still open: #1145 |
Beta Was this translation helpful? Give feedback.
-
By the way, the Click PR that changed the signature of |
Beta Was this translation helpful? Give feedback.
-
My attempt at a fix: #1218 |
Beta Was this translation helpful? Give feedback.
-
PR #1145 updates for general click 8.2 compatibility including this issue and has been open since February. |
Beta Was this translation helpful? Give feedback.
-
@tiangolo, drawing your attention to this discussion. This issue is affecting a number of CLI projects now that Click 8.2.0 has been released and it appears that we have a PR meant to address it dating back to February. Can we get an update on this? Thanks! |
Beta Was this translation helpful? Give feedback.
-
This should be converted from a Discussion to an Issue! I'm also facing the issue with click 8.2.0 in our 3 internal apps! |
Beta Was this translation helpful? Give feedback.
-
Typer 0.15.4 was released today that pins click to < 8.2.0. So, manual pinning isn't necessary anymore... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Click 8.2.0 was released 1h ago and seems to be incompatible with the latest typer release.
The issue is in
_print_options_panel
, which callsParameter.make_metavar()
without passing thectx
parameter.The exception is:
TypeError: Parameter.make_metavar() missing 1 required positional argument: 'ctx'
Typer automatically installs the latest 8.x release:
Workaround
In the meantime the issue can be mitigating by pinning click to
click==8.1.8
in our projects.Stack Trace
Operating System
macOS
Operating System Details
No response
Typer Version
0.15.3
Python Version
3.11.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions