Skip to content

Commit 7b10420

Browse files
authored
Run python -m sphinx rather than sphinx-build (#180)
This avoids requiring that the correct ``sphinx-build`` is in the user's PATH.
1 parent 4dbe80d commit 7b10420

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sphinx_autobuild/build.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Logic for interacting with sphinx-build."""
22

33
import subprocess
4+
import sys
45

56
from sphinx_autobuild.utils import show
67

@@ -28,9 +29,12 @@ def __call__(self, *, rebuild: bool = True):
2829
)
2930
raise
3031

31-
show(command=["sphinx-build"] + self.sphinx_args)
32+
show(command=["python", "-m", "sphinx"] + self.sphinx_args)
3233
try:
33-
subprocess.run(["sphinx-build"] + self.sphinx_args, check=True)
34+
subprocess.run(
35+
[sys.executable, "-m", "sphinx"] + self.sphinx_args,
36+
check=True,
37+
)
3438
except subprocess.CalledProcessError as e:
3539
print(f"Sphinx exited with exit code: {e.returncode}")
3640
print(

0 commit comments

Comments
 (0)