Skip to content

Commit 97c69ef

Browse files
committed
DOC: parallelize the number of Sphinx jobs by default
Most people building docs would want that to happen as quickly as possible, so this has Sphinx use the maximum parallelism possible by default.
1 parent 1779155 commit 97c69ef

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/make.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DocBuilder:
3939

4040
def __init__(
4141
self,
42-
num_jobs=0,
42+
num_jobs="auto",
4343
include_api=True,
4444
single_doc=None,
4545
verbosity=0,
@@ -131,7 +131,7 @@ def _sphinx_build(self, kind: str):
131131

132132
cmd = ["sphinx-build", "-b", kind]
133133
if self.num_jobs:
134-
cmd += ["-j", str(self.num_jobs)]
134+
cmd += ["-j", self.num_jobs]
135135
if self.warnings_are_errors:
136136
cmd += ["-W", "--keep-going"]
137137
if self.verbosity:
@@ -297,7 +297,7 @@ def main():
297297
"command", nargs="?", default="html", help=f"command to run: {joined}"
298298
)
299299
argparser.add_argument(
300-
"--num-jobs", type=int, default=0, help="number of jobs used by sphinx-build"
300+
"--num-jobs", default="auto", help="number of jobs used by sphinx-build"
301301
)
302302
argparser.add_argument(
303303
"--no-api", default=False, help="omit api and autosummary", action="store_true"

doc/source/development/contributing.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ For comparison, a full documentation build may take 15 minutes, but a single
608608
section may take 15 seconds. Subsequent builds, which only process portions
609609
you have changed, will be faster.
610610

611-
You can also specify to use multiple cores to speed up the documentation build::
611+
The build will automatically use the number of cores available on your machine
612+
to speed up the documentation build. You can override this::
612613

613614
python make.py html --num-jobs 4
614615

0 commit comments

Comments
 (0)