|
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 |
@@ -314,6 +315,7 @@ def check_tool(db: ReleaseShelf, tool: str) -> None: |
314 | 315 | raise ReleaseException(f"{tool} is not available") |
315 | 316 |
|
316 | 317 |
|
| 318 | +check_gh = functools.partial(check_tool, tool="gh") |
317 | 319 | check_git = functools.partial(check_tool, tool="git") |
318 | 320 | check_make = functools.partial(check_tool, tool="make") |
319 | 321 | check_blurb = functools.partial(check_tool, tool="blurb") |
@@ -936,21 +938,16 @@ def start_build_release(db: ReleaseShelf) -> None: |
936 | 938 | # After visually confirming the release manager can start the build process |
937 | 939 | # with the known good commit SHA. |
938 | 940 | print() |
939 | | - print( |
940 | | - "Go to https://github.com/python/release-tools/actions/workflows/build-release.yml" |
941 | | - ) |
942 | | - print("Select 'Run workflow' and enter the following values:") |
943 | | - print(f"- Git remote to checkout: {origin_remote_github_owner}") |
944 | | - print(f"- Git commit to target for the release: {commit_sha}") |
945 | | - print(f"- CPython release number: {db['release']}") |
946 | | - print() |
947 | | - print("Or using the GitHub CLI run:") |
948 | | - print( |
949 | | - " gh workflow run build-release.yml --repo python/release-tools" |
| 941 | + cmd = ( |
| 942 | + "gh workflow run build-release.yml --repo python/release-tools" |
950 | 943 | f" -f git_remote={origin_remote_github_owner}" |
951 | 944 | f" -f git_commit={commit_sha}" |
952 | 945 | f" -f cpython_release={db['release']}" |
953 | 946 | ) |
| 947 | + subprocess.check_call(shlex.split(cmd)) |
| 948 | + print( |
| 949 | + "Go to https://github.com/python/release-tools/actions/workflows/build-release.yml" |
| 950 | + ) |
954 | 951 | print() |
955 | 952 |
|
956 | 953 | if not ask_question("Have you started the build-release workflow?"): |
@@ -1420,6 +1417,7 @@ def _api_key(api_key: str) -> str: |
1420 | 1417 | magic = release_tag.as_tuple() >= (3, 14) |
1421 | 1418 | no_gpg = release_tag.as_tuple() >= (3, 14) # see PEP 761 |
1422 | 1419 | tasks = [ |
| 1420 | + Task(check_gh, "Checking gh is available"), |
1423 | 1421 | Task(check_git, "Checking Git is available"), |
1424 | 1422 | Task(check_make, "Checking make is available"), |
1425 | 1423 | Task(check_blurb, "Checking blurb is available"), |
|
0 commit comments