Skip to content

Commit

Permalink
Merge pull request #3097 from agriyakhetarpal/parallel-build-docs
Browse files Browse the repository at this point in the history
Enable multithreaded documentation builds
  • Loading branch information
Saransh-cpp authored Jul 4, 2023
2 parents 4df9b99 + 9ecdf2a commit d31f125
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -j auto
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
Expand All @@ -16,4 +16,5 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

14 changes: 10 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ def run_tests(session):
def build_docs(session):
envbindir = session.bin
session.install("-e", ".[docs]")
session.chdir("docs/")
session.run(
"sphinx-autobuild", "--open-browser", "-qT", ".", f"{envbindir}/../tmp/html"
)
with session.chdir("docs/"):
session.run(
"sphinx-autobuild",
"-j",
"auto",
"--open-browser",
"-qT",
".",
f"{envbindir}/../tmp/html",
)
2 changes: 2 additions & 0 deletions run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def run_doc_tests():
p = subprocess.Popen(
[
"sphinx-build",
"-j",
"auto",
"-b",
"doctest",
"docs",
Expand Down
5 changes: 5 additions & 0 deletions sphinx_extend_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ def process_docstring(app, what, name, obj, options, lines):

def setup(app):
app.connect("autodoc-process-docstring", process_docstring)
return {
"version": "0.1.0",
"parallel_read_safe": True,
"parallel_write_safe": True,
}

0 comments on commit d31f125

Please sign in to comment.