fix: make pyaudio an optional [client] extra so headless installs work - #1304
MushiSenpai wants to merge 1 commit into
Conversation
pyaudio is a core dependency but needs system PortAudio headers to build, so pip install fails on slim / CPU-only / API-only environments. It is used only for native streaming playback in tools/api_client.py. - pyproject.toml: drop pyaudio from core dependencies; add client = ["pyaudio"]. - tools/api_client.py: remove the module-level import; import pyaudio lazily inside the --streaming branch with a friendly ImportError pointing to pip install -e .[client]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This PR is stale because it has been open for 30 days with no activity. |
|
Still applies to current This moves it to an optional |
|
This PR is stale because it has been open for 30 days with no activity. |
|
Re-verified against current
The PR moves it into a |
Move
pyaudioto an optionalclientextra so headless / slim / API-only installs work.pyaudiois a core dependency, but it needs the system PortAudio headers(
portaudio19-dev) to build — sopip installof fish-speech fails on slimcontainers, CPU-only boxes, and any environment that only needs the API/server, not
local audio playback. PyAudio is used in exactly one place: native streaming playback
in
tools/api_client.py.Changes
pyproject.toml— removepyaudiofrom coredependencies; add aclientoptional-dependency group (
client = ["pyaudio"]).tools/api_client.py— drop the module-levelimport pyaudio; import it lazilyinside the
--streamingplayback branch, with a friendlyImportErrorpointing topip install -e .[client].No behavior change for users who already have PyAudio installed; headless/slim installs
now succeed, and only hit the requirement if they actually use streaming playback.
(Same spirit as the input-validation hardening in #1303.)
Disclosure: drafted with AI assistance (Claude); reviewed and submitted by me. The commit carries a
Co-Authored-Bytrailer.