MCPcopy
hub / github.com/pex-tool/pex / execute_sphinx_build

Function execute_sphinx_build

scripts/build-docs.py:115–136  ·  view source on GitHub ↗
(
    out_base_dir: Path, builder: str, out_dir: Optional[str] = None, **html_defines: str
)

Source from the content-addressed store, hash-verified

113
114
115def execute_sphinx_build(
116 out_base_dir: Path, builder: str, out_dir: Optional[str] = None, **html_defines: str
117) -> Path:
118 gen_dir = (out_base_dir / (out_dir or builder)).absolute()
119 shutil.rmtree(gen_dir, ignore_errors=True)
120 subprocess.run(
121 args=[
122 sys.executable,
123 "-m",
124 "sphinx",
125 "-b",
126 builder,
127 "-aEW",
128 *itertools.chain.from_iterable(
129 ("--html-define", f"{name}={value}") for name, value in html_defines.items()
130 ),
131 "docs",
132 str(gen_dir),
133 ],
134 check=True,
135 )
136 return gen_dir
137
138
139def main(

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected