From f826f21c0a0892d9766c6a0ace429b7cd2254e28 Mon Sep 17 00:00:00 2001 From: Mihail Stoyanov Date: Mon, 10 Sep 2018 12:45:12 +0100 Subject: [PATCH] Fix package detection to support repo URLs --- mbed/mbed.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mbed/mbed.py b/mbed/mbed.py index 79460f35..4412c864 100755 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1497,7 +1497,8 @@ def check_requirements(self, show_warning=False): pkg_list = pquery([python_cmd, '-m', 'pip', 'list', '-l']) or "" installed_packages = [re.sub(r'-', '_', pkg.split()[0].lower()) for pkg in pkg_list.splitlines() if len(pkg.split())] for line in f.read().splitlines(): - pkg = re.sub(r'-', '_', re.sub(r'^([\w-]+).*$', r'\1', line).lower()) + pkg = re.sub(r'-', '_', re.sub(r'^([^<>=@]+).*$', r'\1', line).lower()) + pkg = re.sub(r'^(git|hg|svn|bzr)\+(.*)/([\w.-]+?)(\.(git|hg))?$', r'\3', pkg) if not pkg in installed_packages: missing.append(pkg)