Skip to content

fix(piper_tts): find the piper binary in the venv when not on PATH - #680

Closed
TheCause wants to merge 1 commit into
OpenMontageInc:mainfrom
TheCause:fix/piper-venv-binary
Closed

TheCause wants to merge 1 commit into
OpenMontageInc:mainfrom
TheCause:fix/piper-venv-binary

Conversation

@TheCause

Copy link
Copy Markdown

Summary

make setup installs piper-tts into .venv/bin. piper_tts.get_status() only checked shutil.which("piper"), so unless the venv was activated in the shell, the tool reported UNAVAILABLE while installed (e.g. when an agent runs .venv/bin/python -c ... without activating). It now also looks next to the running interpreter, and _generate calls the binary it found.

Related issue

None — found while running the preflight from a non-activated venv.

Changes

  • tools/audio/piper_tts.py: _piper_binary() — PATH first, then Path(sys.executable).parent / "piper"; used by get_status() and _generate().
  • tests/tools/test_piper_venv_binary.py: found in the venv when not on PATH; UNAVAILABLE when absent everywhere.

Testing

  • The venv test fails on current main and passes with the fix.
  • pytest tests: 1831 passed, 11 skipped, 3 xfailed (macOS, Python 3.12).

Checklist

  • The change is focused on a single logical concern.
  • I ran the relevant tests locally (make test-contracts / make test) where applicable.
  • I updated docs/README if behavior or usage changed. (no doc change needed)
  • No unrelated files (build artifacts, local config) are included in the diff.

🤖 Generated with Claude Code

`make setup` installs piper into .venv/bin, so unless the venv was activated
the tool reported UNAVAILABLE while installed. Look next to the running
interpreter as a fallback, and call that binary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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