fix(python): require tree-sitter>=0.25 for the ABI 15 grammars - #57
Open
PYDuquesnoy wants to merge 1 commit into
Open
PYDuquesnoy wants to merge 1 commit into
PYDuquesnoy wants to merge 1 commit into
Conversation
The `core` extra pinned `tree-sitter~=0.23`, which admits 0.23.x and 0.24.x. All five generated parsers declare LANGUAGE_VERSION 15, and py-tree-sitter only accepts ABI 15 from 0.25: on 0.23.2 and 0.24.0 the Language object constructs but `Parser(language)` raises "ValueError: Incompatible Language version 15. Must be between 13 and 14". - pyproject: core = ["tree-sitter>=0.25,<1"] - README: install line pins "tree-sitter>=0.25" - bindings/python/tests: assert every grammar reports abi_version == 15 (the attribute itself only exists from 0.25, so the test also guards the floor) Fixes intersystems#56 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Python distribution's only
tree-sitterrequirement is the optional extracore = ["tree-sitter~=0.23"].~=0.23means>=0.23, ==0.*, so it admits 0.23.x and 0.24.x, but every generated parser is ABI 15 (#define LANGUAGE_VERSION 15in all fivesrc/parser.c), and py-tree-sitter only accepts ABI 15 from 0.25.Verified with the released
tree-sitter-objectscript==1.9.22wheel on Python 3.12:Language(language_objectscript_udl())Parser(language)ValueError: Incompatible Language version 15. Must be between 13 and 14abi_version == 15abi_version == 15So an environment that already has 0.23/0.24 installed satisfies the extra and fails at the first parse rather than at install time.
Changes
pyproject.toml:core = ["tree-sitter>=0.25,<1"]README.md: the install line pins"tree-sitter>=0.25"bindings/python/tests/test_binding.py: new test asserting each of the three grammars reportsabi_version == 15(the attribute only exists from py-tree-sitter 0.25, so the test doubles as a guard on the floor)Not touched, for the maintainers to decide: making
tree-sittera regular dependency instead of an extra (the wheel is unusable from Python without it), and thepyproject.tomlversion (1.9.20 here vs 1.9.22 on PyPI).Verification
Fixes #56.
🤖 Generated with Claude Code