diff options
author | PJ Eby <distutils-sig@python.org> | 2006-07-10 21:17:16 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-07-10 21:17:16 +0000 |
commit | ece23fd51b6eb14ea4a5853ad1a7f315d76ddcf5 (patch) | |
tree | 50d7c6997b9b40e1e216fafff3a2ee6f9d502868 | |
parent | ec2e4eaa16bd6a1ca4e9f142a82b5b29701dd6e3 (diff) | |
download | external_python_setuptools-ece23fd51b6eb14ea4a5853ad1a7f315d76ddcf5.tar.gz external_python_setuptools-ece23fd51b6eb14ea4a5853ad1a7f315d76ddcf5.tar.bz2 external_python_setuptools-ece23fd51b6eb14ea4a5853ad1a7f315d76ddcf5.zip |
Fixed redundant warnings about missing ``README`` file(s); it should now
appear only if you are actually a source distribution.
(backport from trunk)
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4050544
-rwxr-xr-x | setuptools.txt | 3 | ||||
-rwxr-xr-x | setuptools/command/egg_info.py | 6 | ||||
-rwxr-xr-x | setuptools/command/sdist.py | 45 |
3 files changed, 49 insertions, 5 deletions
diff --git a/setuptools.txt b/setuptools.txt index 3faec067..a2cce583 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -2570,6 +2570,9 @@ Release Notes/Change History * Added ``--no-date`` and ``--no-svn-revision`` options to ``egg_info`` command, to allow suppressing tags configured in ``setup.cfg``. + * Fixed redundant warnings about missing ``README`` file(s); it should now + appear only if you are actually a source distribution. + 0.6b3 * Fix ``bdist_egg`` not including files in subdirectories of ``.egg-info``. diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 8c2eb763..39b05866 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -281,9 +281,9 @@ class manifest_maker(sdist): self.execute(file_util.write_file, (self.manifest, files), "writing manifest file '%s'" % self.manifest) - - - + def warn(self, msg): # suppress missing-file warnings from sdist + if not msg.startswith("standard file not found:"): + sdist.warn(self, msg) def add_defaults(self): sdist.add_defaults(self) diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index 6026a7c2..0292efe2 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -142,9 +142,9 @@ class sdist(_sdist): ei_cmd = self.get_finalized_command('egg_info') self.filelist = ei_cmd.filelist self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt')) - + self.check_readme() self.check_metadata() - self.make_distribution() + self.make_distribution() dist_files = getattr(self.distribution,'dist_files',[]) for file in self.archive_files: @@ -162,3 +162,44 @@ class sdist(_sdist): sys.exc_info()[2].tb_next.tb_frame.f_locals['template'].close() raise + def check_readme(self): + alts = ("README", "README.txt") + for f in alts: + if os.path.exists(f): + return + else: + self.warn( + "standard file not found: should have one of " +', '.join(alts) + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# |