From d3c32a8dea0d9c85f3c33b30543c560ff572c132 Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 13 Apr 2025 16:30:48 -0500 Subject: [PATCH 1/8] Add tree-sitter-language-pack --- recipes/tree-sitter-language-pack/recipe.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 recipes/tree-sitter-language-pack/recipe.yaml diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml new file mode 100644 index 0000000000000..f6a356c83d9c6 --- /dev/null +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -0,0 +1,66 @@ +context: + name: tree-sitter-language-pack + version: "0.7.1" + python_min: 3.9 + +package: + name: ${{ name|lower }} + version: ${{ version }} + +source: + url: https://pypi.org/packages/source/t/tree-sitter-language-pack/tree_sitter_language_pack-${{ version }}.tar.gz + sha256: 7b24dcf2e92497f54323e617564d36866230a8bfb719dbb7b45b461510dcddaa + +build: + script: | + python -m pip install . --no-deps --ignore-installed -vv + number: 0 + +requirements: + build: + - ${{ compiler("c") }} + - ${{ stdlib("c") }} + - cython + - if: target_platform != build_platform + then: + - python + - cross-python_${{ target_platform }} + host: + - pip + - python + - setuptools >=42 + - 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 + run: + - python + +tests: + - python: + imports: + - tree_sitter_language_pack + pip_check: true + - script: + - python -m pytest tests/ + requirements: + run: + - python >=${{ python_min }} + 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 From 0f82ad1940c4fde20b7d82c0ec347c408cce896e Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 13 Apr 2025 17:35:42 -0500 Subject: [PATCH 2/8] Add tree-sitter-language-pack --- .../patches/comment-out-manylinux.patch | 5 +++++ recipes/tree-sitter-language-pack/recipe.yaml | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 recipes/tree-sitter-language-pack/patches/comment-out-manylinux.patch diff --git a/recipes/tree-sitter-language-pack/patches/comment-out-manylinux.patch b/recipes/tree-sitter-language-pack/patches/comment-out-manylinux.patch new file mode 100644 index 0000000000000..b9e66213b156f --- /dev/null +++ b/recipes/tree-sitter-language-pack/patches/comment-out-manylinux.patch @@ -0,0 +1,5 @@ +--- a/setup.py ++++ b/setup.py +@@ -104 +104 @@ +- platform = platform.replace("linux", "manylinux2014") ++ # platform = platform.replace("linux", "manylinux2014") diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index f6a356c83d9c6..06fb83ed4a064 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -9,11 +9,13 @@ package: source: url: https://pypi.org/packages/source/t/tree-sitter-language-pack/tree_sitter_language_pack-${{ version }}.tar.gz - sha256: 7b24dcf2e92497f54323e617564d36866230a8bfb719dbb7b45b461510dcddaa + sha256: 8fe73107045ce150aba2590bc5df114283162413da39dc264710a6ebccaf048c + patches: + - patches/comment-out-manylinux.patch build: script: | - python -m pip install . --no-deps --ignore-installed -vv + ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv number: 0 requirements: @@ -21,7 +23,7 @@ requirements: - ${{ compiler("c") }} - ${{ stdlib("c") }} - cython - - if: target_platform != build_platform + - if: build_platform != target_platform then: - python - cross-python_${{ target_platform }} @@ -29,7 +31,7 @@ requirements: - pip - python - setuptools >=42 - - tree-sitter >=0.23.2 + - 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 @@ -45,7 +47,7 @@ tests: - python -m pytest tests/ requirements: run: - - python >=${{ python_min }} + - python files: source: - tests/ From 8d781753133f36f9c17bf84465f1af43c63e6bc0 Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 13 Apr 2025 18:03:09 -0500 Subject: [PATCH 3/8] (fix) run dep. pytest selected test --- recipes/tree-sitter-language-pack/recipe.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index 06fb83ed4a064..9f10753b896d0 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -31,12 +31,12 @@ requirements: - pip - python - setuptools >=42 + 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 - run: - - python tests: - python: @@ -44,9 +44,10 @@ tests: - tree_sitter_language_pack pip_check: true - script: - - python -m pytest tests/ + - python -m pytest tests/entry_point_test.py requirements: run: + - pytest - python files: source: From ddbfcc442077146f868a5619dd17a80bd6fd8fee Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 13 Apr 2025 18:13:43 -0500 Subject: [PATCH 4/8] (fix) no tests in pypi sources --- recipes/tree-sitter-language-pack/recipe.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index 9f10753b896d0..14265dcddc2e1 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -8,8 +8,11 @@ package: version: ${{ version }} source: - url: https://pypi.org/packages/source/t/tree-sitter-language-pack/tree_sitter_language_pack-${{ version }}.tar.gz - sha256: 8fe73107045ce150aba2590bc5df114283162413da39dc264710a6ebccaf048c + 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 From 9f89c4b32715a35f849a79f562d4e46b54ee0f74 Mon Sep 17 00:00:00 2001 From: memento Date: Sun, 13 Apr 2025 21:32:58 -0500 Subject: [PATCH 5/8] (fix) add tests. hack due to one test failing --- recipes/tree-sitter-language-pack/recipe.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index 14265dcddc2e1..5f1b3a564f788 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -18,6 +18,7 @@ source: build: script: | + cd ${SRC_DIR} && mkdir parsers ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv number: 0 @@ -33,7 +34,7 @@ requirements: host: - pip - python - - setuptools >=42 + - setuptools >=78.1 run: - python - tree_sitter >=0.23.2 @@ -47,11 +48,14 @@ tests: - tree_sitter_language_pack pip_check: true - script: - - python -m pytest tests/entry_point_test.py + - 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/ From aa8e241f55ea24df3e7d7372094cacdb3f3b2bb4 Mon Sep 17 00:00:00 2001 From: memento Date: Mon, 14 Apr 2025 10:22:15 -0500 Subject: [PATCH 6/8] (fix) non-unix --- recipes/tree-sitter-language-pack/recipe.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index 5f1b3a564f788..ed946d93baf0e 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -17,9 +17,14 @@ source: - patches/comment-out-manylinux.patch build: - script: | - cd ${SRC_DIR} && mkdir parsers - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv + script: + - if: unix + then: + - cd ${SRC_DIR} && mkdir parsers + - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv + else: + - cd %SRC_DIR% && mkdir parsers + - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=%PREFIX% -vv number: 0 requirements: From 9e95b07ba72c7b0030597f7d797ee1209e552e0a Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 17 Apr 2025 17:44:42 -0500 Subject: [PATCH 7/8] (ref) remove --prefix --- recipes/tree-sitter-language-pack/recipe.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index ed946d93baf0e..3383c071850ce 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -18,13 +18,15 @@ source: build: script: - - if: unix - then: - - cd ${SRC_DIR} && mkdir parsers - - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv - else: - - cd %SRC_DIR% && mkdir parsers - - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=%PREFIX% -vv + - mkdir parsers + - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv + # - if: unix + # then: + # - cd ${SRC_DIR} && mkdir parsers + # - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv + # else: + # - cd %SRC_DIR% && mkdir parsers + # - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=%PREFIX% -vv number: 0 requirements: From cd35f4b20da1f01e65f53f239894a360e7684fbf Mon Sep 17 00:00:00 2001 From: memento Date: Thu, 17 Apr 2025 18:14:33 -0500 Subject: [PATCH 8/8] (ref) cleanup --- recipes/tree-sitter-language-pack/recipe.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/recipes/tree-sitter-language-pack/recipe.yaml b/recipes/tree-sitter-language-pack/recipe.yaml index 3383c071850ce..16d3b5dbbc4a4 100644 --- a/recipes/tree-sitter-language-pack/recipe.yaml +++ b/recipes/tree-sitter-language-pack/recipe.yaml @@ -20,13 +20,6 @@ build: script: - mkdir parsers - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv - # - if: unix - # then: - # - cd ${SRC_DIR} && mkdir parsers - # - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=${PREFIX} -vv - # else: - # - cd %SRC_DIR% && mkdir parsers - # - ${{ PYTHON }} -m pip install . --no-deps --ignore-installed --prefix=%PREFIX% -vv number: 0 requirements: