Skip to content

Commit

Permalink
Merge 24a04ee into 5707a39
Browse files Browse the repository at this point in the history
  • Loading branch information
spenly committed Mar 13, 2018
2 parents 5707a39 + 24a04ee commit e9dfcc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pipreqs/pipreqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,10 @@ def compare_modules(file_, imports):

imports = [imports[i]["name"] for i in range(len(imports))]
modules = [modules[i]["name"] for i in range(len(modules))]
modules_not_imported = set(modules) - set(imports)
# modules => declared in requirements
# imports => all modules needed
# not imported => all modules - declared
modules_not_imported = set(imports) - set(modules)

return modules_not_imported

Expand All @@ -359,7 +362,7 @@ def diff(file_, imports):
modules_not_imported = compare_modules(file_, imports)

logging.info(
"The following modules are in {} but do not seem to be imported: "
"The following modules are in {} but do not seem to be imported: \n"
"{}".format(file_, ", ".join(x for x in modules_not_imported)))


Expand Down

0 comments on commit e9dfcc7

Please sign in to comment.