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

Commitccc8d99

Browse files
committed
Exit the script process with non-zero status if at least one build was unsuccessful
1 parentd5a0a72 commitccc8d99

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎build_docs.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
importlogging
2929
importlogging.handlers
3030
fromfunctoolsimporttotal_ordering
31-
fromosimportreadlink
31+
fromosimportreadlink,EX_OK,EX_SOFTWARE
3232
importre
3333
importshlex
3434
importshutil
@@ -1044,7 +1044,7 @@ def purge_path(www_root: Path, path: Path):
10441044
run(["curl","-XPURGE",f"https://docs.python.org/{{{','.join(to_purge)}}}"])
10451045

10461046

1047-
defmain()->None:
1047+
defmain()->bool:
10481048
"""Script entry point."""
10491049
args=parse_args()
10501050
setup_logging(args.log_directory)
@@ -1054,6 +1054,7 @@ def main() -> None:
10541054
delargs.languages
10551055
delargs.branch
10561056
todo=list(product(versions,languages))
1057+
all_built_successfully=True
10571058
whiletodo:
10581059
version,language=todo.pop()
10591060
ifsentry_sdk:
@@ -1063,7 +1064,7 @@ def main() -> None:
10631064
try:
10641065
lock=zc.lockfile.LockFile(HERE/"build_docs.lock")
10651066
builder=DocBuilder(version,language,**vars(args))
1066-
builder.run()
1067+
all_built_successfully&=builder.run()
10671068
exceptzc.lockfile.LockError:
10681069
logging.info("Another builder is running... waiting...")
10691070
time.sleep(10)
@@ -1078,6 +1079,9 @@ def main() -> None:
10781079
dev_symlink(args.www_root,args.group)
10791080
proofread_canonicals(args.www_root,args.skip_cache_invalidation)
10801081

1082+
returnall_built_successfully
1083+
10811084

10821085
if__name__=="__main__":
1083-
main()
1086+
all_built_successfully=main()
1087+
sys.exit(EX_OKifall_built_successfullyelseEX_SOFTWARE)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp