mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
Merge pull request #95 from jonafato/cleanup-get_all_imports
Clean up set and file usage in get_all_imports
This commit is contained in:
commit
800abc43e3
@ -114,13 +114,14 @@ def get_all_imports(
|
||||
cleaned_name, _, _ = name.partition('.')
|
||||
imports.add(cleaned_name)
|
||||
|
||||
packages = set(imports) - set(set(candidates) & set(imports))
|
||||
packages = imports - (set(candidates) & imports)
|
||||
logging.debug('Found packages: {0}'.format(packages))
|
||||
|
||||
with open(join("stdlib"), "r") as f:
|
||||
data = [x.strip() for x in f.readlines()]
|
||||
data = [x for x in data if x not in py2_exclude] if py2 else data
|
||||
return list(set(packages) - set(data))
|
||||
data = {x.strip() for x in f}
|
||||
|
||||
data = {x for x in data if x not in py2_exclude} if py2 else data
|
||||
return list(packages - data)
|
||||
|
||||
|
||||
def filter_line(l):
|
||||
|
Loading…
x
Reference in New Issue
Block a user