grantjenks / py-tree-sitter-languages

Binary Python wheels for all tree sitter languages.
Other
169 stars 48 forks source link

Deprecation warning #61

Open UniverseFly opened 8 months ago

UniverseFly commented 8 months ago

Hi, thanks for the great project. When I load the parser, a deprecation warning would show up:

warn("{} is deprecated. Use {} instead.".format(old, new), FutureWarning)

Should I worry about this?

ObserverOfTime commented 8 months ago

Yes.

jokru commented 8 months ago

Do I understand correctly that every single language grammar implementation would then have to add a pypi package for convenient use? Could/will this library be updated to help with the new version?

andreportela commented 7 months ago

from py-tree-sitter documentation:

image

It seems they are migrating to this implementation to reduce the hassle of using widely available grammar, which is nice. Another benefit is that it seems to be easier to update the grammar you are using. Just poetry update what you need, and you are done; no effort is required from py-tree-sitter maintainers. This is extra nice for them.

On the other hand, the py-tree-sitter deprecation warning looks to me like they will soon drop support altogether for Language.build_library (which is currently core to py-tree-sitter-languages):

image

If there is no alternative to load a grammar that was built from source, it will be up to the grammar devs to provide installable packages already pre-compiled for several platforms. Small grammars might stop working because maybe it would be harder for some maintainers to do this. If one is planning to create a custom grammar for one's own use case, it will take this into consideration. Hum.... It seems off to me... It looks like I'm missing something.

From what I got, py-tree-sitter-languages proposed a tiny wrapper on py-tree-sitter that should make it easier to load the parser you want, and things are even easier because it already bundles a bunch of grammars to you, so you don't need to do it by yourself one-by-one. So the py-tree-sitter-languages value is about making it easier to load the parser you need (I still greatly appreciate that).

Did I understand everything correctly? Have you guys talked to people upstream to check if they are really dropping support for Language.build_library? Or if they still plan to support people using custom grammars?

In a scenario that py-tree-sitter gets easier to work with widely available and well-maintained grammars but gets harder to work with niche grammars, py-tree-sitter-languages would be the perfect fit to work with niche grammars (considering it will still be possible). I am glad to read any other thoughts about this.

ObserverOfTime commented 6 months ago

Since @grantjenks has stated in #54 that he can't maintain this project anymore, here's how you can use the languages currently provided by it in tree-sitter v0.21+:

https://github.com/WhatsApp/tree-sitter-erlang

No package on pypi but can be installed from git (though the version is incorrect).

pip install git+https://github.com/WhatsApp/tree-sitter-erlang

https://github.com/Azganoth/tree-sitter-lua

Unmaintained.

tree-sitter-grammars/tree-sitter-lua can be installed from git (until a package is published).

pip install git+https://github.com/tree-sitter-grammars/tree-sitter-lua

https://github.com/Wilfred/tree-sitter-elisp

Unmaintained?

Submit an issue or pull request there.

https://github.com/ZedThree/tree-sitter-fixed-form-fortran

Unmaintained?

Submit a pull request there.

https://github.com/alemuller/tree-sitter-make

Unmaintained.

Wait for tree-sitter-grammars/tree-sitter-make to be updated.

https://github.com/camdencheek/tree-sitter-dockerfile

No package on pypi (yet) but can be installed from git.

pip install git+https://github.com/camdencheek/tree-sitter-dockerfile

https://github.com/camdencheek/tree-sitter-go-mod

Submit an issue or pull request there.

https://github.com/dhcmrlchtdj/tree-sitter-sqlite

Archived.

Fork it or find an alternative.

https://github.com/elixir-lang/tree-sitter-elixir

No package on pypi but can be installed from git (though the version is incorrect).

pip install git+https://github.com/elixir-lang/tree-sitter-elixir

https://github.com/elm-tooling/tree-sitter-elm

Submit an issue or pull request there.

https://github.com/fwcd/tree-sitter-kotlin

Submit an issue or pull request there.

https://github.com/ganezdragon/tree-sitter-perl

No package on pypi but can be installed from git (though the version is incorrect).

pip install git+https://github.com/ganezdragon/tree-sitter-perl

https://github.com/ikatyang/tree-sitter-markdown

