Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Exit the script process with non-zero status#150

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JulienPalard merged 1 commit intopython:mainfromm-aciek:exit-code
Mar 14, 2023
Merged
Changes fromall 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
19 changes: 15 additions & 4 deletionsbuild_docs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -48,6 +48,11 @@

HERE = Path(__file__).resolve().parent

try:
from os import EX_OK, EX_SOFTWARE as EX_FAILURE
except ImportError:
EX_OK, EX_FAILURE = 0, 1

try:
import sentry_sdk
except ImportError:
Expand DownExpand Up@@ -693,7 +698,7 @@ def full_build(self):
"""
return not self.quick and not self.language.html_only

def run(self):
def run(self) -> bool:
"""Build and publish a Python doc, for a language, and a version."""
try:
self.clone_cpython()
Expand All@@ -710,6 +715,8 @@ def run(self):
)
if sentry_sdk:
sentry_sdk.capture_exception(err)
return False
return True

@property
def checkout(self) -> Path:
Expand DownExpand Up@@ -1044,7 +1051,7 @@ def purge_path(www_root: Path, path: Path):
run(["curl", "-XPURGE", f"https://docs.python.org/{{{','.join(to_purge)}}}"])


def main() ->None:
def main() ->bool:
"""Script entry point."""
args = parse_args()
setup_logging(args.log_directory)
Expand All@@ -1054,6 +1061,7 @@ def main() -> None:
del args.languages
del args.branch
todo = list(product(versions, languages))
all_built_successfully = True
while todo:
version, language = todo.pop()
if sentry_sdk:
Expand All@@ -1063,7 +1071,7 @@ def main() -> None:
try:
lock = zc.lockfile.LockFile(HERE / "build_docs.lock")
builder = DocBuilder(version, language, **vars(args))
builder.run()
all_built_successfully &=builder.run()
except zc.lockfile.LockError:
logging.info("Another builder is running... waiting...")
time.sleep(10)
Expand All@@ -1078,6 +1086,9 @@ def main() -> None:
dev_symlink(args.www_root, args.group)
proofread_canonicals(args.www_root, args.skip_cache_invalidation)

return all_built_successfully


if __name__ == "__main__":
main()
all_built_successfully = main()
sys.exit(EX_OK if all_built_successfully else EX_FAILURE)

[8]ページ先頭

©2009-2025 Movatter.jp