docs: correct mermaid-py behavior in comments (remote API, not local Node.js) - #110
Conversation
…Node.js) mermaid-py (>=0.8.0, the version this project pins) validates diagrams by sending them to a remote rendering service (https://mermaid.ink by default, overridable via mermaid-py's own MERMAID_INK_SERVER env var), not by spawning a local Node.js subprocess. Verified by inspecting the mermaid-py 0.8.0 and 0.8.4 source directly (mermaid/__main__.py uses requests.get() against MERMAID_INK_SERVER, no subprocess/child_process anywhere). This corrects two comments that describe the old (inaccurate, or possibly just always-wrong) assumption: - codewiki/src/be/utils.py: the _MERMAID_PY_BROKEN comment - pyproject.toml: the nodejs build-requires comment No functional change. The nodejs build-requires entry itself is left as-is since I couldn't confirm whether it's needed for something else in the project; flagging it for maintainers to reconsider.
|
I noticed the It looks unrelated to this diff. The 16 Reproduced locally: with Not sure if pinning a |
…ils.py - pyproject.toml: state why Node.js/npm is still required — PythonMonkey (via mermaid-parser-py) shells out to npm at install time. mermaid-py itself validates via the remote mermaid.ink API. - pyproject.toml: pin [tool.ruff.lint] select to ruff's pre-0.16 defaults so the unpinned `pip install ruff` in CI stops flagging pre-existing code whenever a file is touched. - utils.py: note that validation sends diagram content to a third-party service; fix a stale "broken Node.js setup" comment; drop the unused traceback import; apply `ruff format` so the CI format check passes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks for this. Your reading of mermaid-py is correct (verified against 0.8.4: I pushed a small follow-up commit on top of yours (8be46ef) rather than round-tripping via review comments:
Will merge once CI is green. Closes #109. |
Related to #109 — posting this alongside that issue in case my reading is correct, easy to close either without merging if I'm wrong about something.
mermaid-py(>=0.8.0, the version pinned inpyproject.toml) validates diagrams by sending them to a remote rendering service (https://mermaid.inkby default, overridable via mermaid-py's ownMERMAID_INK_SERVERenv var) — not by spawning a local Node.js subprocess. I checked this in bothmermaid-py==0.8.0and the current0.8.4:Mermaid.__init__calls_make_request_to_mermaid(), which does a plainrequests.get(). Nosubprocess/child_process/Popen/os.systemanywhere in the package.This PR only corrects the wording in two comments to match:
codewiki/src/be/utils.py: the_MERMAID_PY_BROKENcommentpyproject.toml: thenodejsbuild-requirescommentNo functional change. I left the
nodejsbuild-requiresentry itself alone since I couldn't confirm whether it's needed for something unrelated tomermaid-py— happy to remove it too if you confirm it isn't.