-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fully typed setuptools setup method #15146
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
Fully typed setuptools setup method #15146
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
srittau
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one nit below, LGTM apart from that.
| __version__: str | ||
|
|
||
| @type_check_only | ||
| class _DictLike(Protocol[_KT, _VT_co]): # type: ignore[misc] # Covariant type as parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ironically and coincidentally, this is very similar to the MappingLike protocol I just suggested in #15152. (Although we need this protocol here for now anyway, even if the former gets merged, until these definitions have made their way into all relevant type checkers.)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Pulled directly from https://github.com/pypa/setuptools/pull/5021/files . But with an extra effort to try and use a dict-like protocol instead of a
dictas parameter.setuptools contributions have been stalling in the past year, thought I'd be done with it sooner. So I'm adding these here to for more parameters autocomplete and more flexible parameter types.