Skip to content

feat: add Python single-file runner with console capture#3

Open
chriswritescode-dev wants to merge 3 commits into
mainfrom
feature/python-runner
Open

feat: add Python single-file runner with console capture#3
chriswritescode-dev wants to merge 3 commits into
mainfrom
feature/python-runner

Conversation

@chriswritescode-dev

Copy link
Copy Markdown
Owner

Adds Python single-file execution support to :ConsoleLogRun. Runs .py files with a zero-dependency stdlib bootstrap (Python 3.8+) that captures print(), logging records, raw sys.stderr writes, and uncaught exceptions.

Features

  • Python file detection: .py files recognized as single-file runnable
  • Interpreter resolution: runner.python_executable config -> $VIRTUAL_ENV -> .venv/venv walking up from file -> system python3
  • Console capture:
    • print() calls with source location (file + line number)
    • logging records at WARNING+ by default
    • Raw sys.stderr writes buffered per-line
    • Uncaught exceptions (including SyntaxError and non-zero SystemExit)
  • Zero dependencies: Single stdlib-only Python 3.8+ script (py/consolelog_runner.py)

Files Changed

  • lua/consolelog/communication/python_runner.lua - Python runner module
  • lua/consolelog/core/constants.lua - Python file detection
  • lua/consolelog/core/init.lua - Runner integration
  • lua/consolelog/core/utils.lua - Utility functions
  • py/consolelog_runner.py - Python bootstrap script
  • tests/lua/python_capture_spec.lua - Capture tests
  • tests/lua/python_runner_spec.lua - Runner tests
  • tests/lua/single_file_run_spec.lua - Updated integration tests

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