Skip to content

Commit

Permalink
Deducing license information for PyPI packages from classifiers (if n…
Browse files Browse the repository at this point in the history
…ot stated explicite)

Signed-off-by: Jacek Puchta <[email protected]>
  • Loading branch information
puchta committed Oct 25, 2023
1 parent fe324c5 commit 7eaf96b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,14 @@ export const getPyMetadata = async function (pkgList, fetchDepsInfo) {
}
p.description = body.info.summary;
p.license = findLicenseId(body.info.license);
if (!p.license && body.info.classifiers) {
for (const c of body.info.classifiers) {
if (c.startsWith("License :: ")) {
p.license = findLicenseId(c.split(" :: ")[c.split(" :: ").length - 1]);
break;
}
}
}
if (body.info.home_page) {
if (body.info.home_page.includes("git")) {
p.repository = { url: body.info.home_page };
Expand Down

0 comments on commit 7eaf96b

Please sign in to comment.