Skip to content

Commit

Permalink
Merge pull request #320 from screamerbg/0.9-polishing
Browse files Browse the repository at this point in the history
Convert '-' to '_' when matching pip installed packages and requirements.txt
  • Loading branch information
sg- authored Aug 4, 2016
2 parents 3c0dfc7 + 77dabcb commit f19c225
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,9 +1221,9 @@ def check_requirements(self, show_warning=False):
try:
with open(os.path.join(req_path, req_file), 'r') as f:
import pip
installed_packages = [package.project_name.lower() for package in pip.get_installed_distributions(local_only=True)]
installed_packages = [re.sub(r'-', '_', package.project_name.lower()) for package in pip.get_installed_distributions(local_only=True)]
for line in f.read().splitlines():
pkg = re.sub(r'^([\w-]+).*$', r'\1', line).lower()
pkg = re.sub(r'-', '_', re.sub(r'^([\w-]+).*$', r'\1', line).lower())
if not pkg in installed_packages:
missing.append(pkg)

Expand Down

0 comments on commit f19c225

Please sign in to comment.