Commit c6669ca4 authored by Wyatt Lee Baldwin's avatar Wyatt Lee Baldwin

Setup find_packages excludes early for clarity.

--HG--
extra : rebase_source : 7c05859ef526ed8a2d9af738e54dc9dca510245e
parent f2bb3b0a
......@@ -38,6 +38,7 @@ def find_packages(where='.', exclude=()):
"""
out = []
stack=[(convert_path(where), '')]
exclude = list(exclude) + ['ez_setup']
while stack:
where,prefix = stack.pop(0)
for name in os.listdir(where):
......@@ -50,7 +51,7 @@ def find_packages(where='.', exclude=()):
if looks_like_package:
out.append(prefix+name)
stack.append((fn, prefix+name+'.'))
for pat in list(exclude)+['ez_setup']:
for pat in exclude:
from fnmatch import fnmatchcase
out = [item for item in out if not fnmatchcase(item,pat)]
return out
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment