@@ -75,18 +75,17 @@ def __init__(self, use_purl_bom_ref: bool = False) -> None:
7575 # Therefore, just go with a named license.
7676 c .licenses .add (LicenseChoice (license_ = License (license_name = i_metadata ['License' ])))
7777
78- if 'Classifier' in i_metadata :
79- for classifier in i_metadata ['Classifier' ]:
80- # Trove classifiers - https://packaging.python.org/specifications/core-metadata/#metadata-classifier
81- # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
82- if str (classifier ).startswith ('License :: OSI Approved :: ' ):
83- c .licenses .add (LicenseChoice (license_ = License (
84- license_name = str (classifier ).replace ('License :: OSI Approved :: ' , '' ).strip ()
85- )))
86- elif str (classifier ).startswith ('License :: ' ):
87- c .licenses .add (LicenseChoice (license_ = License (
88- license_name = str (classifier ).replace ('License :: ' , '' ).strip ()
89- )))
78+ for classifier in i_metadata .get_all ("Classifier" ):
79+ # Trove classifiers - https://packaging.python.org/specifications/core-metadata/#metadata-classifier
80+ # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
81+ if str (classifier ).startswith ('License :: OSI Approved :: ' ):
82+ c .licenses .add (LicenseChoice (license_ = License (
83+ license_name = str (classifier ).replace ('License :: OSI Approved :: ' , '' ).strip ()
84+ )))
85+ elif str (classifier ).startswith ('License :: ' ):
86+ c .licenses .add (LicenseChoice (license_ = License (
87+ license_name = str (classifier ).replace ('License :: ' , '' ).strip ()
88+ )))
9089
9190 self ._components .append (c )
9291
0 commit comments