@@ -201,6 +201,7 @@ def __init__(
201
201
git_repo : str ,
202
202
api_key : str ,
203
203
ssh_user : str ,
204
+ sign_gpg : bool ,
204
205
first_state : Task | None = None ,
205
206
) -> None :
206
207
self .tasks = tasks
@@ -223,6 +224,8 @@ def __init__(
223
224
self .db ["auth_info" ] = api_key
224
225
if not self .db .get ("ssh_user" ):
225
226
self .db ["ssh_user" ] = ssh_user
227
+ if not self .db .get ("sign_gpg" ):
228
+ self .db ["sign_gpg" ] = sign_gpg
226
229
227
230
if not self .db .get ("release" ):
228
231
self .db ["release" ] = release_tag
@@ -233,7 +236,8 @@ def __init__(
233
236
print (f"- Normalized release tag: { release_tag .normalized ()} " )
234
237
print (f"- Git repo: { self .db ['git_repo' ]} " )
235
238
print (f"- SSH username: { self .db ['ssh_user' ]} " )
236
- print (f"- python.org API key : { self .db ['auth_info' ]} " )
239
+ print (f"- python.org API key: { self .db ['auth_info' ]} " )
240
+ print (f"- Sign with GPG: { self .db ['sign_gpg' ]} " )
237
241
print ()
238
242
239
243
def checkpoint (self ) -> None :
@@ -465,7 +469,7 @@ def bump_version(db: DbfilenameShelf) -> None:
465
469
466
470
def create_tag (db : DbfilenameShelf ) -> None :
467
471
with cd (db ["git_repo" ]):
468
- if not release_mod .make_tag (db ["release" ]):
472
+ if not release_mod .make_tag (db ["release" ], sign_gpg = db [ "sign_gpg" ] ):
469
473
raise ReleaseException ("Error when creating tag" )
470
474
subprocess .check_call (
471
475
["git" , "commit" , "-a" , "--amend" , "--no-edit" ], cwd = db ["git_repo" ]
@@ -810,7 +814,7 @@ def create_release_object_in_db(db: DbfilenameShelf) -> None:
810
814
"Go to https://www.python.org/admin/downloads/release/add/ and create a new release"
811
815
)
812
816
if not ask_question (f"Have you already created a new release for { db ['release' ]} " ):
813
- raise ReleaseException ("The django release object has not been created" )
817
+ raise ReleaseException ("The Django release object has not been created" )
814
818
815
819
816
820
def wait_until_all_files_are_in_folder (db : DbfilenameShelf ) -> None :
@@ -1137,6 +1141,11 @@ def _api_key(api_key: str) -> str:
1137
1141
help = "Username to be used when authenticating via ssh" ,
1138
1142
type = str ,
1139
1143
)
1144
+ parser .add_argument (
1145
+ "--no-gpg" ,
1146
+ action = "store_true" ,
1147
+ help = "Skip GPG signing" ,
1148
+ )
1140
1149
args = parser .parse_args ()
1141
1150
1142
1151
auth_key = args .auth_key or os .getenv ("AUTH_INFO" )
@@ -1164,7 +1173,7 @@ def _api_key(api_key: str) -> str:
1164
1173
Task (check_docker , "Checking Docker is available" ),
1165
1174
Task (check_docker_running , "Checking Docker is running" ),
1166
1175
Task (check_autoconf , "Checking autoconf is available" ),
1167
- Task (check_gpg_keys , "Checking GPG keys" ),
1176
+ None if args . no_gpg else Task (check_gpg_keys , "Checking GPG keys" ),
1168
1177
Task (
1169
1178
check_ssh_connection ,
1170
1179
f"Validating ssh connection to { DOWNLOADS_SERVER } and { DOCS_SERVER } " ,
@@ -1196,13 +1205,13 @@ def _api_key(api_key: str) -> str:
1196
1205
"Wait for source and docs artifacts to build" ,
1197
1206
),
1198
1207
Task (build_sbom_artifacts , "Building SBOM artifacts" ),
1199
- Task (sign_source_artifacts , "Sign source artifacts" ),
1208
+ None if args . no_gpg else Task (sign_source_artifacts , "Sign source artifacts" ),
1200
1209
Task (upload_files_to_server , "Upload files to the PSF server" ),
1201
1210
Task (place_files_in_download_folder , "Place files in the download folder" ),
1202
1211
Task (upload_docs_to_the_docs_server , "Upload docs to the PSF docs server" ),
1203
1212
Task (unpack_docs_in_the_docs_server , "Place docs files in the docs folder" ),
1204
1213
Task (wait_until_all_files_are_in_folder , "Wait until all files are ready" ),
1205
- Task (create_release_object_in_db , "The django release object has been created" ),
1214
+ Task (create_release_object_in_db , "The Django release object has been created" ),
1206
1215
Task (post_release_merge , "Merge the tag into the release branch" ),
1207
1216
Task (branch_new_versions , "Branch out new versions and prepare main branch" ),
1208
1217
Task (post_release_tagging , "Final touches for the release" ),
@@ -1216,11 +1225,14 @@ def _api_key(api_key: str) -> str:
1216
1225
Task (purge_the_cdn , "Purge the CDN of python.org/downloads" ),
1217
1226
Task (modify_the_release_to_the_prerelease_pages , "Modify the pre-release page" ),
1218
1227
]
1228
+ # Remove any skipped tasks
1229
+ tasks = [task for task in tasks if task ]
1219
1230
automata = ReleaseDriver (
1220
1231
git_repo = args .repo ,
1221
1232
release_tag = release_mod .Tag (args .release ),
1222
1233
api_key = auth_key ,
1223
1234
ssh_user = args .ssh_user ,
1235
+ sign_gpg = not args .no_gpg ,
1224
1236
tasks = tasks ,
1225
1237
)
1226
1238
automata .run ()
0 commit comments