diff options
author | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2007-01-05 18:15:31 +0000 |
---|---|---|
committer | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2007-01-05 18:15:31 +0000 |
commit | 02b20a8758026a23fbd41b882ff0261158617443 (patch) | |
tree | b3d090f5f5e21b2b169203f9f6f41a7a848de9c6 /setuptools/command | |
parent | cbaa0bdbec02953eb2437e493a59a6178a320b1a (diff) | |
download | python-setuptools-02b20a8758026a23fbd41b882ff0261158617443.tar.gz |
Fix not generating correct .pth for parent namespace packages when
installing --single-version-externally-managed.
git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@53268 6015fed2-1504-0410-9fe1-9d1591cc4771
Diffstat (limited to 'setuptools/command')
-rwxr-xr-x | setuptools/command/install_egg_info.py | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/setuptools/command/install_egg_info.py b/setuptools/command/install_egg_info.py index 193e91a..8f97263 100755 --- a/setuptools/command/install_egg_info.py +++ b/setuptools/command/install_egg_info.py @@ -57,9 +57,8 @@ class install_egg_info(Command): unpack_archive(self.source, self.target, skimmer) def install_namespaces(self): - nsp = (self.distribution.namespace_packages or [])[:] + nsp = self._get_all_ns_packages() if not nsp: return - nsp.sort() # set up shorter names first filename,ext = os.path.splitext(self.target) filename += '-nspkg.pth'; self.outputs.append(filename) log.info("Installing %s",filename) @@ -79,3 +78,46 @@ class install_egg_info(Command): % locals() ) f.close() + + + def _get_all_ns_packages(self): + nsp = {} + for pkg in self.distribution.namespace_packages or []: + pkg = pkg.split('.') + while pkg: + nsp['.'.join(pkg)] = 1 + pkg.pop() + nsp=list(nsp) + nsp.sort() # set up shorter names first + return nsp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |