Skip to content

Commit 9e192f8

Browse files
committed
2 parents 2aaf89c + 3c18388 commit 9e192f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

licensecheck/packageinfo.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ def getClassifiersLicense() -> dict[str, Any]:
136136
return tool["poetry"]
137137
if "flit" in tool:
138138
return tool["flit"]["metadata"]
139+
if pyproject.get("project") is not None:
140+
return pyproject["project"]
141+
139142
return {"classifiers": [], "license": ""}
140143

141144

@@ -150,7 +153,10 @@ def getMyPackageLicense() -> str:
150153
if licenseClassifier != UNKNOWN:
151154
return licenseClassifier
152155
if "license" in metaData:
153-
return str(metaData["license"])
156+
if isinstance(metaData["license"], dict) and metaData["license"].get("text") is not None:
157+
return str(metaData["license"].get("text"))
158+
else:
159+
return str(metaData["license"])
154160
return input("Enter the project license")
155161

156162

0 commit comments

Comments
 (0)