From 56fcb8fdcc377acf0d74430a3d2d4dbffe306d44 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 8 Jul 2005 04:45:58 +0000 Subject: The "egg_info" command now always sets the distribution metadata to "safe" forms of the distribution name and version, so that distribution files will be generated with parseable names (i.e., ones that don't include '-' in the name or version). Also, this means that if you use the various ``--tag`` options of "egg_info", any distributions generated will use the tags in the version, not just egg distributions. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041092 --- setuptools/command/egg_info.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'setuptools/command/egg_info.py') diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 0223becb..6fffbe24 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -60,13 +60,13 @@ class egg_info(Command): self.ensure_dirname('egg_base') self.egg_info = os.path.join(self.egg_base, self.egg_name+'.egg-info') - - - - - - - + # Set package version and name for the benefit of dumber commands + # (e.g. sdist, bdist_wininst, etc.) We escape '-' so filenames will + # be more machine-parseable. + # + metadata = self.distribution.metadata + metadata.version = self.egg_version.replace('-','_') + metadata.name = self.egg_name.replace('-','_') @@ -90,6 +90,8 @@ class egg_info(Command): metadata.version, oldver = self.egg_version, metadata.version metadata.name, oldname = self.egg_name, metadata.name try: + # write unescaped data to PKG-INFO, so older pkg_resources + # can still parse it metadata.write_pkg_info(self.egg_info) finally: metadata.name, metadata.version = oldname, oldver @@ -119,8 +121,6 @@ class egg_info(Command): f.close() - - def tagged_version(self): version = self.distribution.get_version() if self.tag_build: -- cgit v1.2.1