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