Skip to content

Commit 840fbd4

Browse files
committed
feat: prepare "contrib" area
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent be8d607 commit 840fbd4

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

cyclonedx/model/bom.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import py_serializable as serializable
2828
from sortedcontainers import SortedSet
29-
from typing_extensions import deprecated
3029

3130
from .._internal.compare import ComparableTuple as _ComparableTuple
3231
from .._internal.time import get_now_utc as _get_now_utc
@@ -760,8 +759,8 @@ def get_vulnerabilities_for_bom_ref(self, bom_ref: BomRef) -> 'SortedSet[Vulnera
760759
`SortedSet` of `Vulnerability`
761760
762761
.. deprecated:: next
762+
Deprecated without any replacement.
763763
"""
764-
765764
vulnerabilities: SortedSet[Vulnerability] = SortedSet()
766765
for v in self.vulnerabilities:
767766
for target in v.affects:
@@ -777,6 +776,7 @@ def has_vulnerabilities(self) -> bool:
777776
`bool` - `True` if this Bom has at least one Vulnerability, `False` otherwise.
778777
779778
.. deprecated:: next
779+
Deprecated without any replacement.
780780
"""
781781
return bool(self.vulnerabilities)
782782

@@ -801,6 +801,7 @@ def register_dependency(self, target: Dependable, depends_on: Optional[Iterable[
801801
def urn(self) -> str:
802802
"""
803803
.. deprecated:: next
804+
Deprecated without any replacement.
804805
"""
805806
# idea: have 'serial_number' be a string, and use it instead of this method
806807
return f'{_BOM_LINK_PREFIX}{self.serial_number}/{self.version}'
@@ -814,6 +815,7 @@ def validate(self) -> bool:
814815
`bool`
815816
816817
.. deprecated:: next
818+
Deprecated without any replacement.
817819
"""
818820
# !! deprecated function. have this as an part of the normlization process, like the BomRefDiscrimator
819821
# 0. Make sure all Dependable have a Dependency entry

cyclonedx/model/component.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616
# Copyright (c) OWASP Foundation. All Rights Reserved.
1717

1818
import re
19+
import sys
1920
from collections.abc import Iterable
2021
from enum import Enum
2122
from typing import Any, Optional, Union
2223
from warnings import warn
2324

25+
if sys.version_info >= (3, 13):
26+
from warnings import deprecated
27+
else:
28+
from typing_extensions import deprecated
29+
2430
# See https://github.com/package-url/packageurl-python/issues/65
2531
import py_serializable as serializable
2632
from packageurl import PackageURL
2733
from sortedcontainers import SortedSet
28-
from typing_extensions import deprecated
2934

3035
from .._internal.bom_ref import bom_ref_from_str as _bom_ref_from_str
3136
from .._internal.compare import ComparablePackageURL as _ComparablePackageURL, ComparableTuple as _ComparableTuple

cyclonedx/model/vulnerability.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,21 @@
2828
See the CycloneDX Schema extension definition https://cyclonedx.org/docs/1.7/xml/#type_vulnerabilitiesType
2929
"""
3030

31-
31+
import sys
3232
import re
3333
from collections.abc import Iterable
3434
from datetime import datetime
3535
from decimal import Decimal
3636
from enum import Enum
3737
from typing import Any, Optional, Union
3838

39+
if sys.version_info >= (3, 13):
40+
from warnings import deprecated
41+
else:
42+
from typing_extensions import deprecated
43+
3944
import py_serializable as serializable
4045
from sortedcontainers import SortedSet
41-
from typing_extensions import deprecated
4246

4347
from .._internal.bom_ref import bom_ref_from_str as _bom_ref_from_str
4448
from .._internal.compare import ComparableTuple as _ComparableTuple

0 commit comments

Comments
 (0)