Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Account for skipped builds in build_docs() #261

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
Apr 11, 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
8 changes: 5 additions & 3 deletions build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,15 +536,15 @@ def includes_html(self):
"""Does the build we are running include HTML output?"""
return self.select_output != "no-html"

def run(self, http: urllib3.PoolManager) -> bool:
def run(self, http: urllib3.PoolManager) -> bool | None:
"""Build and publish a Python doc, for a language, and a version."""
start_time = perf_counter()
start_timestamp = dt.datetime.now(tz=dt.UTC).replace(microsecond=0)
logging.info("Running.")
try:
if self.language.html_only and not self.includes_html:
logging.info("Skipping non-HTML build (language is HTML-only).")
return True
return None # skipped
self.cpython_repo.switch(self.version.branch_or_tag)
if self.language.tag != "en":
self.clone_translation()
Expand All @@ -557,6 +557,8 @@ def run(self, http: urllib3.PoolManager) -> bool:
build_duration=perf_counter() - start_time,
trigger=trigger_reason,
)
else:
return None # skipped
except Exception as err:
logging.exception("Badly handled exception, human, please help.")
if sentry_sdk:
Expand Down Expand Up @@ -1073,7 +1075,7 @@ def build_docs(args: argparse.Namespace) -> bool:
built_successfully = builder.run(http)
if built_successfully:
build_succeeded.add((version.name, language.tag))
else:
elif built_successfully is not None:
build_failed.add((version.name, language.tag))

logging.root.handlers[0].setFormatter(
Expand Down