@@ -403,6 +403,7 @@ def _test_library(self, include, data):
403
403
404
404
pck_release_key_types_map = {
405
405
'base' : str ,
406
+ 'asset' : str ,
406
407
'tags' : (bool , str ),
407
408
'branch' : str ,
408
409
'sublime_text' : str ,
@@ -416,6 +417,7 @@ def _test_library(self, include, data):
416
417
417
418
dep_release_key_types_map = {
418
419
'base' : str ,
420
+ 'asset' : str ,
419
421
'tags' : (bool , str ),
420
422
'branch' : str ,
421
423
'sublime_text' : str ,
@@ -433,22 +435,22 @@ def _test_release(self, package_name, data, library, main_repo=True):
433
435
if library :
434
436
condition = (
435
437
'base' in data
436
- and ( 'tags' in data or 'branch' in data )
438
+ and any ( d in data for d in ( 'asset' , 'tags' , 'branch' ) )
437
439
or ('sha256' in data
438
440
and ('url' not in data
439
441
or data ['url' ].startswith ('http://' )))
440
442
)
441
443
self .assertTrue (condition ,
442
- 'A release must have a "base" and a "tags" or "branch" key '
444
+ 'A release must have a "base" and an "asset", "tags" or "branch" key '
443
445
'if it is in the main repository. For custom '
444
446
'releases, a custom repository.json file must be '
445
447
'hosted elsewhere. The only exception to this rule '
446
448
'is for packages that can not be served over HTTPS '
447
449
'since they help bootstrap proper secure HTTP '
448
450
'support for Sublime Text.' )
449
451
else :
450
- self .assertTrue (( 'tags' in data or 'branch' in data ),
451
- 'A release must have a "tags" key or "branch" key '
452
+ self .assertTrue (any ( d in data for d in ( 'asset' , 'tags' , 'branch' ) ),
453
+ 'A release must have an "asset", "tags" or "branch" key '
452
454
'if it is in the main repository. For custom '
453
455
'releases, a custom repository.json file must be '
454
456
'hosted elsewhere.' )
@@ -458,7 +460,7 @@ def _test_release(self, package_name, data, library, main_repo=True):
458
460
'used in the main repository since a pull '
459
461
'request would be necessary for every release' )
460
462
461
- elif 'tags' not in data and 'branch' not in data :
463
+ elif not any ( d in data for d in ( 'asset' , 'tags' , 'branch' )) :
462
464
if library :
463
465
for key in ('url' , 'version' ):
464
466
self .assertIn (key , data ,
@@ -481,6 +483,10 @@ def _test_release(self, package_name, data, library, main_repo=True):
481
483
'A release must have only one of the "tags" or '
482
484
'"branch" keys.' )
483
485
486
+ self .assertFalse (('asset' in data and 'branch' in data ),
487
+ 'A release must have only one of the "asset" or '
488
+ '"branch" keys.' )
489
+
484
490
# Test keys values
485
491
self .check_release_key_values (data , library )
486
492
0 commit comments