Skip to content

Commit 9231958

Browse files
authored
FIX make sphinx docs work on Windows (#206)
`make` does not exist on Windows in general, causing `spin docs` to fail. If `make.bat` exists, invoke that instead. As noted in scikit-learn/scikit-learn#29012 (comment) `make.bat` is generated by `sphinx-quickstart` and some projects still have it. scikit-learn has it and I think it is supposed to work, although we don't have that many developers on Windows. `numpy` and `matplotlib` still have `make.bat` as well.
2 parents 504c30b + 75376cf commit 9231958

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

spin/cmds/meson.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,10 @@ def docs(
857857
bold=True,
858858
fg="bright_blue",
859859
)
860-
_run(["make", "-C", doc_dir, sphinx_target], replace=True)
860+
861+
make_bat_exists = (Path(doc_dir) / "make.bat").exists()
862+
make_cmd = "make.bat" if sys.platform == "win32" and make_bat_exists else "make"
863+
_run([make_cmd, sphinx_target], cwd=doc_dir, replace=True)
861864

862865

863866
@click.command()

0 commit comments

Comments
 (0)