Unmaintained.

tree-sitter-grammars/tree-sitter-markdown has a package on pypi.

pip install tree-sitter-markdown

https://github.com/ikatyang/tree-sitter-yaml

Unmaintained.

tree-sitter-grammars/tree-sitter-yaml has a package on pypi.

pip install tree-sitter-yaml

https://github.com/jiyee/tree-sitter-objc

Unmaintained.

Wait for tree-sitter-grammars/tree-sitter-objc to be updated.

https://github.com/m-novikov/tree-sitter-sql

Uses a C++ scanner which is deprecated.

Submit an issue or pull request to derekstride/tree-sitter-sql.

https://github.com/MichaHoffmann/tree-sitter-hcl

Transferred to tree-sitter-grammars.

Submit an issue or pull request there.

https://github.com/r-lib/tree-sitter-r

No package on pypi but the rewrite can be installed from git.

pip install git+https://github.com/r-lib/tree-sitter-r@next

https://github.com/rydesun/tree-sitter-dot

Unmaintained?

Submit an issue or pull request there.

https://github.com/slackhq/tree-sitter-hack

Submit an issue or pull request there.

https://github.com/stadelmanma/tree-sitter-fortran

Submit an issue or pull request there.

https://github.com/stsewd/tree-sitter-rst

Submit an issue or pull request there.

https://github.com/theHamsta/tree-sitter-commonlisp

Transferred to tree-sitter-grammars.

pip install tree-sitter-commonlisp

https://github.com/tree-sitter/tree-sitter-bash

pip install tree-sitter-bash

https://github.com/tree-sitter/tree-sitter-c

pip install tree-sitter-c

https://github.com/tree-sitter/tree-sitter-c-sharp

pip install tree-sitter-c-sharp

https://github.com/tree-sitter/tree-sitter-cpp

pip install tree-sitter-cpp

https://github.com/tree-sitter/tree-sitter-css

pip install tree-sitter-css

https://github.com/tree-sitter/tree-sitter-embedded-template

pip install tree-sitter-embedded-template

https://github.com/tree-sitter/tree-sitter-go

pip install tree-sitter-go

https://github.com/tree-sitter/tree-sitter-haskell

pip install tree-sitter-haskell

https://github.com/tree-sitter/tree-sitter-html

pip install tree-sitter-html

https://github.com/tree-sitter/tree-sitter-java

pip install tree-sitter-java

https://github.com/tree-sitter/tree-sitter-javascript

pip install tree-sitter-javascript

https://github.com/tree-sitter/tree-sitter-jsdoc

pip install tree-sitter-jsdoc

https://github.com/tree-sitter/tree-sitter-json

pip install tree-sitter-json

https://github.com/tree-sitter/tree-sitter-julia

No package on pypi (yet) but can be installed from git (though the version is incorrect).

pip install git+https://github.com/tree-sitter/tree-sitter-julia

https://github.com/tree-sitter/tree-sitter-ocaml

No package on pypi (yet) but can be installed from git.

pip install git+https://github.com/tree-sitter/tree-sitter-ocaml

https://github.com/tree-sitter/tree-sitter-php

pip install tree-sitter-php

https://github.com/tree-sitter/tree-sitter-python

pip install tree-sitter-python

https://github.com/tree-sitter/tree-sitter-ql

No package on pypi (yet) but can be installed from git (though the version is incorrect).

pip install git+https://github.com/tree-sitter/tree-sitter-ql

https://github.com/tree-sitter/tree-sitter-regex

pip install tree-sitter-regex

https://github.com/tree-sitter/tree-sitter-ruby

pip install tree-sitter-ruby

https://github.com/tree-sitter/tree-sitter-rust

pip install tree-sitter-rust

https://github.com/tree-sitter/tree-sitter-toml

Archived.

tree-sitter-grammars/tree-sitter-toml has a package on pypi.

pip install tree-sitter-toml

https://github.com/tree-sitter/tree-sitter-tsq

Archived.

tree-sitter-grammars/tree-sitter-query has a package on pypi.

pip install tree-sitter-query

https://github.com/tree-sitter/tree-sitter-typescript

pip install tree-sitter-typescript