You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: Appears to be caused by #5483. Issue does not occur against stubs prior to 7a9a107 (e.g. with types-click==0.1.12).
The stubs for click annotate the return type of many of the library's decorator factories as IdentityFunction (e.g. see argument stub, but the revealed type when running mypy is Any. See sample program below.
I'm not sure if this is indicative of an underlying bug in mypy or if there's something missing in the usage of IdentityFunction from typeshed that keeps it from resolving that helper. Insight from someone who is more familiar with the details would be appreciated.
12:17 [snoopjedi@denton ~]
$ python3 -m mypy --strict repro.py
repro.py:3: note: Revealed type is "Any"
repro.py:6: error: Untyped decorator makes function "cli" untyped
repro.py:10: note: Revealed type is "click.core.Command"
Found 1 error in 1 file (checked 1 source file)
Version information
Python: 3.8.10
mypy: 0.910
types-click: 7.1.6
NOTE: I am submitting this issue on behalf of a user who asked a question about it in #python on the Libera IRC network.
If you are using the latest click, you don't need types-click, and you should report any issues to click, not to typeshed. See #5423
Thanks. The issue does not occur for me with click 8.0.3, but this is still a problem for users who are pinned against the older version(s).
Additional information: I have been told that pyright is able to do the right thing with this stub, which along with #5751 makes me think this issue is already being tracked.
For what it's worth, I experienced this regression when migrating between development environments due to a pinned dependency which itself pinned click.
I'm going to completely redo my dependency management in this case because it just makes sense but definitely a regression imo, not sure if it will impact anything else.
The only other report we've had of this kind of problem is with types-retry.
I agree this is problematic and really tough for users to debug, it's something we're now much more aware of / I don't think we really anticipated when we shifted to modular typeshed. There's more discussion in #5751.
In the end my issue does not seem to be related to this library. I thought it would be but I dug more into it and confirmed it is not. Letting you know so you don't worry about it too much hehe.
Activity
JelleZijlstra commentedon Oct 12, 2021
This is probably the same kind of issue as #5751.
Akuli commentedon Oct 12, 2021
If you are using the latest click, you don't need
types-click, and you should report any issues to click, not to typeshed. See #5423SnoopJ commentedon Oct 12, 2021
Thanks. The issue does not occur for me with click 8.0.3, but this is still a problem for users who are pinned against the older version(s).
Additional information: I have been told that pyright is able to do the right thing with this stub, which along with #5751 makes me think this issue is already being tracked.
Closing this issue, thanks for the info y'all.
SamJoan commentedon Nov 30, 2021
For what it's worth, I experienced this regression when migrating between development environments due to a pinned dependency which itself pinned
click.I'm going to completely redo my dependency management in this case because it just makes sense but definitely a regression imo, not sure if it will impact anything else.
hauntsaninja commentedon Nov 30, 2021
The only other report we've had of this kind of problem is with
types-retry.I agree this is problematic and really tough for users to debug, it's something we're now much more aware of / I don't think we really anticipated when we shifted to modular typeshed. There's more discussion in #5751.
SamJoan commentedon Dec 7, 2021
Hi @hauntsaninja
In the end my issue does not seem to be related to this library. I thought it would be but I dug more into it and confirmed it is not. Letting you know so you don't worry about it too much hehe.