Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions check_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$ python check_times.py
"""

import argparse
import gzip
import tomllib
from pathlib import Path
Expand Down Expand Up @@ -78,17 +79,38 @@ def calc_time(lines: list[str]) -> None:


if __name__ == "__main__":
print("Build times (HTML only; English)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html-en.log"))

print("Build times (HTML only)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html.log"))

print("Build times (no HTML)")
print("=====================")
print()
calc_time(get_lines("docsbuild-no-html.log"))
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
Comment on lines +82 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could mirror the build_docs.py args here?

    parser.add_argument(
        "--select-output",
        choices=("no-html", "only-html", "only-html-en"),
        help="Choose what outputs to build.",
    )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this? 45f56e5

parser.add_argument(
"--html-en", action="store_true", help="Show HTML-only (English) build times"
)
parser.add_argument(
"--html", action="store_true", help="Show HTML-only build times"
)
parser.add_argument(
"--no-html", action="store_true", help="Show no-HTML build times"
)
args = parser.parse_args()

# If none specified, show all
if not (args.html_en or args.html or args.no_html):
args.html_en = args.html = args.no_html = True

if args.html_en:
print("Build times (HTML only; English)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html-en.log"))

if args.html:
print("Build times (HTML only)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html.log"))

if args.no_html:
print("Build times (no HTML)")
print("=====================")
print()
calc_time(get_lines("docsbuild-no-html.log"))
Loading