From f6cb3d29d919ff6b9313b8a3281c66cfb368c29b Mon Sep 17 00:00:00 2001 From: Erik Bray Date: Mon, 13 Feb 2012 16:22:33 -0500 Subject: 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 --- setuptools/command/sdist.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'setuptools/command') 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') -- cgit v1.2.1