Skip to content

Commit

Permalink
FIX make sphinx docs work on Windows (#206)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
stefanv authored May 30, 2024
2 parents 504c30b + 75376cf commit 9231958
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spin/cmds/meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,10 @@ def docs(
bold=True,
fg="bright_blue",
)
_run(["make", "-C", doc_dir, sphinx_target], replace=True)

make_bat_exists = (Path(doc_dir) / "make.bat").exists()
make_cmd = "make.bat" if sys.platform == "win32" and make_bat_exists else "make"
_run([make_cmd, sphinx_target], cwd=doc_dir, replace=True)


@click.command()
Expand Down

0 comments on commit 9231958

Please sign in to comment.