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
Add py.typed to let mypy get stub for type information #4412
Conversation
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
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.
I think this proposed change both universally fixes the typing error on my setup & properly types proto objects and their fields (see my comment: #4404 (comment))
Co-authored-by: Jakub Bachurski <KubinGH@users.noreply.github.com> Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
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.
LGTM, issue seems to be fixed!
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@@ -340,6 +340,7 @@ def run(self): | |||
packages=packages, | |||
license="Apache License v2.0", | |||
include_package_data=True, | |||
package_data={"onnx": ["py.typed", "*.pyi"]}, |
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.
One nit update: I removed adding py.typed
in MANIFEST.in, because I think this line L343 will do the same thing here. I have tested that the updated ONNX wheel can still produce correct type information.
* Add py.typed to let mypy get stub for type information Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * Update setup.py Co-authored-by: Jakub Bachurski <KubinGH@users.noreply.github.com> Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * add EOF Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> * remove py.typed in MANIFEST because package_data has included it Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com> Co-authored-by: Jakub Bachurski <KubinGH@users.noreply.github.com>
Description
Motivation and Context
Fixes #4404.