File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -234,6 +234,7 @@ def build(self):
234
234
build_command = [
235
235
* self .get_sphinx_cmd (),
236
236
'-T' ,
237
+ * self .sphinx_parallel_arg (),
237
238
]
238
239
if self ._force :
239
240
build_command .append ('-E' )
@@ -270,6 +271,11 @@ def get_sphinx_cmd(self):
270
271
self .python_env .venv_bin (filename = 'sphinx-build' ),
271
272
)
272
273
274
+ def sphinx_parallel_arg (self ):
275
+ if self .project .has_feature (Feature .SPHINX_PARALLEL ):
276
+ return ['-j' , 'auto' ]
277
+ return []
278
+
273
279
def venv_sphinx_supports_latexmk (self ):
274
280
"""
275
281
Check if ``sphinx`` from the user's venv supports ``latexmk``.
@@ -448,6 +454,7 @@ def build(self):
448
454
* self .get_sphinx_cmd (),
449
455
'-b' ,
450
456
'latex' ,
457
+ * self .sphinx_parallel_arg (),
451
458
'-D' ,
452
459
'language={lang}' .format (lang = self .project .language ),
453
460
'-d' ,
Original file line number Diff line number Diff line change @@ -1594,6 +1594,7 @@ def add_features(sender, **kwargs):
1594
1594
LIST_PACKAGES_INSTALLED_ENV = 'list_packages_installed_env'
1595
1595
VCS_REMOTE_LISTING = 'vcs_remote_listing'
1596
1596
STORE_PAGEVIEWS = 'store_pageviews'
1597
+ SPHINX_PARALLEL = 'sphinx_parallel'
1597
1598
1598
1599
FEATURES = (
1599
1600
(USE_SPHINX_LATEST , _ ('Use latest version of Sphinx' )),
@@ -1687,6 +1688,10 @@ def add_features(sender, **kwargs):
1687
1688
STORE_PAGEVIEWS ,
1688
1689
_ ('Store pageviews for this project' ),
1689
1690
),
1691
+ (
1692
+ SPHINX_PARALLEL ,
1693
+ _ ('Use "-j auto" when calling sphinx-build' ),
1694
+ ),
1690
1695
)
1691
1696
1692
1697
projects = models .ManyToManyField (
You can’t perform that action at this time.
0 commit comments