Skip to content

Commit c773705

Browse files
committed
docs: disable parallel builds due to memory constraints
1 parent 8fb65ab commit c773705

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

docsrc/poly.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323

2424
logger = getLogger(__name__)
2525

26+
#: Whether to build the docs in parallel
27+
PARALLEL_BUILDS = False
28+
2629
#: Determine repository root directory
2730
root = Git.root(Path(__file__).parent)
2831

2932
#: CodeRegex matching the branches to build docs for
30-
BRANCH_REGEX = r"^(master)$"
33+
BRANCH_REGEX = r"^(master|dev)$"
3134

3235
#: Regex matching the tags to build docs for
3336
TAG_REGEX = r"^v[\.0-9]*$"
@@ -71,9 +74,10 @@ def data(driver, rev, env):
7174
revisions = driver.targets
7275
branches, tags = refs_by_type(revisions)
7376
latest = max(tags or branches)
74-
named_master = (r for r in branches if r.name == "master")
75-
if len(named_master) > 0:
76-
(latest,) = named_master
77+
for b in branches:
78+
if b.name == "master":
79+
latest = b
80+
7781
# sort tags and branches by date, newest first
7882
return {
7983
"current": rev,
@@ -226,7 +230,7 @@ async def __call__(self, path: Path) -> None:
226230
creator = LocalVenvCreator()
227231

228232

229-
async def selector(rev, keys):
233+
def selector(rev, keys):
230234
"""Select configuration based on revision"""
231235
# map all v1 revisions to one configuration
232236
if rev.name.startswith("v1."):
@@ -251,8 +255,21 @@ async def selector(rev, keys):
251255
),
252256
}
253257

258+
259+
class SynchronousDriver(DefaultDriver):
260+
async def arun(self) -> None:
261+
"""Build all revisions (async)."""
262+
await self.init()
263+
for rev in self.targets:
264+
await asyncio.gather(self.build_revision(rev))
265+
await self.build_root()
266+
267+
268+
driver_cls = DefaultDriver if PARALLEL_BUILDS else SynchronousDriver
269+
270+
254271
# Setup driver and run it
255-
DefaultDriver(
272+
driver_cls(
256273
root,
257274
OUTPUT_DIR,
258275
vcs=vcs,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ docs = [
4141
"sphinx_design",
4242
"sphinx-book-theme",
4343
"sphinxcontrib-bibtex",
44-
"sphinx-polyversion",
44+
"sphinx-polyversion==1.0.0",
4545
]
4646
[tool.ruff]
4747
# We use ruff to lint and auto-format code

0 commit comments

Comments
 (0)