2929from cyclonedx .model .component import Component , ComponentType
3030from cyclonedx .model .license import DisjunctiveLicense , License , LicenseAcknowledgement , LicenseExpression
3131
32- from ... import __version__ as __THIS_VERSION # noqa:N812
32+ from ... import __version__ as _THIS_VERSION # noqa:N812
3333
3434
3535def make_bom (** kwargs : Any ) -> Bom :
@@ -41,7 +41,7 @@ def make_bom(**kwargs: Any) -> Bom:
4141 group = 'CycloneDX' ,
4242 # package is called 'cyclonedx-bom', but the tool is called 'cyclonedx-py'
4343 name = 'cyclonedx-py' ,
44- version = __THIS_VERSION ,
44+ version = _THIS_VERSION ,
4545 description = 'CycloneDX Software Bill of Materials (SBOM) generator for Python projects and environments' ,
4646 licenses = (DisjunctiveLicense (id = 'Apache-2.0' ,
4747 acknowledgement = LicenseAcknowledgement .DECLARED ),),
@@ -95,7 +95,7 @@ def licenses_fixup(licenses: Iterable['License']) -> Iterable['License']:
9595 return licenses
9696
9797
98- __known_ulr_labels : Dict [str , ExternalReferenceType ] = {
98+ _MAP_KNOWN_URL_LABELS : Dict [str , ExternalReferenceType ] = {
9999 # see https://peps.python.org/pep-0345/#project-url-multiple-use
100100 # see https://github.com/pypi/warehouse/issues/5947#issuecomment-699660629
101101 'bugtracker' : ExternalReferenceType .ISSUE_TRACKER ,
@@ -116,10 +116,11 @@ def licenses_fixup(licenses: Iterable['License']) -> Iterable['License']:
116116 'chat' : ExternalReferenceType .CHAT ,
117117}
118118
119- __re_nochar = re_compile ('[^a-z]' )
119+ _NOCHAR_MATCHER = re_compile ('[^a-z]' )
120120
121121
122122def 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