fix: make pyaudio an optional [client] extra so headless installs work - #1304
Open
MushiSenpai wants to merge 1 commit into
Open
fix: make pyaudio an optional [client] extra so headless installs work#1304MushiSenpai wants to merge 1 commit into
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>
Contributor
|
This PR is stale because it has been open for 30 days with no activity. |
Author
|
Still applies to current This moves it to an optional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.