From 20d438c6da53b55dc6d7a1b80020a00443128912 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Fri, 19 Jul 2013 14:11:09 +0200 Subject: [PATCH] Updated bootstrap for compatibility with setuptools --- bootstrap.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bootstrap.py b/bootstrap.py index 1b28969..2ec152f 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 -- GitLab