8000 Add logging in post-build tasks (#221) · python/docsbuild-scripts@9498214 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9498214

Browse files
authored
Add logging in post-build tasks (#221)
1 parent a97ad68 commit 9498214

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build_docs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ def copy_robots_txt(
424424
if not www_root.exists():
425425
logging.info("Skipping copying robots.txt (www root does not even exist).")
426426
return
427+
logging.info("Copying robots.txt...")
427428
template_path = HERE / "templates" / "robots.txt"
428429
robots_path = www_root / "robots.txt"
429430
shutil.copyfile(template_path, robots_path)
@@ -440,6 +441,7 @@ def build_sitemap(
440441
if not www_root.exists():
441442
logging.info("Skipping sitemap generation (www root does not even exist).")
442443
return
444+
logging.info("Starting sitemap generation...")
443445
template_path = HERE / "templates" / "sitemap.xml"
444446
template = jinja2.Template(template_path.read_text(encoding="UTF-8"))
445447
rendered_template = template.render(languages=languages, versions=versions)
@@ -454,6 +456,7 @@ def build_404(www_root: Path, group):
454456
if not www_root.exists():
455457
logging.info("Skipping 404 page generation (www root does not even exist).")
456458
return
459+
logging.info("Copying 404 page...")
457460
not_found_file = www_root / "404.html"
458461
shutil.copyfile(HERE / "templates" / "404.html", not_found_file)
459462
not_found_file.chmod(0o664)
@@ -1022,6 +1025,7 @@ def major_symlinks(
10221025
- /fr/3/ → /fr/3.9/
10231026
- /es/3/ → /es/3.9/
10241027
"""
1028+
logging.info("Creating major version symlinks...")
10251029
current_stable = Version.current_stable(versions).name
10261030
for language in languages:
10271031
symlink(
@@ -1051,6 +1055,7 @@ def dev_symlink(
10511055
- /fr/dev/ → /fr/3.11/
10521056
- /es/dev/ → /es/3.11/
10531057
"""
1058+
logging.info("Creating development version symlinks...")
10541059
current_dev = Version.current_dev(versions).name
10551060
for language in languages:
10561061
symlink(
@@ -1096,6 +1101,7 @@ def proofread_canonicals(
10961101
- /3.11/whatsnew/3.11.html typically would link to
10971102
/3/whatsnew/3.11.html, which may not exist yet.
10981103
"""
1104+
logging.info("Checking canonical links...")
10991105
canonical_re = re.compile(
11001106
"""<link rel="canonical" href="https://docs.python.org/([^"]*)" />"""
11011107
)

0 commit comments

Comments
 (0)
0