Skip to content

Commit d8c3f6c

Browse files
committed
fix(smoke): Create _static/_templates dirs and print captured output on failure
why: smoke_gp_sphinx was missing the standard project directories that merge_sphinx_config() defaults expect (html_static_path/_static, templates_path/_templates), causing a Sphinx -W fatal warning 'html_static_path entry _static does not exist'. The subprocess output was also silently swallowed, making CI failures opaque. what: - Create _static/ and _templates/ in smoke_gp_sphinx temp docs dir - Print captured stdout/stderr on CalledProcessError in _run() helper
1 parent 69bc4be commit d8c3f6c

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

scripts/ci/package_tools.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,21 @@ def _run(
197197
cmd_env = os.environ.copy()
198198
if env:
199199
cmd_env.update(env)
200-
return subprocess.run(
201-
args,
202-
check=True,
203-
cwd=str(cwd) if cwd else None,
204-
env=cmd_env,
205-
text=True,
206-
capture_output=True,
207-
)
200+
try:
201+
return subprocess.run(
202+
args,
203+
check=True,
204+
cwd=str(cwd) if cwd else None,
205+
env=cmd_env,
206+
text=True,
207+
capture_output=True,
208+
)
209+
except subprocess.CalledProcessError as exc:
210+
if exc.stdout:
211+
sys.stdout.write(exc.stdout)
212+
if exc.stderr:
213+
sys.stderr.write(exc.stderr)
214+
raise
208215

209216

210217
def _create_venv(tmpdir: pathlib.Path) -> pathlib.Path:
@@ -379,6 +386,9 @@ def smoke_gp_sphinx(dist_dir: pathlib.Path, version: str) -> None:
379386
tmpdir = pathlib.Path(tmp)
380387
docs_dir = tmpdir / "docs"
381388
docs_dir.mkdir()
389+
# Create the standard project directories that merge_sphinx_config() expects
390+
(docs_dir / "_static").mkdir()
391+
(docs_dir / "_templates").mkdir()
382392
(docs_dir / "conf.py").write_text(
383393
textwrap.dedent(
384394
"""

0 commit comments

Comments
 (0)