diff --git a/bootstrap.py b/bootstrap.py index 1b28969ae92a8927167c03a61f2450dd69498eb2..2ec152f662355e3288f20f1a80afcdd710cfdea5 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -35,7 +35,7 @@ Bootstraps a buildout-based project. Simply run this script in a directory containing a buildout.cfg, using the Python that you want bin/buildout to use. -Note that by using --find-links to point to local resources, you can keep +Note that by using --find-links to point to local resources, you can keep this script from going over the network. ''' @@ -90,6 +90,19 @@ except ImportError: if path not in pkg_resources.working_set.entries: pkg_resources.working_set.add_entry(path) +###################################################################### +# Try to best guess the version of buildout given setuptools +if options.version is None: + + try: + from distutils.version import LooseVersion + package = pkg_resources.require('setuptools')[0] + v = LooseVersion(package.version) + if v < LooseVersion('0.7'): + options.version = '2.1.1' + except: + pass + ###################################################################### # Install buildout