Commit 6045d157 authored by tarek's avatar tarek

using project_name instead so we don't bother with the version

--HG--
branch : distribute
extra : rebase_source : c878e223405487eb8b58c69ba7d0b62b02c7d4cd
parent 0c164785
......@@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete
[console_scripts]
easy_install = setuptools.command.easy_install:main
easy_install-3.1 = setuptools.command.easy_install:main
easy_install-2.6 = setuptools.command.easy_install:main
[setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl
......
......@@ -504,10 +504,7 @@ class WorkingSet(object):
while requirements:
req = requirements.pop(0) # process dependencies breadth-first
project_name = req.project_name.strip()
project_name = project_name.replace(' ', '')
if project_name in ('setuptools', 'setuptools>=0.6c9',
'setuptools==0.6c9'):
if req.project_name == 'setuptools':
req = Requirement.parse('distribute')
if req in processed:
......@@ -2492,23 +2489,18 @@ class Requirement:
#@staticmethod
def parse(s):
# if asked for setuptools distribution
# and if distribute is installed, we want to give
# distribute instead
stripped_s = s.replace(' ', '')
stripped_s = stripped_s.strip()
if stripped_s in ('setuptools', 'setuptools==0.6c9',
'setuptools>0.6c9', 'setuptools>=0.6c9'):
reqs = list(parse_requirements('distribute'))
if reqs:
if len(reqs)==1:
# ok we can replace the requirement
return reqs[0]
reqs = list(parse_requirements(s))
if reqs:
if len(reqs)==1:
return reqs[0]
if len(reqs) == 1:
founded_req = reqs[0]
# if asked for setuptools distribution
# and if distribute is installed, we want to give
# distribute instead
if founded_req.project_name == 'setuptools':
try:
return self.parse('distribute')
except ValueError:
return founded_req
raise ValueError("Expected only one requirement", s)
raise ValueError("No requirements found", s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment