From cbf3cc9338ee298727d74d8b2e08ca1c50ae88c2 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 11 Apr 2020 15:47:13 -0500 Subject: [PATCH] Parallelize docs build This makes sphinx-build use the number of cores available to make the docs build parallel. On my 16 core system, this cut the time by ~50%. We don't have as many cores available in the gate, but it should provide a slight improvement in overall job time. Change-Id: I7ad4d87a3dba10475a0fcf797a9aa2d4b1ad0eb5 Signed-off-by: Sean McGinnis --- doc/source/_exts/deliverables.py | 4 ++++ doc/source/_exts/ics.py | 4 ++++ tox.ini | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/source/_exts/deliverables.py b/doc/source/_exts/deliverables.py index efc03efff5..119b5bda76 100644 --- a/doc/source/_exts/deliverables.py +++ b/doc/source/_exts/deliverables.py @@ -523,3 +523,7 @@ def setup(app): app.add_directive('serieshighlights', HighlightsDirective) app.connect('build-finished', build_finished) _generate_team_pages() + return { + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } diff --git a/doc/source/_exts/ics.py b/doc/source/_exts/ics.py index 781d1a5b43..33cee64286 100644 --- a/doc/source/_exts/ics.py +++ b/doc/source/_exts/ics.py @@ -230,3 +230,7 @@ def setup(app): app.add_directive('ics', ICS) app.connect('doctree-resolved', doctree_resolved) app.connect('build-finished', build_finished) + return { + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } diff --git a/tox.ini b/tox.ini index 7c13ae8316..e75eef9eba 100644 --- a/tox.ini +++ b/tox.ini @@ -75,7 +75,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt commands = - sphinx-build -v -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html + sphinx-build -v -a -E -W -j auto -d doc/build/doctrees -b html doc/source doc/build/html whereto {toxinidir}/doc/build/html/.htaccess {toxinidir}/doc/build/redirect-tests.txt [flake8]