Skip to content

Commit d784685

Browse files
authored
fix: include all fields of Component in __lt__ function for #586 (#587)
Fixes #586. Signed-off-by: Paul Horton <[email protected]>
1 parent d437c40 commit d784685

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

cyclonedx/model/component.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,9 +1699,19 @@ def __eq__(self, other: object) -> bool:
16991699
def __lt__(self, other: Any) -> bool:
17001700
if isinstance(other, Component):
17011701
return _ComparableTuple((
1702-
self.type, self.group, self.name, self.version
1702+
self.type, self.mime_type, self.supplier, self.author, self.publisher, self.group, self.name,
1703+
self.version, self.description, self.scope, _ComparableTuple(self.hashes),
1704+
_ComparableTuple(self.licenses), self.copyright, self.cpe, self.purl, self.swid, self.pedigree,
1705+
_ComparableTuple(self.external_references), _ComparableTuple(self.properties),
1706+
_ComparableTuple(self.components), self.evidence, self.release_notes, self.modified,
1707+
_ComparableTuple(self.authors), _ComparableTuple(self.omnibor_ids),
17031708
)) < _ComparableTuple((
1704-
other.type, other.group, other.name, other.version
1709+
other.type, other.mime_type, other.supplier, other.author, other.publisher, other.group, other.name,
1710+
other.version, other.description, other.scope, _ComparableTuple(other.hashes),
1711+
_ComparableTuple(other.licenses), other.copyright, other.cpe, other.purl, other.swid, other.pedigree,
1712+
_ComparableTuple(other.external_references), _ComparableTuple(other.properties),
1713+
_ComparableTuple(other.components), other.evidence, other.release_notes, other.modified,
1714+
_ComparableTuple(other.authors), _ComparableTuple(other.omnibor_ids),
17051715
))
17061716
return NotImplemented
17071717

0 commit comments

Comments
 (0)