8000 Use different cpython clones to build different languages. Fixes #35 · python/docsbuild-scripts@9eb4e1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 9eb4e1a

Browse files
committed
Use different cpython clones to build different languages. Fixes #35
This tries to fix https://bugs.python.org/issue31584 and can't hurt, anyway the cron could have started (or would have ended up getting started, after adding some languages) before the previous run was complete.
1 parent cfa977f commit 9eb4e1a

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

build_docs.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939

4040

4141
BRANCHES = [
42-
# version, isdev
43-
(3.6, False),
44-
(3.7, True),
45-
(2.7, False)
42+
# version, git branch, isdev
43+
(3.6, '3.6', False),
44+
(3.7, 'master', True),
45+
(2.7, '2.7', False)
4646
]
4747

4848
LANGUAGES = [
@@ -151,12 +151,14 @@ def translation_branch(locale_repo, locale_clone_dir, needed_version):
151151
return sorted(translated_branches, key=lambda x: abs(needed_version - x))[0]
152152

153153

154-
def build_one(version, isdev, quick, venv, build_root, www_root,
154+
def build_one(version, git_branch, isdev, quick, venv, build_root, www_root,
155155
skip_cache_invalidation=False, group='docs',
156156
log_directory='/var/log/docsbuild/', language=None):
157157
if not language:
158158
language = 'en'
159-
checkout = build_root + "/python" + str(version).replace('.', '')
159+
checkout = os.path.join(build_root, 'python{version}{lang}'.format(
160+
version=str(version).replace('.', ''),
161+
lang=language if language != 'en' else ''))
160162
logging.info("Build start for version: %s, language: %s",
161163
str(version), language)
162164
sphinxopts = ''
@@ -187,11 +189,9 @@ def build_one(version, isdev, quick, venv, build_root, www_root,
187189
except (PermissionError, subprocess.CalledProcessError) as err:
188190
logging.warning("Can't change mod or group of %s: %s",
189191
target, str(err))
192+
git_clone('https://github.com/python/cpython.git',
193+
checkout, git_branch)
190194
os.chdir(checkout)
191-
192-
logging.info("Updating checkout")
193-
shell_out("git reset --hard HEAD")
194-
shell_out("git pull --ff-only")
195195
maketarget = "autobuild-" + ("dev" if isdev else "stable") + ("-html" if quick else "")
196196
logging.info("Running make %s", maketarget)
197197
logname = "{}-{}.log".format(os.path.basename(checkout), language)
@@ -309,18 +309,18 @@ def main():
309309
logging.root.setLevel(logging.DEBUG)
310310
venv = os.path.join(args.build_root, "venv")
311311
if args.branch:
312-
branches_to_do = [(args.branch, args.devel)]
312+
branches_to_do = [(args.branch, args.branch, args.devel)]
313313
else:
314314
branches_to_do = BRANCHES
315315
if not args.languages:
316316
# Allow "--languages" to build all languages (as if not given)
317317
# instead of none. "--languages en" builds *no* translation,
318318
# as "en" is the untranslated one.
319319
args.languages = LANGUAGES
320-
for version, devel in branches_to_do:
320+
for version, git_branch, devel in branches_to_do:
321321
for language in args.languages:
322322
try:
323-
build_one(version, devel, args.quick, venv,
323+
build_one(version, git_branch, devel, args.quick, venv,
324324
args.build_root, args.www_root,
325325
args.skip_cache_invalidation, args.group,
326326
args.log_directory, language)

0 commit comments

Comments
 (0)
0