summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-09-26 10:56:24 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-09-26 10:56:24 -0400
commit4d538558d0d5744a18a67ead585583771f6cb795 (patch)
tree88bf2ea0136ff2efc2eed00412aba4c10de43a87
parent2cf0c24e2fc6521a6fd35fe2b44186b0bb2032d2 (diff)
downloadpython-setuptools-bitbucket-4d538558d0d5744a18a67ead585583771f6cb795.tar.gz
Return the exclusions directly
-rw-r--r--setuptools/command/install_lib.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/setuptools/command/install_lib.py b/setuptools/command/install_lib.py
index f36d8651..dcd85dec 100644
--- a/setuptools/command/install_lib.py
+++ b/setuptools/command/install_lib.py
@@ -1,6 +1,6 @@
import os
import imp
-from itertools import product
+from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
@@ -18,9 +18,11 @@ class install_lib(orig.install_lib):
Return a collections.Sized collections.Container of paths to be
excluded for single_version_externally_managed installations.
"""
- exclude = set()
-
def _exclude(pkg, exclusion_path):
+ """
+ Given a package name and exclusion path within that package,
+ compute the full exclusion path.
+ """
parts = pkg.split('.') + [exclusion_path]
return os.path.join(self.install_dir, *parts)
@@ -29,9 +31,9 @@ class install_lib(orig.install_lib):
for ns_pkg in self._get_SVEM_NSPs()
for pkg in self._all_packages(ns_pkg)
)
- for pkg, f in product(all_packages, self._gen_exclude_names()):
- exclude.add(_exclude(pkg, f))
- return exclude
+
+ excl_specs = product(all_packages, self._gen_exclude_names())
+ return set(starmap(_exclude, excl_specs))
@staticmethod
def _all_packages(pkg_name):