29
29
from cyclonedx .model .component import Component , ComponentType
30
30
from cyclonedx .model .license import DisjunctiveLicense , License , LicenseAcknowledgement , LicenseExpression
31
31
32
- from ... import __version__ as __THIS_VERSION # noqa:N812
32
+ from ... import __version__ as _THIS_VERSION # noqa:N812
33
33
34
34
35
35
def make_bom (** kwargs : Any ) -> Bom :
@@ -41,7 +41,7 @@ def make_bom(**kwargs: Any) -> Bom:
41
41
group = 'CycloneDX' ,
42
42
# package is called 'cyclonedx-bom', but the tool is called 'cyclonedx-py'
43
43
name = 'cyclonedx-py' ,
44
- version = __THIS_VERSION ,
44
+ version = _THIS_VERSION ,
45
45
description = 'CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments' ,
46
46
licenses = (DisjunctiveLicense (id = 'Apache-2.0' ,
47
47
acknowledgement = LicenseAcknowledgement .DECLARED ),),
@@ -95,7 +95,7 @@ def licenses_fixup(licenses: Iterable['License']) -> Iterable['License']:
95
95
return licenses
96
96
97
97
98
- __known_ulr_labels : Dict [str , ExternalReferenceType ] = {
98
+ _MAP_KNOWN_URL_LABELS : Dict [str , ExternalReferenceType ] = {
99
99
# see https://peps.python.org/pep-0345/#project-url-multiple-use
100
100
# see https://github.com/pypi/warehouse/issues/5947#issuecomment-699660629
101
101
'bugtracker' : ExternalReferenceType .ISSUE_TRACKER ,
@@ -116,10 +116,11 @@ def licenses_fixup(licenses: Iterable['License']) -> Iterable['License']:
116
116
'chat' : ExternalReferenceType .CHAT ,
117
117
}
118
118
119
- __re_nochar = re_compile ('[^a-z]' )
119
+ _NOCHAR_MATCHER = re_compile ('[^a-z]' )
120
120
121
121
122
122
def url_label_to_ert (value : str ) -> ExternalReferenceType :
123
- return __known_ulr_labels .get (
124
- __re_nochar .sub ('' , str (value ).lower ()),
125
- ExternalReferenceType .OTHER )
123
+ return _MAP_KNOWN_URL_LABELS .get (
124
+ _NOCHAR_MATCHER .sub ('' , str (value ).lower ()),
125
+ ExternalReferenceType .OTHER
126
+ )
0 commit comments