mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 19:45:22 +00:00
Merge 24a04eee41a551eb83c49496be9a8f357af04f59 into 5707a39df693ddd243ddd7c47ff35ce66d25a6c6
This commit is contained in:
commit
0fed074bde
@ -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
|
||||
|
||||
@ -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)))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user