@@ -254,6 +254,15 @@ def main(force):
254
254
)
255
255
]
256
256
257
+ pydist_check_options = [
258
+ click .option (
259
+ "--pydist-check-cmd" ,
260
+ envvar = "RH_PYDIST_CHECK_CMD" ,
261
+ default = "twine check --strict" ,
262
+ help = "The command to use to check a python distribution file" ,
263
+ )
264
+ ]
265
+
257
266
258
267
def add_options (options ):
259
268
"""Add extracted common options to a click command"""
@@ -414,15 +423,18 @@ def build_python(dist_dir, python_packages):
414
423
@main .command ()
415
424
@add_options (dist_dir_options )
416
425
@add_options (check_imports_options )
426
+ @add_options (pydist_check_options )
417
427
@use_checkout_dir ()
418
- def check_python (dist_dir , check_imports ):
428
+ def check_python (dist_dir , check_imports , pydist_check_cmd ):
419
429
"""Check Python dist files"""
420
430
for dist_file in glob (f"{ dist_dir } /*" ):
421
431
if Path (dist_file ).suffix not in [".gz" , ".whl" ]:
422
432
util .log (f"Skipping non-python dist file { dist_file } " )
423
433
continue
424
434
425
- python .check_dist (dist_file , python_imports = check_imports )
435
+ python .check_dist (
436
+ dist_file , python_imports = check_imports , check_cmd = pydist_check_cmd
437
+ )
426
438
427
439
428
440
@main .command ()
@@ -587,10 +599,15 @@ def delete_release(auth, release_url):
587
599
@add_options (dist_dir_options )
588
600
@add_options (dry_run_options )
589
601
@add_options (npm_install_options )
602
+ @add_options (pydist_check_options )
590
603
@click .argument ("release-url" , nargs = 1 )
591
- def extract_release (auth , dist_dir , dry_run , release_url , npm_install_options ):
604
+ def extract_release (
605
+ auth , dist_dir , dry_run , release_url , npm_install_options , pydist_check_cmd
606
+ ):
592
607
"""Download and verify assets from a draft GitHub release"""
593
- lib .extract_release (auth , dist_dir , dry_run , release_url , npm_install_options )
608
+ lib .extract_release (
609
+ auth , dist_dir , dry_run , release_url , npm_install_options , pydist_check_cmd
610
+ )
594
611
595
612
596
613
@main .command ()
0 commit comments