diff options
Diffstat (limited to 'distutils2/command/sdist.py')
| -rw-r--r-- | distutils2/command/sdist.py | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/distutils2/command/sdist.py b/distutils2/command/sdist.py index df8e07a..5aff9bd 100644 --- a/distutils2/command/sdist.py +++ b/distutils2/command/sdist.py @@ -18,7 +18,8 @@ except ImportError: from distutils2.command import get_command_names from distutils2.command.cmd import Command from distutils2.errors import (DistutilsPlatformError, DistutilsOptionError, - DistutilsTemplateError, DistutilsModuleError) + DistutilsTemplateError, DistutilsModuleError, + DistutilsFileError) from distutils2.manifest import Manifest from distutils2 import logger from distutils2.util import convert_path, resolve_name @@ -214,8 +215,6 @@ class sdist(Command): def add_defaults(self): """Add all the default files to self.filelist: - - README or README.txt - - 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. @@ -225,32 +224,6 @@ class sdist(Command): Warns if (README or README.txt) or setup.py are missing; everything else is optional. """ - standards = [('README', 'README.txt')] - for fn in standards: - if isinstance(fn, tuple): - alts = fn - got_it = 0 - for fn in alts: - if os.path.exists(fn): - got_it = 1 - self.filelist.append(fn) - break - - if not got_it: - self.warn("standard file not found: should have one of " + - string.join(alts, ', ')) - else: - if os.path.exists(fn): - self.filelist.append(fn) - else: - self.warn("standard file '%s' not found" % fn) - - optional = ['test/test*.py', 'setup.cfg'] - for pattern in optional: - files = filter(os.path.isfile, glob(pattern)) - if files: - self.filelist.extend(files) - for cmd_name in get_command_names(): try: cmd_obj = self.get_finalized_command(cmd_name) @@ -319,6 +292,12 @@ class sdist(Command): logger.warn("no files to distribute -- empty manifest?") else: logger.info(msg) + + for file in self.distribution.metadata.requires_files: + if file not in files: + msg = "'%s' must be included explicitly in 'extra_files'" % file + raise DistutilsFileError(msg) + for file in files: if not os.path.isfile(file): logger.warn("'%s' not a regular file -- skipping" % file) @@ -376,4 +355,3 @@ class sdist(Command): # Now create them for dir in need_dirs: self.mkpath(dir, mode, verbose=verbose, dry_run=dry_run) - |
