@@ -1010,11 +1010,9 @@ def __init__(
1010
1010
self .supplier = supplier
1011
1011
self .manufacturer = manufacturer
1012
1012
self .authors = authors or []
1013
- self .author = author
1014
1013
self .publisher = publisher
1015
1014
self .group = group
1016
1015
self .name = name
1017
- self .version = version
1018
1016
self .description = description
1019
1017
self .scope = scope
1020
1018
self .hashes = hashes or []
@@ -1025,7 +1023,6 @@ def __init__(
1025
1023
self .omnibor_ids = omnibor_ids or []
1026
1024
self .swhids = swhids or []
1027
1025
self .swid = swid
1028
- self .modified = modified
1029
1026
self .pedigree = pedigree
1030
1027
self .external_references = external_references or []
1031
1028
self .properties = properties or []
@@ -1034,13 +1031,10 @@ def __init__(
1034
1031
self .release_notes = release_notes
1035
1032
self .crypto_properties = crypto_properties
1036
1033
self .tags = tags or []
1037
-
1038
- if modified :
1039
- warn ('`.component.modified` is deprecated from CycloneDX v1.3 onwards. '
1040
- 'Please use `@.pedigree` instead.' , DeprecationWarning )
1041
- if author :
1042
- warn ('`.component.author` is deprecated from CycloneDX v1.6 onwards. '
1043
- 'Please use `@.authors` or `@.manufacturer` instead.' , DeprecationWarning )
1034
+ # spec-deprecated properties below
1035
+ self .author = author
1036
+ self .modified = modified
1037
+ self .version = version
1044
1038
1045
1039
@property
1046
1040
@serializable .type_mapping (_ComponentTypeSerializationHelper )
@@ -1175,6 +1169,9 @@ def author(self) -> Optional[str]:
1175
1169
1176
1170
@author .setter
1177
1171
def author (self , author : Optional [str ]) -> None :
1172
+ if author is not None :
1173
+ warn ('`@.author` is deprecated from CycloneDX v1.6 onwards. '
1174
+ 'Please use `@.authors` or `@.manufacturer` instead.' , DeprecationWarning )
1178
1175
self ._author = author
1179
1176
1180
1177
@property
@@ -1255,7 +1252,7 @@ def version(self) -> Optional[str]:
1255
1252
@version .setter
1256
1253
def version (self , version : Optional [str ]) -> None :
1257
1254
if version and len (version ) > 1024 :
1258
- warn ('`.component .version`has a maximum length of 1024 from CycloneDX v1.6 onwards.' , UserWarning )
1255
+ warn ('`@ .version`has a maximum length of 1024 from CycloneDX v1.6 onwards.' , UserWarning )
1259
1256
self ._version = version
1260
1257
1261
1258
@property
@@ -1450,6 +1447,9 @@ def modified(self) -> bool:
1450
1447
1451
1448
@modified .setter
1452
1449
def modified (self , modified : bool ) -> None :
1450
+ if modified :
1451
+ warn ('`@.modified` is deprecated from CycloneDX v1.3 onwards. '
1452
+ 'Please use `@.pedigree` instead.' , DeprecationWarning )
1453
1453
self ._modified = modified
1454
1454
1455
1455
@property
0 commit comments