Skip to content

Commit 3dc8ac9

Browse files
Merge pull request #750 from screamerbg/f/fix_pkg_detect
Fix python package detection to support repo URLs
2 parents fa61b91 + f826f21 commit 3dc8ac9

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
@@ -1612,7 +1612,8 @@ def check_requirements(self, show_warning=False):
16121612
pkg_list = pquery([python_cmd, '-m', 'pip', 'list', '-l']) or ""
16131613
installed_packages = [re.sub(r'-', '_', pkg.split()[0].lower()) for pkg in pkg_list.splitlines() if len(pkg.split())]
16141614
for line in f.read().splitlines():
1615-
pkg = re.sub(r'-', '_', re.sub(r'^([\w-]+).*$', r'\1', line).lower())
1615+
pkg = re.sub(r'-', '_', re.sub(r'^([^<>=@]+).*$', r'\1', line).lower())
1616+
pkg = re.sub(r'^(git|hg|svn|bzr)\+(.*)/([\w.-]+?)(\.(git|hg))?$', r'\3', pkg)
16161617
if not pkg in installed_packages:
16171618
missing.append(pkg)
16181619

0 commit comments

Comments
 (0)