Commit 62f5c2c
authored
fix: surface generate_ast.py failures with a clear error (#76)
## 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.1 parent 8ba5cfe commit 62f5c2c
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
0 commit comments