From 3536c85d4ef8a3e879a4c6e2ae87fff8c3bfec12 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Tue, 18 Jul 2006 16:55:23 +0000 Subject: Source distributions now always include a ``setup.cfg`` file that explicitly sets ``egg_info`` options such that they produce an identical version number to the source distribution's version number. (Previously, the default version number could be different due to the use of ``--tag-date``, or if the version was overridden on the command line that built the source distribution.) (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4050703 --- setuptools/command/sdist.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'setuptools/command/sdist.py') diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py index 0292efe2..4cc0ae1f 100755 --- a/setuptools/command/sdist.py +++ b/setuptools/command/sdist.py @@ -173,18 +173,18 @@ class sdist(_sdist): ) - - - - - - - - - - - - + def make_release_tree(self, base_dir, files): + _sdist.make_release_tree(self, base_dir, files) + + # Save any egg_info command line options used to create this sdist + dest = os.path.join(base_dir, 'setup.cfg') + if hasattr(os,'link') and os.path.exists(dest): + # unlink and re-copy, since it might be hard-linked, and + # we don't want to change the source version + os.unlink(dest) + self.copy_file('setup.cfg', dest) + + self.get_finalized_command('egg_info').save_version_info(dest) -- cgit v1.2.1