diff --git a/pyproject.toml b/pyproject.toml index a46be9b74..18f04bd3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,11 +91,11 @@ proxy-prod = [ "gunicorn>=21.0.0; sys_platform != 'win32'", ] # AST-based code compression (tree-sitter) -# NOTE: cap below 1.0. tree-sitter-language-pack 1.x is a breaking rewrite whose -# get_language()/get_parser() return the pack's own binding types instead of -# standalone tree_sitter.Language/Parser, so _get_parser() in -# transforms/code_compressor.py fails and code compression silently no-ops. -# The 0.x line (>=0.10,<1.0) returns standalone tree_sitter objects as expected. +# tree-sitter-language-pack >=1.0 removed the bundled tree-sitter package and +# switched to an incompatible internal node API (.kind vs .type, callable +# root_node, etc.). Pin to <1.0.0 so that tree-sitter>=0.25.2 is pulled in +# as a transitive dependency and the existing code_compressor.py node-walk +# logic continues to work. See issue #1216. code = [ "tree-sitter-language-pack>=0.10.0,<1.0", "tree-sitter>=0.25.2,<0.27", diff --git a/tests/test_transforms/test_tree_sitter_thread_safety.py b/tests/test_transforms/test_tree_sitter_thread_safety.py index 5d551bbe1..6c9c99387 100644 --- a/tests/test_transforms/test_tree_sitter_thread_safety.py +++ b/tests/test_transforms/test_tree_sitter_thread_safety.py @@ -98,7 +98,7 @@ def test_parser_usable_in_thread_pool() -> None: def parse_in_worker() -> bool: parser = _get_parser("python") - tree = parser.parse("x = 1\n") + tree = parser.parse(b"x = 1\n") return tree is not None with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor: