Repository navigation
Generalize the CLI-bridge rationale to any host, and say why Python needs it too - #6
Merged
Merged
Conversation
…eeds it too The "Why a CLI bridge?" section was written when MATLAB was the only host, so it read as a list of MATLAB workarounds. That framing invites a Python caller to conclude the subprocess is pure overhead and reach for `import sonpy` directly. Usually that does not work, and the reasons belong in this section. Generalizes the existing points from MATLAB to any host, splits crash containment out of interpreter isolation (it is a separate and stronger argument: a sonpy abort() takes down whatever process it is in), and adds a "Why a Python host wants the bridge too" subsection covering what is actually installable. The constraint is tighter than the Apple Silicon note alone suggests. CED publishes sonpy only as prebuilt binaries; the current release covers CPython 3.14 on Linux/macOS and 3.9-3.14 on Windows, with nothing for Linux aarch64. Older releases do not fill the gaps because each is pinned by Requires-Python to a single minor version (1.7.x to 3.7, 1.8.x to 3.8, 1.9.1-1.9.5 to 3.9), so on Linux and macOS `pip install sonpy` fails outright on 3.10 through 3.13 rather than resolving to something older. Verified against the PyPI metadata and by attempting the install on 3.11/Linux. Also notes that a Python host must apply the same completion-sentinel check MATLAB does, since subprocess.returncode has the identical blind spot when the arch -x86_64 wrapper masks a signal death; and fixes the intro and the troubleshooting heading, both of which described the sentinel check as MATLAB's job rather than the host's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139jm1a9oMqVszpKimwSm52
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.
README only (+67/−13). No code changes.
Why
"Why a CLI bridge?" was written when MATLAB was the only host, so it reads as a list of MATLAB workarounds — interpreter isolation from MATLAB's memory space, raw binary so MATLAB can
typecastit. That framing invites a Python caller to conclude the subprocess is pure overhead and reach forimport sonpydirectly.Usually that doesn't work, and the reasons belong in this section rather than being rediscovered.
This came up while planning NDR-python's
.smrxsupport: the first instinct was "import sonpy, the CLI is a MATLAB artifact," and it took readinginstall.shand the PyPI metadata to see why that's wrong.What changed
sonpyabort()takes down whatever process it's in, Python included.subprocess.returncodehas the identical blind spot when thearch -x86_64wrapper masks a signal death, so a Python host that skips it gets silently truncated data in exactly the case the sentinel exists to catch.The constraint is tighter than the Apple Silicon note alone suggests
Current release (1.9.12):
manylinux_2_39)universal2)The part I hadn't expected: older releases don't fill the gaps. Each is pinned by
Requires-Pythonto exactly one minor version — 1.7.x→3.7, 1.8.x→3.8, 1.9.1–1.9.5→3.9. Theirpy3-none-anywheel tag looks permissive but isn't.So on Linux and macOS,
pip install sonpyon CPython 3.10–3.13 fails outright rather than resolving to something older. Not "falls back to an old version" — no candidate at all.Verification
Claims were checked against primary sources, not memory:
Requires-Pythonread from the PyPI JSON metadata for all 14 releases.install.sh(thearch -x86_64wrapper at lines 208–214, and its comment on why it's a wrapper rather than a symlink).One correction worth recording: an early import test appeared to succeed on 3.11. It was picking up a stray
sonpy/download directory as an implicit namespace package —sonpy.__file__wasNoneandfrom sonpy import libfailed. Re-run from a clean working directory, the import fails properly. Nothing from that false positive reached the text.Generated by Claude Code