Skip to content

Commit 9ae842b

Browse files
authored
Merge pull request #9820 from webknjaz/docs/sphinx-parallelism
Enable parallelism in Sphinx
2 parents 88eb4f0 + 92862e2 commit 9ae842b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/pip_sphinxext.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
import sys
77
from textwrap import dedent
8-
from typing import Iterable, Iterator, List, Optional
8+
from typing import Dict, Iterable, Iterator, List, Optional, Union
99

1010
from docutils import nodes, statemachine
1111
from docutils.parsers import rst
@@ -293,7 +293,7 @@ def run(self) -> List[nodes.Node]:
293293
return [node]
294294

295295

296-
def setup(app: Sphinx) -> None:
296+
def setup(app: Sphinx) -> Dict[str, Union[bool, str]]:
297297
app.add_directive("pip-command-usage", PipCommandUsage)
298298
app.add_directive("pip-command-description", PipCommandDescription)
299299
app.add_directive("pip-command-options", PipCommandOptions)
@@ -304,3 +304,7 @@ def setup(app: Sphinx) -> None:
304304
)
305305
app.add_directive("pip-news-include", PipNewsInclude)
306306
app.add_directive("pip-cli", PipCLIDirective)
307+
return {
308+
"parallel_read_safe": True,
309+
"parallel_write_safe": True,
310+
}

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ setenv =
5151
deps = -r{toxinidir}/tools/requirements/docs.txt
5252
basepython = python3
5353
commands =
54-
sphinx-build -W -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html
54+
sphinx-build -W -j auto -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html
5555
# Having the conf.py in the docs/html is weird but needed because we
5656
# can not use a different configuration directory vs source directory on RTD
5757
# currently -- https://github.com/rtfd/readthedocs.org/issues/1543.
5858
# That is why we have a "-c docs/html" in the next line.
59-
sphinx-build -W -d {envtmpdir}/doctrees/man -b man docs/man docs/build/man -c docs/html
59+
sphinx-build -W -j auto -d {envtmpdir}/doctrees/man -b man docs/man docs/build/man -c docs/html
6060

6161
[testenv:lint]
6262
skip_install = True

0 commit comments

Comments
 (0)