Skip to content

Fix ParamType typing for Click 8.4#201

Merged
janluke merged 1 commit into
janluke:masterfrom
adamtheturtle:adamtheturtle/issue-200
May 26, 2026
Merged

Fix ParamType typing for Click 8.4#201
janluke merged 1 commit into
janluke:masterfrom
adamtheturtle:adamtheturtle/issue-200

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented May 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #200.

@adamtheturtle
adamtheturtle marked this pull request as ready for review May 19, 2026 10:39
@janluke

janluke commented May 25, 2026

Copy link
Copy Markdown
Owner

Hello! Thanks for the PR. Have you tested this with both Click 8.3 and 8.4? Have you run mypy as well with both?

@adamtheturtle

Copy link
Copy Markdown
Contributor Author

Hi @janluke, thanks for the review!

Yes, tested with both Click 8.3.3 and Click 8.4.1 (Python 3.12, mypy 2.1.0). Results:

Click pytest mypy --strict cloup
8.3.3, master 328 pass 2 errors in cloup/_commands.py (pre-existing)
8.3.3, this PR 328 pass same 2 errors, no regression
8.4.1, master 328 pass 3 errors: same 2, plus _params.pyi:14: Missing type arguments for generic type "ParamType"
8.4.1, this PR 328 pass back to the same 2 pre-existing errors; the 8.4 typing error is fixed

So this PR cleanly resolves the new ParamType typing error on Click 8.4 without breaking 8.3.

The two remaining _commands.py errors are unrelated (isinstance(self, click.MultiCommand), since MultiCommand is deprecated in Click 8). I've opened #202 to track them and #203 with a one-line fix.

@janluke
janluke merged commit 54236e4 into janluke:master May 26, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyright reports cloup.option as partially unknown with Click 8.4

2 participants