Skip to content

WIP: Parallel docs build #5597

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

Closed
wants to merge 3 commits into from
Closed
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: 4 additions & 2 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import print_function
import glob
import multiprocessing
import os
import shutil
import sys
Expand Down Expand Up @@ -45,7 +46,8 @@ def html(buildername='html'):
options = ''
if warnings_as_errors:
options = options + ' -W'
if os.system('sphinx-build %s -b %s -d build/doctrees . build/%s' % (options, buildername, buildername)):
if os.system('sphinx-build -j %d %s -b %s -d build/doctrees . build/%s' % (
multiprocessing.cpu_count(), options, buildername, buildername)):
raise SystemExit("Building HTML failed.")

# Clean out PDF files from the _images directory
Expand All @@ -60,7 +62,7 @@ def htmlhelp():
with open('build/htmlhelp/index.html', 'r+') as fh:
content = fh.read()
fh.seek(0)
content = re.sub(r'<script>.*?</script>', '', content,
content = re.sub(r'<script>.*?</script>', '', content,
flags=re.MULTILINE| re.DOTALL)
fh.write(content)
fh.truncate()
Expand Down
3 changes: 3 additions & 0 deletions doc/sphinxext/gen_gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,6 @@ def setup(app):
app.add_config_value('mpl_example_sections', [], True)
except sphinx.errors.ExtensionError:
pass # mpl_example_sections already defined

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
3 changes: 3 additions & 0 deletions doc/sphinxext/gen_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,6 @@ def setup(app):
app.add_config_value('mpl_example_sections', [], True)
except sphinx.errors.ExtensionError:
pass # mpl_example_sections already defined

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
6 changes: 4 additions & 2 deletions doc/sphinxext/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):

def setup(app):
"""Install the plugin.

:param app: Sphinx application context.
"""
app.info('Initializing GitHub plugin')
Expand All @@ -152,4 +152,6 @@ def setup(app):
app.add_role('ghuser', ghuser_role)
app.add_role('ghcommit', ghcommit_role)
app.add_config_value('github_project_url', None, 'env')
return

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
3 changes: 3 additions & 0 deletions doc/sphinxext/math_symbol_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ def setup(app):
'math_symbol_table', math_symbol_table_directive,
False, (0, 1, 0))

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata

if __name__ == "__main__":
# Do some verification of the tables
from matplotlib import _mathtext_data
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/sphinxext/mathmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ def depart_latex_math_latex(self, node):
app.add_role('math', math_role)
app.add_directive('math', math_directive,
True, (0, 0, 0), **options_spec)

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
3 changes: 3 additions & 0 deletions lib/matplotlib/sphinxext/only_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ def depart_ignore(self, node):
app.add_node(html_only, latex=(visit_ignore, depart_ignore))
app.add_node(latex_only, latex=(visit_perform, depart_perform))
app.add_node(latex_only, html=(visit_ignore, depart_ignore))

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata
3 changes: 3 additions & 0 deletions lib/matplotlib/sphinxext/plot_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ def setup(app):

app.connect(str('doctree-read'), mark_plot_labels)

metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
return metadata

#------------------------------------------------------------------------------
# Doctest handling
#------------------------------------------------------------------------------
Expand Down