|
16 | 16 | import os |
17 | 17 | import re |
18 | 18 | import shelve |
| 19 | +import shlex |
19 | 20 | import shutil |
20 | 21 | import subprocess |
21 | 22 | import sys |
@@ -312,6 +313,7 @@ def check_tool(db: ReleaseShelf, tool: str) -> None: |
312 | 313 | raise ReleaseException(f"{tool} is not available") |
313 | 314 |
|
314 | 315 |
|
| 316 | +check_gh = functools.partial(check_tool, tool="gh") |
315 | 317 | check_git = functools.partial(check_tool, tool="git") |
316 | 318 | check_make = functools.partial(check_tool, tool="make") |
317 | 319 | check_blurb = functools.partial(check_tool, tool="blurb") |
@@ -927,21 +929,16 @@ def start_build_release(db: ReleaseShelf) -> None: |
927 | 929 | # After visually confirming the release manager can start the build process |
928 | 930 | # with the known good commit SHA. |
929 | 931 | print() |
930 | | - print( |
931 | | - "Go to https://github.com/python/release-tools/actions/workflows/build-release.yml" |
932 | | - ) |
933 | | - print("Select 'Run workflow' and enter the following values:") |
934 | | - print(f"- Git remote to checkout: {origin_remote_github_owner}") |
935 | | - print(f"- Git commit to target for the release: {commit_sha}") |
936 | | - print(f"- CPython release number: {db['release']}") |
937 | | - print() |
938 | | - print("Or using the GitHub CLI run:") |
939 | | - print( |
940 | | - " gh workflow run build-release.yml --repo python/release-tools" |
| 932 | + cmd = ( |
| 933 | + "gh workflow run build-release.yml --repo python/release-tools" |
941 | 934 | f" -f git_remote={origin_remote_github_owner}" |
942 | 935 | f" -f git_commit={commit_sha}" |
943 | 936 | f" -f cpython_release={db['release']}" |
944 | 937 | ) |
| 938 | + subprocess.check_call(shlex.split(cmd)) |
| 939 | + print( |
| 940 | + "Go to https://github.com/python/release-tools/actions/workflows/build-release.yml" |
| 941 | + ) |
945 | 942 | print() |
946 | 943 |
|
947 | 944 | if not ask_question("Have you started the build-release workflow?"): |
@@ -1390,6 +1387,7 @@ def _api_key(api_key: str) -> str: |
1390 | 1387 | release_tag = release_mod.Tag(args.release) |
1391 | 1388 | no_gpg = release_tag.as_tuple() >= (3, 14) # see PEP 761 |
1392 | 1389 | tasks = [ |
| 1390 | + Task(check_gh, "Checking gh is available"), |
1393 | 1391 | Task(check_git, "Checking Git is available"), |
1394 | 1392 | Task(check_make, "Checking make is available"), |
1395 | 1393 | Task(check_blurb, "Checking blurb is available"), |
|
0 commit comments