From 82349cf1dbb2be880bc4c88366dbe922846c6bc3 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 25 Jul 2024 22:31:36 -0400 Subject: [PATCH] DOC: Enable parallel builds The latest sphinx-gallery 0.17.0 adds support for parallel building of examples, and the issue in pydata-sphinx-theme was fixed in 0.15.4, so we can try enabling it again. --- .circleci/config.yml | 2 +- doc/conf.py | 5 +++++ requirements/doc/doc-requirements.txt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7436698c8068..688941ae9d9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -147,7 +147,7 @@ commands: export RELEASE_TAG='-t release' fi mkdir -p logs - make html O="-T $RELEASE_TAG -j1 -w /tmp/sphinxerrorswarnings.log" + make html O="-T $RELEASE_TAG -j4 -w /tmp/sphinxerrorswarnings.log" rm -r build/html/_sources working_directory: doc - save_cache: diff --git a/doc/conf.py b/doc/conf.py index 1e6b3aefb5c5..6e736e16844f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -286,6 +286,11 @@ def tutorials_download_error(record): 'copyfile_regex': r'.*\.rst', } +if parse_version(sphinx_gallery.__version__) >= parse_version('0.17.0'): + sphinx_gallery_conf['parallel'] = True + # Any warnings from joblib turned into errors may cause a deadlock. + warnings.filterwarnings('default', category=UserWarning, module='joblib') + if 'plot_gallery=0' in sys.argv: # Gallery images are not created. Suppress warnings triggered where other # parts of the documentation link to these images. diff --git a/requirements/doc/doc-requirements.txt b/requirements/doc/doc-requirements.txt index cee389da9e94..0666af1d49e8 100644 --- a/requirements/doc/doc-requirements.txt +++ b/requirements/doc/doc-requirements.txt @@ -20,5 +20,5 @@ pyyaml sphinxcontrib-svg2pdfconverter>=1.1.0 sphinx-copybutton sphinx-design -sphinx-gallery>=0.12.0 +sphinx-gallery[parallel]>=0.12.0 sphinx-tags>=0.4.0