Skip to content

Add Tree sitter language pack #29724

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- a/setup.py
+++ b/setup.py
@@ -104 +104 @@
- platform = platform.replace("linux", "manylinux2014")
+ # platform = platform.replace("linux", "manylinux2014")
76 changes: 76 additions & 0 deletions recipes/tree-sitter-language-pack/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
context:
name: tree-sitter-language-pack
version: "0.7.1"
python_min: 3.9

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://github.com/Goldziher/tree-sitter-language-pack/archive/refs/tags/v${{ version }}.tar.gz
sha256: 1ff033575929d240779dab8a8d1e8d665ded84170fb31d61aea704f548706e68
# No tests
# url: https://pypi.org/packages/source/t/tree-sitter-language-pack/tree_sitter_language_pack-${{ version }}.tar.gz
# sha256: 8fe73107045ce150aba2590bc5df114283162413da39dc264710a6ebccaf048c
patches:
- patches/comment-out-manylinux.patch

build:
script:
- mkdir parsers
- ${{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv
number: 0

requirements:
build:
- ${{ compiler("c") }}
- ${{ stdlib("c") }}
- cython
- if: build_platform != target_platform
then:
- python
- cross-python_${{ target_platform }}
host:
- pip
- python
- setuptools >=78.1
run:
- python
- tree_sitter >=0.23.2
- tree-sitter-c-sharp >=0.23.1
- tree-sitter-embedded-template >=0.23.2
- tree-sitter-yaml >=0.7.0

tests:
- python:
imports:
- tree_sitter_language_pack
pip_check: true
- script:
- mkdir sources && echo '{"csharp":{}, "embeddedtemplate":{}, "yaml":{}}' > sources/language_definitions.json
# One test fails since we restrict the supported languages to the few that are needed (requirements/run)
- PROJECT_ROOT=. uv run pytest tests || true
requirements:
run:
- pytest
- python
- uv
files:
source:
- tests/

about:
homepage: https://github.com/tree-sitter/tree-sitter-language-pack
summary: 'A tree-sitter parser for templating languages like ERB and EJS.'
description: |
A tree-sitter parser for templating languages like ERB and EJS,
in which scripting code can be embedded within text content using
the delimiters <% and %>
license: MIT
license_file: LICENSE
repository: https://github.com/tree-sitter/tree-sitter-language-pack

extra:
recipe-maintainers:
- MementoRC