Skip to content

fix: surface generate_ast.py failures with a clear error#76

Merged
barjin merged 1 commit into
masterfrom
fix/surface-pydoc-script-failures
Jun 3, 2026
Merged

fix: surface generate_ast.py failures with a clear error#76
barjin merged 1 commit into
masterfrom
fix/surface-pydoc-script-failures

Conversation

@vdusek
Copy link
Copy Markdown

@vdusek vdusek commented Jun 3, 2026

Summary

processPythonDocs only checks spawnSync().error, which is set when the spawn itself fails — a non-zero exit of generate_ast.py (e.g. pydoc-markdown not importable by the resolved python) went completely unnoticed. The plugin then crashed later with a confusing ENOENT: pydoc-markdown-dump.json, hiding the real cause.

This is exactly what made the broken Version docs CI job in apify/apify-sdk-python (failed 3.4.0/3.4.1 doc releases) hard to diagnose — see apify/apify-sdk-python#928 for the workflow-side fix.

Now the exit code is checked and the script's stderr is included in the thrown error:

[ERROR] Error: The generate_ast.py script failed with exit code 1:
ModuleNotFoundError: No module named pydoc_markdown

Verified by building the plugin, dropping the compiled output into the SDK website's node_modules, and running docusaurus api:version with a stub python that exits 1.

spawnSync only sets .error when the spawn itself fails — a non-zero exit of
the script went unnoticed and the plugin died later with a confusing
"ENOENT: pydoc-markdown-dump.json". Check the exit code and include the
script's stderr in the thrown error so the real cause (e.g. a missing
pydoc-markdown install) is visible in CI logs.
@vdusek vdusek added the bug Something isn't working label Jun 3, 2026
@vdusek vdusek self-assigned this Jun 3, 2026
@vdusek vdusek requested review from barjin and janbuchar and removed request for janbuchar June 3, 2026 10:03
@barjin barjin merged commit 62f5c2c into master Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants