Skip to content

Support click v8.4#1260

Open
sirosen wants to merge 1 commit into
globus:mainfrom
sirosen:support-click-8.4
Open

Support click v8.4#1260
sirosen wants to merge 1 commit into
globus:mainfrom
sirosen:support-click-8.4

Conversation

@sirosen
Copy link
Copy Markdown
Member

@sirosen sirosen commented May 21, 2026

8.4 introduces relatively few changes, but does make ParamType a
Generic parametrized over the return type of convert(). Unfortunately,
we also support Python 3.9 , which means we must support older click
versions. As such, ParamType is not even subscriptable on that version.

To work around this, we use TYPE_CHECKING guards to split definitions
between a generic and non-generic variant.

Only one line of runtime code is changed:
A superfluous call to super().convert() was flagged by mypy for
having the wrong type and is here removed.

8.4 introduces relatively few changes, but does make `ParamType` a
Generic parametrized over the return type of `convert()`. Unfortunately,
we also support Python 3.9 , which means we must support older click
versions. As such, `ParamType` is not even subscriptable on that version.

To work around this, we use `TYPE_CHECKING` guards to split definitions
between a generic and non-generic variant.

Only one line of runtime code is changed:
A superfluous call to `super().convert()` was flagged by `mypy` for
having the wrong type and is here removed.
@sirosen sirosen added the no-news-is-good-news This change does not require a news file label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-news-is-good-news This change does not require a news file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant