36
36
import sbom
37
37
from buildbotapi import BuildBotAPI , Builder
38
38
39
- API_KEY_REGEXP = re .compile (r"(?P<major >\w+):(?P<minor >\w+)" )
39
+ API_KEY_REGEXP = re .compile (r"(?P<user >\w+):(?P<key >\w+)" )
40
40
41
41
42
42
RELEASE_REGEXP = re .compile (
@@ -376,6 +376,10 @@ async def _get_builder_status(
376
376
raise ReleaseException ("Buildbots are failing!" )
377
377
378
378
379
+ def check_docker_running (db : DbfilenameShelf ) -> None :
380
+ subprocess .check_call (["docker" , "container" , "ls" ])
381
+
382
+
379
383
def run_blurb_release (db : DbfilenameShelf ) -> None :
380
384
subprocess .check_call (["blurb" , "release" , str (db ["release" ])], cwd = db ["git_repo" ])
381
385
subprocess .check_call (
@@ -389,7 +393,7 @@ def check_cpython_repo_is_clean(db: DbfilenameShelf) -> None:
389
393
raise ReleaseException ("Git repository is not clean" )
390
394
391
395
392
- def preapre_temporary_branch (db : DbfilenameShelf ) -> None :
396
+ def prepare_temporary_branch (db : DbfilenameShelf ) -> None :
393
397
subprocess .check_call (
394
398
["git" , "checkout" , "-b" , f"branch-{ db ['release' ]} " ], cwd = db ["git_repo" ]
395
399
)
@@ -807,7 +811,7 @@ def send_email_to_platform_release_managers(db: DbfilenameShelf) -> None:
807
811
if not ask_question (
808
812
"Have you notified the platform release managers about the availability of the commit SHA and tag?"
809
813
):
810
- raise ReleaseException ("Platform release managers muy be notified" )
814
+ raise ReleaseException ("Platform release managers must be notified" )
811
815
812
816
813
817
def create_release_object_in_db (db : DbfilenameShelf ) -> None :
@@ -1100,22 +1104,7 @@ def _push_to_upstream(dry_run: bool = False) -> None:
1100
1104
1101
1105
def main () -> None :
1102
1106
1103
- if "linux" not in sys .platform :
1104
- print (
1105
- """\
1106
- WARNING! This script has not been tested on a platform other than Linux.
1107
-
1108
- Although it should work correctly as long as you have all the dependencies,
1109
- some things may not work as expected. As a release manager, you should try to
1110
- fix these things in this script so it also support your platform.
1111
- """
1112
- )
1113
- if not ask_question ("Do you want to continue?" ):
1114
- raise ReleaseException (
1115
- "This release script is not compatible with the running platform"
1116
- )
1117
-
1118
- parser = argparse .ArgumentParser (description = "Process some integers." )
1107
+ parser = argparse .ArgumentParser (description = "Make a CPython release." )
1119
1108
1120
1109
def _release_type (release : str ) -> str :
1121
1110
if not RELEASE_REGEXP .match (release ):
@@ -1140,7 +1129,7 @@ def _release_type(release: str) -> str:
1140
1129
def _api_key (api_key : str ) -> str :
1141
1130
if not API_KEY_REGEXP .match (api_key ):
1142
1131
raise argparse .ArgumentTypeError (
1143
- "Invalid api key format. It must be on the form USER:API_KEY"
1132
+ "Invalid API key format. It must be on the form USER:API_KEY"
1144
1133
)
1145
1134
return api_key
1146
1135
@@ -1158,28 +1147,49 @@ def _api_key(api_key: str) -> str:
1158
1147
type = str ,
1159
1148
)
1160
1149
args = parser .parse_args ()
1150
+
1161
1151
auth_key = args .auth_key or os .getenv ("AUTH_INFO" )
1162
1152
assert isinstance (auth_key , str ), "We need an AUTH_INFO env var or --auth-key"
1153
+
1154
+ if "linux" not in sys .platform :
1155
+ print (
1156
+ """\
1157
+ WARNING! This script has not been tested on a platform other than Linux.
1158
+
1159
+ Although it should work correctly as long as you have all the dependencies,
1160
+ some things may not work as expected. As a release manager, you should try to
1161
+ fix these things in this script so it also supports your platform.
1162
+ """
1163
+ )
1164
+ if not ask_question ("Do you want to continue?" ):
1165
+ raise ReleaseException (
1166
+ "This release script is not compatible with the running platform"
1167
+ )
1168
+
1163
1169
tasks = [
1164
- Task (check_git , "Checking git is available" ),
1170
+ Task (check_git , "Checking Git is available" ),
1165
1171
Task (check_make , "Checking make is available" ),
1166
1172
Task (check_blurb , "Checking blurb is available" ),
1167
- Task (check_docker , "Checking docker is available" ),
1173
+ Task (check_docker , "Checking Docker is available" ),
1174
+ Task (check_docker_running , "Checking Docker is running" ),
1168
1175
Task (check_autoconf , "Checking autoconf is available" ),
1169
1176
Task (check_gpg_keys , "Checking GPG keys" ),
1170
- Task (check_ssh_connection , f"Validating ssh connection to { DOWNLOADS_SERVER } " ),
1177
+ Task (
1178
+ check_ssh_connection ,
1179
+ f"Validating ssh connection to { DOWNLOADS_SERVER } and { DOCS_SERVER } " ,
1180
+ ),
1171
1181
Task (check_buildbots , "Check buildbots are good" ),
1172
- Task (check_cpython_repo_is_clean , "Checking git repository is clean" ),
1173
- Task (preapre_temporary_branch , "Checking out a temporary release branch" ),
1182
+ Task (check_cpython_repo_is_clean , "Checking Git repository is clean" ),
1183
+ Task (prepare_temporary_branch , "Checking out a temporary release branch" ),
1174
1184
Task (run_blurb_release , "Run blurb release" ),
1175
- Task (check_cpython_repo_is_clean , "Checking git repository is clean" ),
1185
+ Task (check_cpython_repo_is_clean , "Checking Git repository is clean" ),
1176
1186
Task (prepare_pydoc_topics , "Preparing pydoc topics" ),
1177
1187
Task (bump_version , "Bump version" ),
1178
- Task (check_cpython_repo_is_clean , "Checking git repository is clean" ),
1188
+ Task (check_cpython_repo_is_clean , "Checking Git repository is clean" ),
1179
1189
Task (run_autoconf , "Running autoconf" ),
1180
- Task (check_cpython_repo_is_clean , "Checking git repository is clean" ),
1190
+ Task (check_cpython_repo_is_clean , "Checking Git repository is clean" ),
1181
1191
Task (check_pyspecific , "Checking pyspecific" ),
1182
- Task (check_cpython_repo_is_clean , "Checking git repository is clean" ),
1192
+ Task (check_cpython_repo_is_clean , "Checking Git repository is clean" ),
1183
1193
Task (create_tag , "Create tag" ),
1184
1194
Task (push_to_local_fork , "Push new tags and branches to private fork" ),
1185
1195
Task (
0 commit comments