-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add stubs for antlr4 #11192
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 stubs for antlr4 #11192
Conversation
This comment has been minimized.
This comment has been minimized.
Moved antlr4 stubs
|
The stubs need to have the directory structure |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It looks like I can easily clean up the Test / Test typeshed with pyright failures by referencing and tracing through the source. for the Third-party stubtests, what's the best way to resolve issues where the source devs initialize variables to None? |
I haven't looked at the def foo(name=None): ...And you've written a stub like this: def foo(name: str = ...) -> None: ...Then, to make stubtest happy, you generally need to change it to something like this: def foo(name: str | None = None) -> None ...Since the function obviously won't raise an error if |
|
Most of the pyright errors seem to be referencing missing generic arguments. The best option is to add the proper generic arguments. But if you don't have the bandwidth for that, it's fine to use I haven't looked at the stubtest problems yet, but this indicates a mismatch between the implementation and the stubs. |
|
@srittau I have half the missing generic arguments fixed in a dev branch. I'm looking at the source to make sure |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Any advice on these errors? I don’t see any calls to StringIO.truncate in XPathLexer.pyi, and XPathLexer.pyi is not even 73 lines long‽ |
Looks like it's because you're re-exporting |
|
Thanks! This is the way stubgen created the file. Should I remove the “as Foo” from all the imports? |
|
Last errors: |
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
All green and good to go from my end. |
|
@AlexWaygood what’s the usual wait time from “all good” to “merge”? Anything I need to do? |
Sorry for the wait. I'm afraid I'm more busy than usual at the moment, so probably won't be able to take a proper look at this soon. Hopefully somebody else on the team will be able to take a look soon, but I'm afraid we're all volunteers, so I can't make any promises about timescale here :( |
|
@AlexWaygood No problem. I noticed there were other mergers and wanted to make sure there wasn’t anything I needed to do. |
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.
Thanks! Looks mostly good to me, although I didn't compare it to the implementation in-depth. A few things I noticed below.
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
|
The "Run mypy on the test cases" error is unrelated. |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
|
Thanks so much! I’m curious how long it takes for the types_antlr4 package to show up at PYPI? |
|
The types are built once per day, I think during the night UTC time. |
No description provided.