Skip to content
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

tree-sitter version must be bound in requirements.txt #14

Open
mahtab-nejati opened this issue Jul 11, 2024 · 2 comments
Open

tree-sitter version must be bound in requirements.txt #14

mahtab-nejati opened this issue Jul 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mahtab-nejati
Copy link
Contributor

mahtab-nejati commented Jul 11, 2024

I was trying this parser in a new environment where I installed tree-sitter==0.22.3 on MacOS, but I kept getting the following error:

Traceback (most recent call last):
  File "/.../tree-sitter-parser/tree-sitter-parser.py", line 55, in <module>
    main()
  File "/.../tree-sitter-parser/tree-sitter-parser.py", line 41, in main
    parsers = init_parsers(script_dir)
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../tree-sitter-parser/tree_sitter_parser/__init__.py", line 22, in init_parsers
    if Language.build_library(
       ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'tree_sitter.Language' has no attribute 'build_library'

My attempt in another environment with tree_sitter==0.20.1 was successful. It might be a good idea to bind the tree-sitter requirement to a specific version. You can see this discussion for more information.

@mpadge
Copy link

mpadge commented Aug 8, 2024

I'm setting the same error, with a few tree_sitter versions between 0.20.1 and 0.22.6, so it doesn't seem directly related to that.

@jrfaller jrfaller self-assigned this Aug 11, 2024
@jrfaller
Copy link
Member

Thanks for the report. It seems that this function was removed : tree-sitter/py-tree-sitter#145 (comment) 😢

However, there does not seem to be any replacement... We might have to rethink how we integrate with the Python binding. In the meantime, you can try the Java binding (gen.treesitter-ng).

Cheers.

@jrfaller jrfaller added the bug Something isn't working label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants