Skip to content

Commit 7a07348

Browse files
committed
Since Python 3.10 (a103e73ce8) we can build in parallel.
1 parent 4f620e1 commit 7a07348

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

build_docs.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@
6464
class Version:
6565
STATUSES = {"EOL", "security-fixes", "stable", "pre-release", "in development"}
6666

67-
def __init__(self, name, branch, status, sphinx_version=DEFAULT_SPHINX_VERSION):
67+
def __init__(
68+
self,
69+
name,
70+
branch,
71+
status,
72+
sphinx_version=DEFAULT_SPHINX_VERSION,
73+
sphinxopts=[],
74+
):
6875
if status not in self.STATUSES:
6976
raise ValueError(
7077
"Version status expected to be in {}".format(", ".join(self.STATUSES))
@@ -73,6 +80,7 @@ def __init__(self, name, branch, status, sphinx_version=DEFAULT_SPHINX_VERSION):
7380
self.branch = branch
7481
self.status = status
7582
self.sphinx_version = sphinx_version
83+
self.sphinxopts = list(sphinxopts)
7684

7785
@property
7886
def changefreq(self):
@@ -102,7 +110,9 @@ def title(self):
102110
Version("3.7", "3.7", "security-fixes", sphinx_version="2.3.1"),
103111
Version("3.8", "3.8", "security-fixes", sphinx_version="2.4.4"),
104112
Version("3.9", "3.9", "stable", sphinx_version="2.4.4"),
105-
Version("3.10", "main", "in development", sphinx_version="3.2.1"),
113+
Version(
114+
"3.10", "main", "in development", sphinx_version="3.2.1", sphinxopts=["-j4"]
115+
),
106116
]
107117

108118
XELATEX_DEFAULT = (
@@ -383,7 +393,7 @@ def build_one(
383393
logging.info(
384394
"Build start for version: %s, language: %s", version.name, language.tag
385395
)
386-
sphinxopts = list(language.sphinxopts)
396+
sphinxopts = list(language.sphinxopts) + list(version.sphinxopts)
387397
sphinxopts.extend(["-q"])
388398
if language.tag != "en":
389399
locale_dirs = os.path.join(build_root, version.name, "locale")

0 commit comments

Comments
 (0)