diff options
author | PJ Eby <distutils-sig@python.org> | 2007-01-05 19:39:39 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2007-01-05 19:39:39 +0000 |
commit | ddfd78c6ab7f8abee2c8feef195e3db2d573ceaf (patch) | |
tree | 7686b737e14d67a0c0e9f3bd9b44a705ad68562f | |
parent | 5e2fb1dcd218f4dab91a0beb3c5ce5fe7b89dd81 (diff) | |
download | external_python_setuptools-ddfd78c6ab7f8abee2c8feef195e3db2d573ceaf.tar.gz external_python_setuptools-ddfd78c6ab7f8abee2c8feef195e3db2d573ceaf.tar.bz2 external_python_setuptools-ddfd78c6ab7f8abee2c8feef195e3db2d573ceaf.zip |
Fix a problem installing eggs with a system packaging tool if the project
contained an implicit namespace package; for example if the ``setup()``
listed a namespace package ``foo.bar`` without explicitly listing
``foo`` as a namespace package. (backport from trunk)
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053271
-rwxr-xr-x | setuptools.txt | 5 | ||||
-rwxr-xr-x | setuptools/command/install_egg_info.py | 51 |
2 files changed, 51 insertions, 5 deletions
diff --git a/setuptools.txt b/setuptools.txt index 0997122a..9f6fed9e 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -2623,6 +2623,11 @@ Release Notes/Change History ``develop`` and the source directory is a subdirectory of the installation target directory. + * Fix a problem installing eggs with a system packaging tool if the project + contained an implicit namespace package; for example if the ``setup()`` + listed a namespace package ``foo.bar`` without explicitly listing ``foo`` + as a namespace package. + 0.6c3 * Fixed breakages caused by Subversion 1.4's new "working copy" format diff --git a/setuptools/command/install_egg_info.py b/setuptools/command/install_egg_info.py index 4c79f41b..8f972638 100755 --- a/setuptools/command/install_egg_info.py +++ b/setuptools/command/install_egg_info.py @@ -22,7 +22,7 @@ class install_egg_info(Command): None, None, ei_cmd.egg_name, ei_cmd.egg_version ).egg_name()+'.egg-info' self.source = ei_cmd.egg_info - self.target = os.path.join(self.install_dir, basename) + self.target = os.path.join(self.install_dir, basename) self.outputs = [self.target] def run(self): @@ -43,7 +43,7 @@ class install_egg_info(Command): return self.outputs def copytree(self): - # Copy the .egg-info tree to site-packages + # Copy the .egg-info tree to site-packages def skimmer(src,dst): # filter out source-control directories; note that 'src' is always # a '/'-separated path, regardless of platform. 'dst' is a @@ -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) @@ -78,5 +77,47 @@ class install_egg_info(Command): "(p not in mp) and mp.append(p)\n" % locals() ) - f.close() + 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |