diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-02-16 21:49:12 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-02-16 21:49:12 (GMT) |
commit | 0d0506ecef273135cf5c13ad5be2ad6448a155eb (patch) | |
tree | 122c0fd75c413ac96bc90b82b5ebcc0e2571fe77 /Lib/distutils/command/sdist.py | |
parent | 25e26a02f4bd5500cf29e3b298ddc2447e07abd1 (diff) | |
download | cpython-0d0506ecef273135cf5c13ad5be2ad6448a155eb.zip cpython-0d0506ecef273135cf5c13ad5be2ad6448a155eb.tar.gz cpython-0d0506ecef273135cf5c13ad5be2ad6448a155eb.tar.bz2 |
Merged revisions 69692 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r69692 | tarek.ziade | 2009-02-16 22:38:01 +0100 (Mon, 16 Feb 2009) | 1 line
Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files
........
Diffstat (limited to 'Lib/distutils/command/sdist.py')
-rw-r--r-- | Lib/distutils/command/sdist.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index 054fe19..c057b66 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -252,6 +252,9 @@ class sdist (Command): - setup.py - test/test*.py - all pure Python modules mentioned in setup script + - all files pointed by package_data (build_py) + - all files defined in data_files. + - all files defined as scripts. - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setup.py are missing; everything @@ -283,10 +286,27 @@ class sdist (Command): if files: self.filelist.extend(files) + # build_py is used to get: + # - python modules + # - files defined in package_data + build_py = self.get_finalized_command('build_py') + + # getting python files if self.distribution.has_pure_modules(): - build_py = self.get_finalized_command('build_py') self.filelist.extend(build_py.get_source_files()) + # getting package_data files + # (computed in build_py.data_files by build_py.finalize_options) + for pkg, src_dir, build_dir, filenames in build_py.data_files: + for filename in filenames: + self.filelist.append(os.path.join(src_dir, filename)) + + # getting distribution.data_files + if self.distribution.has_data_files(): + for dirname, filenames in self.distribution.data_files: + for filename in filenames: + self.filelist.append(os.path.join(dirname, filename)) + if self.distribution.has_ext_modules(): build_ext = self.get_finalized_command('build_ext') self.filelist.extend(build_ext.get_source_files()) |