summaryrefslogtreecommitdiff
path: root/pkg_resources.py
diff options
context:
space:
mode:
authortarek <none@none>2009-10-10 17:14:04 +0200
committertarek <none@none>2009-10-10 17:14:04 +0200
commitb76a5bf6c2386785eef7f3f3123878c22fba8145 (patch)
treec09716ade74c0cf9cbc941fc2853fd53f8185bcb /pkg_resources.py
parent4c9daf7b5983e6aecd04a35e51d1820b3702d4ba (diff)
downloadpython-setuptools-git-b76a5bf6c2386785eef7f3f3123878c22fba8145.tar.gz
the parse API needs to return distribute when setuptools is asked
--HG-- branch : distribute extra : rebase_source : 485e5999425fb57f1f0fce496ffc209a9bfe54e8
Diffstat (limited to 'pkg_resources.py')
-rw-r--r--pkg_resources.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index d0e840b8..20815ffe 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -2486,6 +2486,19 @@ 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: