diff options
author | "W. Trevor King" <wking@tremily.us> | 2014-10-16 17:31:16 -0700 |
---|---|---|
committer | "W. Trevor King" <wking@tremily.us> | 2014-10-16 17:31:16 -0700 |
commit | 76906b7a50726de89307d55690338d0f40a5aadb (patch) | |
tree | f6ba2438562a1e9703cb18bf1739e54ff930c4da /setuptools/command | |
parent | 0c1303c12ba7e94eb0f6a7d961828d0ff08ff93a (diff) | |
download | external_python_setuptools-76906b7a50726de89307d55690338d0f40a5aadb.tar.gz external_python_setuptools-76906b7a50726de89307d55690338d0f40a5aadb.tar.bz2 external_python_setuptools-76906b7a50726de89307d55690338d0f40a5aadb.zip |
egg_info: Search egg-base for files to add to the manifest
Before this commit, this:
$ mkdir -p /tmp/xyz/{home,lib,scripts,data,egg}
$ cat >/tmp/xyz/home/.pydistutils.cfg <<EOF
> [egg_info]
> egg-base = /tmp/xyz/egg
> EOF
$ export PYTHONPATH=/tmp/xyz/lib
$ export HOME=/tmp/xyz/home
$ setup.py install --home=/tmp/xyz/home --install-lib=/tmp/xyz/lib \
> --install-scripts=/tmp/xyz/scripts --install-data=/tmp/xyz/data
drops a lot of metadata, installing only SOURCES.txt and zip-safe
under EGG-INFO. The problem is that the metadata files are written to
egg-base, but egg-base is not searched when creating the manifest
because it's outside of the current directory. Work around this by
explicitly searching egg-base with distutils.filelist.findall (which
is really the version monkeypatched in by setuptools/__init__.py).
Since findall records relative paths, prefix the returned paths with
egg-base, so the include_pattern looking for the absolute
ei_cmd.egg_info will match them.
Diffstat (limited to 'setuptools/command')
-rwxr-xr-x | setuptools/command/egg_info.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 43df87dc..2318e54d 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -6,6 +6,7 @@ from distutils.filelist import FileList as _FileList from distutils.util import convert_path from distutils import log import distutils.errors +import distutils.filelist import os import re import sys @@ -324,6 +325,10 @@ class manifest_maker(sdist): elif os.path.exists(self.manifest): self.read_manifest() ei_cmd = self.get_finalized_command('egg_info') + if ei_cmd.egg_base != os.curdir: + self.filelist.allfiles.extend([ + os.path.join(ei_cmd.egg_base, path) + for path in distutils.filelist.findall(ei_cmd.egg_base)]) self.filelist.include_pattern("*", prefix=ei_cmd.egg_info) def prune_file_list(self): |