Skip to content

Commit c67795f

Browse files
committed
Support oss name with files.pythonhosted.org url
Signed-off-by: Jiyeong Seok <[email protected]>
1 parent 0c47e43 commit c67795f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fosslight_scanner/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def extract_name_from_link(link):
101101
pkg_pattern = {
102102
"github": r'https?:\/\/github.com\/([^\/]+)\/([^\/\.]+)(\.git)?',
103103
"pypi": r'https?:\/\/pypi\.org\/project\/([^\/]+)',
104+
"pypi2": r'https?:\/\/files\.pythonhosted\.org\/packages\/source\/[\w]\/([^\/]+)\/([^\/]+)',
104105
"maven": r'https?:\/\/mvnrepository\.com\/artifact\/([^\/]+)\/([^\/]+)',
105106
"npm": r'https?:\/\/www\.npmjs\.com\/package\/([^\/]+)(\/[^\/]+)?',
106107
"pub": r'https?:\/\/pub\.dev\/packages\/([^\/]+)',
@@ -119,7 +120,7 @@ def extract_name_from_link(link):
119120
repo = match.group(2)
120121
oss_name = f"{group}-{repo}"
121122
break
122-
elif key == "pypi":
123+
elif (key == "pypi") or (key == "pypi2"):
123124
oss_name = f"pypi:{group}"
124125
break
125126
elif key == "maven":

0 commit comments

Comments
 (0)