Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
py-tree-sitter
somewhat recently had a major breaking release that removedLanguage.build_library
and changed the signature ofLanguage
to:which means that using
tree-sitter-rst
from python requires language bindings.If you merge the PR we'd have to publish to
tree-sitter-rst
on PyPI, which is currently published frompy-tree-sitter-rst
(cc @Carreau).In this PR I've copied / adapted the binding implementation from
tree-sitter-python
, which works but may not be the most elegant. In particular, I had to include all the files that are usually auto-generated bytree-sitter
fromgrammar.js
(and any other requires files) in the sdist. Maybe it would be better to calltree-sitter build
/tree-sitter generate
while building the wheel instead?tree-sitter
also appears to have moved its configuration frompackage.json
totree-sitter.json
, so this is included in the PR. If you prefer a smaller PR I can definitely move all of the automatic changes to a separate PR.