let's see what's happening

This commit is contained in:
frostming
2019-05-20 14:28:02 +08:00
parent e6b2f6463a
commit 2dce8355e6
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -243,12 +243,15 @@ def import_from_code(path="."):
rs = []
try:
for r in pipreqs.get_all_imports(path, encoding="utf-8"):
click.echo(r)
if r not in BAD_PACKAGES:
rs.append(r)
pkg_names = pipreqs.get_pkg_names(rs)
return [proper_case(r) for r in pkg_names]
except Exception:
import traceback
traceback.print_exc()
return []
+1 -1
View File
@@ -68,7 +68,7 @@ def get_all_imports(path, encoding=None, extra_ignore_dirs=None):
candidates.append(os.path.basename(root))
files = [fn for fn in files if os.path.splitext(fn)[1] == ".py"]
print(root, files)
candidates += [os.path.splitext(fn)[0] for fn in files]
for file_name in files:
with open_func(os.path.join(root, file_name), "r", encoding=encoding) as f: