Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cyclonedx/model/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,7 @@ def __init__(
self.properties = properties or []
self.manufacturer = manufacturer
self.lifecycles = lifecycles or []

self.manufacture = manufacture
if manufacture:
warn(
'`bom.metadata.manufacture` is deprecated from CycloneDX v1.6 onwards. '
'Please use `bom.metadata.component.manufacturer` instead.',
DeprecationWarning)

@property
@serializable.type_mapping(serializable.helpers.XsdDateTime)
Expand Down Expand Up @@ -214,6 +208,11 @@ def manufacture(self, manufacture: Optional[OrganizationalEntity]) -> None:
@todo Based on https://github.com/CycloneDX/specification/issues/346,
we should set this data on `.component.manufacturer`.
"""
if manufacture:
warn(
'`bom.metadata.manufacture` is deprecated from CycloneDX v1.6 onwards. '
'Please use `bom.metadata.component.manufacturer` instead.',
DeprecationWarning)
self._manufacture = manufacture

@property
Expand Down
12 changes: 6 additions & 6 deletions cyclonedx/model/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,12 +1035,6 @@ def __init__(
self.crypto_properties = crypto_properties
self.tags = tags or []

if modified:
warn('`.component.modified` is deprecated from CycloneDX v1.3 onwards. '
'Please use `@.pedigree` instead.', DeprecationWarning)
if author:
warn('`.component.author` is deprecated from CycloneDX v1.6 onwards. '
'Please use `@.authors` or `@.manufacturer` instead.', DeprecationWarning)

@property
@serializable.type_mapping(_ComponentTypeSerializationHelper)
Expand Down Expand Up @@ -1175,6 +1169,9 @@ def author(self) -> Optional[str]:

@author.setter
def author(self, author: Optional[str]) -> None:
if author:
warn('`.component.author` is deprecated from CycloneDX v1.6 onwards. '
'Please use `@.authors` or `@.manufacturer` instead.', DeprecationWarning)
self._author = author

@property
Expand Down Expand Up @@ -1450,6 +1447,9 @@ def modified(self) -> bool:

@modified.setter
def modified(self, modified: bool) -> None:
if modified:
warn('`.component.modified` is deprecated from CycloneDX v1.3 onwards. '
'Please use `@.pedigree` instead.', DeprecationWarning)
self._modified = modified

@property
Expand Down