diff options
author | PJ Eby <distutils-sig@python.org> | 2005-11-05 05:50:26 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-11-05 05:50:26 +0000 |
commit | f9aa7e9e50d68830954facf280a02b551357c524 (patch) | |
tree | ee1534b42d6da702eb469949c07647af5ae01582 /setuptools/command/egg_info.py | |
parent | 8312542db5a016d80d7e35951fc7991bace1368c (diff) | |
download | external_python_setuptools-f9aa7e9e50d68830954facf280a02b551357c524.tar.gz external_python_setuptools-f9aa7e9e50d68830954facf280a02b551357c524.tar.bz2 external_python_setuptools-f9aa7e9e50d68830954facf280a02b551357c524.zip |
Fixed some problems with fresh checkouts of projects that don't include
``.egg-info/PKG-INFO`` under revision control and put the project's source
code directly in the project directory. If such a package had any
requirements that get processed before the ``egg_info`` command can be run,
the setup scripts would fail with a "Missing 'Version:' header and/or
PKG-INFO file" error, because the egg runtime interpreted the unbuilt
metadata in a directory on ``sys.path`` (i.e. the current directory) as
being a corrupted egg. Setuptools now monkeypatches the distribution
metadata cache to pretend that the egg has valid version information, until
it has a chance to make it actually be so (via the ``egg_info`` command).
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041401
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-x | setuptools/command/egg_info.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index c5a404e9..198f9635 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -7,7 +7,7 @@ import os, re from setuptools import Command from distutils.errors import * from distutils import log -from pkg_resources import parse_requirements, safe_name, \ +from pkg_resources import parse_requirements, safe_name, parse_version, \ safe_version, yield_lines, EntryPoint, iter_entry_points class egg_info(Command): @@ -65,16 +65,16 @@ class egg_info(Command): # self.distribution.metadata.version = self.egg_version - - - - - - - - - - + # If we bootstrapped around the lack of a PKG-INFO, as might be the + # case in a fresh checkout, make sure that any special tags get added + # to the version info + # + pd = self.distribution._patched_dist + if pd is not None and pd.key==self.egg_name.lower(): + pd._version = self.egg_version + pd._parsed_version = parse_version(self.egg_version) + self.distribution._patched_dist = None + |