fix(code): pin tree-sitter-language-pack <1.0.0 in [code] extra (#1219)

## Description

<!-- Briefly explain the change and why it is needed. -->

Closes #

## Type of Change

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring (no functional changes)

## Changes Made

- 

## Testing

<!-- Check what you actually ran, then paste the real command output
below. -->

- [ ] Unit tests pass (`pytest`)
- [ ] Linting passes (`ruff check .`)
- [ ] Type checking passes (`mypy headroom`)
- [ ] New tests added for new functionality
- [ ] Manual testing performed

### Test Output

```text
# Paste relevant command output or artifact links here
```

## Real Behavior Proof

- Environment:
- Exact command / steps:
- Observed result:
- Not tested:

## Review Readiness

- [ ] I have performed a self-review
- [ ] This PR is ready for human review

## Checklist

- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have updated the CHANGELOG.md if applicable

## Screenshots (if applicable)

Add screenshots to help explain your changes.

## Additional Notes

<!-- Mention any N/A checklist items, tradeoffs, follow-ups, or
maintainer context. -->

---------

Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
This commit is contained in:
TUTU244 2026-07-16 05:54:25 +09:00 committed by GitHub
parent 1c50eca8b3
commit 412db40a0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -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",

View file

@ -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: