aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/sdist.py
diff options
context:
space:
mode:
authorErik Bray <embray@stsci.edu>2012-02-13 16:22:33 -0500
committerErik Bray <embray@stsci.edu>2012-02-13 16:22:33 -0500
commitf6cb3d29d919ff6b9313b8a3281c66cfb368c29b (patch)
tree8e6132340081a38d057d05ff495da78c17559f85 /setuptools/command/sdist.py
parentf4a592c1240bbc3f0b1d0d08e261874857954225 (diff)
downloadexternal_python_setuptools-f6cb3d29d919ff6b9313b8a3281c66cfb368c29b.tar.gz
external_python_setuptools-f6cb3d29d919ff6b9313b8a3281c66cfb368c29b.tar.bz2
external_python_setuptools-f6cb3d29d919ff6b9313b8a3281c66cfb368c29b.zip
This allows the sdist command to ensure that any files listed in package_data are included in the dist, regardless of whether it's under version control, as is the case with distutil's sdist. Setting include_package_data=True disables this functionality.
--HG-- branch : distribute extra : rebase_source : 2cae1675c638dc12fd556368074c6b5c691c6f58
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-xsetuptools/command/sdist.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index c49839cd..484f8276 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -186,6 +186,14 @@ class sdist(_sdist):
if self.distribution.has_pure_modules():
build_py = self.get_finalized_command('build_py')
self.filelist.extend(build_py.get_source_files())
+ # This functionality is incompatible with include_package_data, and
+ # will in fact create an infinite recursion if include_package_data
+ # is True. Use of include_package_data will imply that
+ # distutils-style automatic handling of package_data is disabled
+ if not self.distribution.include_package_data:
+ for _, src_dir, _, filenames in build_py.data_files:
+ self.filelist.extend([os.path.join(src_dir, filename)
+ for filename in filenames])
if self.distribution.has_ext_modules():
build_ext = self.get_finalized_command('build_ext')