Enable parallelism in Sphinx

This commit is contained in:
Sviatoslav Sydorenko 2021-04-14 20:19:26 +02:00
parent 88eb4f092e
commit 92862e28ec
No known key found for this signature in database
GPG Key ID: 9345E8FEA89CA455
2 changed files with 8 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import pathlib
import re import re
import sys import sys
from textwrap import dedent from textwrap import dedent
from typing import Iterable, Iterator, List, Optional from typing import Dict, Iterable, Iterator, List, Optional, Union
from docutils import nodes, statemachine from docutils import nodes, statemachine
from docutils.parsers import rst from docutils.parsers import rst
@ -293,7 +293,7 @@ class PipCLIDirective(rst.Directive):
return [node] return [node]
def setup(app: Sphinx) -> None: def setup(app: Sphinx) -> Dict[str, Union[bool, str]]:
app.add_directive("pip-command-usage", PipCommandUsage) app.add_directive("pip-command-usage", PipCommandUsage)
app.add_directive("pip-command-description", PipCommandDescription) app.add_directive("pip-command-description", PipCommandDescription)
app.add_directive("pip-command-options", PipCommandOptions) app.add_directive("pip-command-options", PipCommandOptions)
@ -304,3 +304,7 @@ def setup(app: Sphinx) -> None:
) )
app.add_directive("pip-news-include", PipNewsInclude) app.add_directive("pip-news-include", PipNewsInclude)
app.add_directive("pip-cli", PipCLIDirective) app.add_directive("pip-cli", PipCLIDirective)
return {
"parallel_read_safe": True,
"parallel_write_safe": True,
}

View File

@ -51,12 +51,12 @@ setenv =
deps = -r{toxinidir}/tools/requirements/docs.txt deps = -r{toxinidir}/tools/requirements/docs.txt
basepython = python3 basepython = python3
commands = commands =
sphinx-build -W -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html sphinx-build -W -j auto -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html
# Having the conf.py in the docs/html is weird but needed because we # Having the conf.py in the docs/html is weird but needed because we
# can not use a different configuration directory vs source directory on RTD # can not use a different configuration directory vs source directory on RTD
# currently -- https://github.com/rtfd/readthedocs.org/issues/1543. # currently -- https://github.com/rtfd/readthedocs.org/issues/1543.
# That is why we have a "-c docs/html" in the next line. # That is why we have a "-c docs/html" in the next line.
sphinx-build -W -d {envtmpdir}/doctrees/man -b man docs/man docs/build/man -c docs/html sphinx-build -W -j auto -d {envtmpdir}/doctrees/man -b man docs/man docs/build/man -c docs/html
[testenv:lint] [testenv:lint]
skip_install = True skip_install = True