-
Notifications
You must be signed in to change notification settings - Fork 106
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 typing information #68
Conversation
This is great. Is there a command we can run on CI that checks that the tests conform to the types declared in this file? |
Note there's another type stub I linked in this issue: #58 |
@lunixbochs Sry did not see that. @maxbrunsfeld I added mypy to check the test_tree_sitter.py module. |
I had to remove the mypy test for pypy. The typed-ast package is not able to build under pypy3.7 (see python/typed_ast#111). |
Ok, I approved it so it's running and we can see if the CI passes. @lunixbochs You're more familiar with Python tooling. Do you like this solution for adding types? I'm cool with it, since it seems to pass on CI. |
Is there something missing or anything I can do to get it merged? |
@DorianCzichotzki were these manually written? I believe you don't need the |
what is needed for this to merge, it would be super helpful! |
I just need to find some time to merge the two approaches and update the stubs. |
Any update on this PR? I'd also like to use it :) |
I added tree-sitter stubs to typeshed. Run It would still be preferable to have them here, but it's a relatively small package, so typeshed maintainers will also do a good job of maintaining the stubs if the types never make it to py-tree-sitter. |
Superseded by #150 |
Greate work on tree-sitter and the python binding. The only issue I found was, that there are no type hints. That makes it very hard to work with the package.
I created this PR to add a stub file containing the type definitions for the C extension. This should help tools like mypy and IDEs to show docstrings and provide better code completion support.
I hope the definitions are complete.