Skip to content

Commit 717c76e

Browse files
committed
docs: make parallel builds configurable with environment variable
1 parent c773705 commit 717c76e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docsrc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dev:
2525
@cp .nojekyll ../docs/.nojekyll
2626

2727
github:
28-
@sphinx-polyversion -vv poly.py
28+
@BF_DOCS_SYNCHRONOUS_BUILDS=1 sphinx-polyversion -vv poly.py
2929
@echo 'Copying docs to ../docs'
3030
@cp -a _build_polyversion/. ../docs
3131
@cp .nojekyll ../docs/.nojekyll

docsrc/poly.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
logger = getLogger(__name__)
2525

2626
#: Whether to build the docs in parallel
27-
PARALLEL_BUILDS = False
27+
PARALLEL_BUILDS = os.environ.get("BF_DOCS_SYNCHRONOUS_BUILDS", "0") != "1"
28+
print(PARALLEL_BUILDS, "parallel")
2829

2930
#: Determine repository root directory
3031
root = Git.root(Path(__file__).parent)
@@ -77,6 +78,7 @@ def data(driver, rev, env):
7778
for b in branches:
7879
if b.name == "master":
7980
latest = b
81+
break
8082

8183
# sort tags and branches by date, newest first
8284
return {
@@ -92,6 +94,10 @@ def root_data(driver):
9294
revisions = driver.builds
9395
branches, tags = refs_by_type(revisions)
9496
latest = max(tags or branches)
97+
for b in branches:
98+
if b.name == "master":
99+
latest = b
100+
break
95101
return {"revisions": revisions, "latest": latest}
96102

97103

@@ -230,7 +236,7 @@ async def __call__(self, path: Path) -> None:
230236
creator = LocalVenvCreator()
231237

232238

233-
def selector(rev, keys):
239+
async def selector(rev, keys):
234240
"""Select configuration based on revision"""
235241
# map all v1 revisions to one configuration
236242
if rev.name.startswith("v1."):

docsrc/polyversion/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<html>
44
<head>
5-
<title>Redirecting to master branch</title>
5+
<title>Redirecting to {{ latest.name }} branch/version</title>
66
<meta charset="utf-8" />
77
<meta
88
http-equiv="refresh"

0 commit comments

Comments
 (0)