summaryrefslogtreecommitdiff
path: root/setuptools/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-03-22 09:10:14 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-03-22 09:10:14 -0400
commit8679c5facc30a558613c137c5ec3305d320134b6 (patch)
treedce89bb92e100653760b285411037e44c1749812 /setuptools/__init__.py
parent17c19bd6ef3c63e112f82f3e81c1d863fd5074e5 (diff)
downloadpython-setuptools-git-8679c5facc30a558613c137c5ec3305d320134b6.tar.gz
Extract path assembly
Diffstat (limited to 'setuptools/__init__.py')
-rw-r--r--setuptools/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index 2e9c14f4..f12c8dd6 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -52,16 +52,17 @@ def find_packages(where='.', exclude=(), include=('*',)):
where,prefix = stack.pop(0)
dirs = _dirs(where)
suitable = filterfalse(lambda n: '.' in n, dirs)
- for name in suitable:
- fn = os.path.join(where,name)
+ paths = (os.path.join(where, name) for name in suitable)
+ for path in paths:
+ name = os.path.basename(path)
looks_like_package = (
- os.path.isfile(os.path.join(fn, '__init__.py'))
+ os.path.isfile(os.path.join(path, '__init__.py'))
or sys.version_info[:2] >= (3, 3) # PEP 420
)
if looks_like_package:
pkg_name = prefix + name
out.append(pkg_name)
- stack.append((fn, pkg_name + '.'))
+ stack.append((path, pkg_name + '.'))
includes = _build_filter(*include)
excludes = _build_filter('ez_setup', '*__pycache__', *exclude)
out = filter(includes, out)