fix(hyperframes-media): install MusicGen deps via python3 -m pip, not bare pip#1894
Draft
miguel-heygen wants to merge 1 commit into
Draft
fix(hyperframes-media): install MusicGen deps via python3 -m pip, not bare pip#1894miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
… bare pip pipInstall() spawned a bare "pip" binary. Many Homebrew/system Python installs expose only python3/pip3 on PATH, so the spawn silently ENOENTs and the documented "auto-installed on demand" local MusicGen path never actually installs anything - the failure is invisible since spawnSync's status just comes back non-zero like any other install failure. Switched to `python3 -m pip install`, matching this same file's own pyOk() convention of always invoking python3 explicitly. This also closes a second latent bug: a bare pip/pip3 could resolve to a different Python installation than the python3 binary pyOk() probes against if more than one is on PATH, so `-m pip` guarantees the install lands in the exact interpreter being checked. Manually verified `python3 -m pip --version` succeeds in this environment. No automated test added - this is a literal command-array swap with no new branching logic, and spawnSync is a named import from node:child_process with no clean mocking path available without a larger refactor disproportionate to the fix's size.
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.
Summary
pipInstall()inbgm.mjsspawned a barepipbinary. Many Homebrew/system Python installs expose onlypython3/pip3on PATH, so the spawn silentlyENOENTs and the "auto-installed on demand" local MusicGen path never actually installs anything — indistinguishable from any other install failure, sincespawnSync's status just comes back non-zero either way.Fix
Switched to
python3 -m pip install, matching this same file's ownpyOk()helper, which already always invokespython3explicitly (never a barepython). This also closes a second, more subtle latent bug: even with a workingpip/pip3on PATH, it could resolve to a different Python installation than thepython3binarypyOk()probes against if more than one is installed —-m pipguarantees the install lands in the exact interpreter being checked.Test plan
python3 -m pip --versionsucceeds in this environmentspawnSyncis a named import fromnode:child_processwith no clean mocking path available here without a refactor disproportionate to the fix's size (this Node version doesn't supportnode:test'smock.module()without an experimental flag, confirmed by trying it)