Skip to content

DOC: parallelize the number of Sphinx jobs by default #39364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DocBuilder:

def __init__(
self,
num_jobs=0,
num_jobs="auto",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is num_jobs just a pandas thing? We use the -j flag for building the Cython / C extensions so wouldn't be opposed to just using that here for consistency as well, since it matches the Sphinx docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

num_jobs was there before; I didn't mess with the name. I like that num_jobs is more descriptive, but certainly understand the argument for consistent…arguments 😉

include_api=True,
whatsnew=False,
single_doc=None,
Expand Down Expand Up @@ -135,7 +135,7 @@ def _sphinx_build(self, kind: str):

cmd = ["sphinx-build", "-b", kind]
if self.num_jobs:
cmd += ["-j", str(self.num_jobs)]
cmd += ["-j", self.num_jobs]
if self.warnings_are_errors:
cmd += ["-W", "--keep-going"]
if self.verbosity:
Expand Down Expand Up @@ -304,7 +304,7 @@ def main():
"command", nargs="?", default="html", help=f"command to run: {joined}"
)
argparser.add_argument(
"--num-jobs", type=int, default=0, help="number of jobs used by sphinx-build"
"--num-jobs", default="auto", help="number of jobs used by sphinx-build"
)
argparser.add_argument(
"--no-api", default=False, help="omit api and autosummary", action="store_true"
Expand Down
3 changes: 2 additions & 1 deletion doc/source/development/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ For comparison, a full documentation build may take 15 minutes, but a single
section may take 15 seconds. Subsequent builds, which only process portions
you have changed, will be faster.

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

python make.py html --num-jobs 4

Expand Down