Skip to content

Conversation

rmuir
Copy link
Owner

@rmuir rmuir commented Jul 4, 2025

Fix python bindings to just work with 'pip install'.
Add a failing test that would have indicated the issue in CI.
Test python bindings against ABI 14 and publish ABI 14 wheels in pypi.

rmuir added 2 commits July 3, 2025 23:42
Fix python bindings to just work with 'pip install'.
Add a failing test that would have indicated the issue in CI.
Test python bindings against ABI 14 and publish ABI 14 wheels in pypi.
@rmuir rmuir requested a review from Copilot July 4, 2025 03:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures Python bindings use the highest supported Tree-sitter ABI (14) by updating tests and CI/CD workflows.

  • Refactors test_binding.py to use the public Tree-sitter Python API, introduces a helper, and adds tests that would fail on unsupported ABI.
  • Switches Makefile to allow environment overrides for TREE_SITTER_ABI_VERSION.
  • Updates GitHub workflows to publish ABI 14 wheels, disable the default Python test until support exists, and add a dedicated “ABI 14” CI job.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
bindings/python/tests/test_binding.py Use Language/Parser imports, add language() helper, new tests
Makefile Change ABI version assignment to conditional (?=)
.github/workflows/publish.yml Publish Python wheels with ABI 14 and enable generation
.github/workflows/ci.yml Disable default Python CI, add matrix job for ABI 14 testing
Comments suppressed due to low confidence (3)

bindings/python/tests/test_binding.py:8

  • [nitpick] The helper function name language is very generic and may clash with built-ins; consider renaming it to something more descriptive like get_javadoc_language.
def language():

bindings/python/tests/test_binding.py:14

  • This test does not have an assertion or use the result; consider asserting the returned object is a Language instance to validate grammar loading.
        _ = language()

.github/workflows/ci.yml:76

  • The macos-15 label is not a valid GitHub Actions runner; consider using macos-latest or a supported version such as macos-12.
        os: [ubuntu-latest, windows-latest, macos-15]

parser = Parser(language())
doc = "/** test */".encode()
tree = parser.parse(doc)
assert not tree.root_node.has_error
Copy link
Preview

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use self.assertFalse(tree.root_node.has_error, 'Parsing errors detected') instead of a bare assert to leverage unittest assertion methods and provide a clearer failure message.

Suggested change
assert not tree.root_node.has_error
self.assertFalse(tree.root_node.has_error, 'Parsing errors detected')

Copilot uses AI. Check for mistakes.

@rmuir rmuir merged commit 1c20c06 into main Jul 4, 2025
21 checks passed
@rmuir rmuir deleted the python-abi-14 branch July 4, 2025 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant