Skip to content

Issue 1 fix : Fix Python 3.12+ Tree-sitter Installation & Enhance TUI Copyability#3

Merged
FatinShadab merged 5 commits into
mainfrom
issue_1_fix
Jun 1, 2026
Merged

Issue 1 fix : Fix Python 3.12+ Tree-sitter Installation & Enhance TUI Copyability#3
FatinShadab merged 5 commits into
mainfrom
issue_1_fix

Conversation

@FatinShadab

Copy link
Copy Markdown
Member

Merge Description: Fix Python 3.12+ Tree-sitter Installation & Enhance TUI Copyability

Summary

This branch resolves installation failures on Python 3.12+ environments (specifically macOS Apple Silicon / ARM64) caused by unavailable pinned legacy Tree-sitter dependencies (closes #1). It also introduces feature enhancements for the Textual TUI, making console logs copyable.


Changes

1. Tree-sitter Dependency & Parser Compatibility (Fixes #1)

  • Dual Dependency Pinning: Modified pyproject.toml and requirements.txt to keep tree-sitter and grammar packages (python, javascript, typescript, go, rust) pinned to 0.21.x for Python < 3.12, while using loose constraints (>=0.23, <0.26) for Python >= 3.12.
  • API Signature Compatibility: Updated parser initialization in src/codegenome/parser.py with a fallback try-catch block to dynamically support both legacy (0.21.x) and modern (>=0.23) Tree-sitter Parser initialization signatures without runtime errors.
  • CI Integration: Added a compatibility test matrix (.github/workflows/compatibility.yml) running install, parser, and CLI smoke checks on Ubuntu and macOS-14 environments using Python 3.11, 3.12, and 3.13.

2. TUI Enhancements (Copy to Clipboard)

  • Read-Only Interactive Logs: Replaced default RichLog with a custom ReadOnlyRichLog widget in src/codegenome/tui.py.
  • Keyboard Shortcuts: Added a Ctrl+C binding to copy selected log text to the clipboard instead of abruptly quitting the app (graceful fallback prompt provided when no text is selected).
  • Robust Log Protections: Prevented standard keyboard input in log views to avoid accidentally editing logged outputs.
  • Test Coverage: Added dedicated unit tests in tests/test_tui.py validating the custom log selection output, read-only guarantees, and keyboard bindings.

3. Documentation


Verification & Testing

  • Verified that installation completes successfully in pristine Python 3.12+ virtual environments.
  • Ran and passed the parser and compatibility test suite across target Python versions.
  • Manually tested the TUI log text selection and copy-to-clipboard functionality via Ctrl+C.

FatinShadab and others added 5 commits June 1, 2026 10:02
… 3.11

Pinned tree-sitter grammar packages at 0.21.x are not published for Python
3.12+, which blocks pip/pipx installs on macOS Apple Silicon and other
3.12 environments.

Keep the existing 0.21.x pins for Python <3.12 and add bounded >=0.23,<0.26
constraints for Python >=3.12 across core and grammar packages in
pyproject.toml and requirements.txt.

Add _build_language() in the parser to tolerate legacy and modern
tree_sitter.Language constructor signatures so upgraded grammars do not
fail at runtime.

Add parser API regression tests and a compatibility CI matrix
(ubuntu + macos-14, Python 3.11/3.12/3.13) with install, parser, and CLI
smoke checks.

Changelog: document Tree-sitter install fix for 3.12+.
made the tui console outputs copyable
@FatinShadab FatinShadab merged commit 054ea60 into main Jun 1, 2026
4 of 7 checks passed
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.

Issues are disabled for the selected repository. Please select a different repository.

2 participants