Skip to content

Add options to only show certain build times #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025
Merged
Changes from all commits
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
48 changes: 34 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,36 @@ 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

ALL_BUILDS = ("no-html", "only-html", "only-html-en")
parser.add_argument(
"--select-output",
choices=ALL_BUILDS,
nargs="*",
help="Choose what builds to show (default: all).",
)
args = parser.parse_args()
parser.suggest_on_error = True

if not args.select_output:
args.select_output = ALL_BUILDS

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

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

if "no-html" in args.select_output:
print("Build times (no HTML)")
print("=====================")
print()
calc_time(get_lines("docsbuild-no-html.log"))
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy