Skip to content

Commit f826f21

Browse files
committed
Fix package detection to support repo URLs
1 parent f89dc92 commit f826f21

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mbed/mbed.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,8 @@ def check_requirements(self, show_warning=False):
14971497
pkg_list = pquery([python_cmd, '-m', 'pip', 'list', '-l']) or ""
14981498
installed_packages = [re.sub(r'-', '_', pkg.split()[0].lower()) for pkg in pkg_list.splitlines() if len(pkg.split())]
14991499
for line in f.read().splitlines():
1500-
pkg = re.sub(r'-', '_', re.sub(r'^([\w-]+).*$', r'\1', line).lower())
1500+
pkg = re.sub(r'-', '_', re.sub(r'^([^<>=@]+).*$', r'\1', line).lower())
1501+
pkg = re.sub(r'^(git|hg|svn|bzr)\+(.*)/([\w.-]+?)(\.(git|hg))?$', r'\3', pkg)
15011502
if not pkg in installed_packages:
15021503
missing.append(pkg)
15031504

0 commit comments

Comments
 (0)