Skip to content

Commit 251d4e4

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 0f8234c commit 251d4e4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/make.py

Lines changed: 3 additions & 3 deletions
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
whatsnew=False,
4545
single_doc=None,
@@ -135,7 +135,7 @@ def _sphinx_build(self, kind: str):
135135

136136
cmd = ["sphinx-build", "-b", kind]
137137
if self.num_jobs:
138-
cmd += ["-j", str(self.num_jobs)]
138+
cmd += ["-j", self.num_jobs]
139139
if self.warnings_are_errors:
140140
cmd += ["-W", "--keep-going"]
141141
if self.verbosity:
@@ -304,7 +304,7 @@ def main():
304304
"command", nargs="?", default="html", help=f"command to run: {joined}"
305305
)
306306
argparser.add_argument(
307-
"--num-jobs", type=int, default=0, help="number of jobs used by sphinx-build"
307+
"--num-jobs", default="auto", help="number of jobs used by sphinx-build"
308308
)
309309
argparser.add_argument(
310310
"--no-api", default=False, help="omit api and autosummary", action="store_true"

doc/source/development/contributing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,8 @@ For comparison, a full documentation build may take 15 minutes, but a single
612612
section may take 15 seconds. Subsequent builds, which only process portions
613613
you have changed, will be faster.
614614

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

617618
python make.py html --num-jobs 4
618619

0 commit comments

Comments
 (0)