~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to bootstrap.py

  • Committer: Gary Poster
  • Date: 2009-07-16 23:37:49 UTC
  • mto: This revision was merged to the branch mainline in revision 8941.
  • Revision ID: gary.poster@canonical.com-20090716233749-o4yjyf675bbp7xy4
handle a couple more site-packages issues; one if pkg_resources is around but setuptools is not; and the other to make developing an egg have the same sys.path as bin/buildout

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
The script accepts buildout command-line options, so you can
18
18
use the -c option to specify an alternate configuration file.
19
19
 
20
 
$Id: bootstrap.py 101879 2009-07-14 01:24:48Z gary $
 
20
$Id: bootstrap.py 101930 2009-07-15 18:34:35Z gary $
21
21
"""
22
22
 
23
23
import os, re, shutil, sys, tempfile, textwrap, urllib, urllib2
107
107
    requirement += '==' + configuration['--version']
108
108
 
109
109
try:
 
110
    import setuptools # A flag.  Sometimes pkg_resources is installed alone.
110
111
    import pkg_resources
111
112
except ImportError:
112
113
    ez = {}
115
116
    if configuration['--download-base']:
116
117
        setuptools_args['download_base'] = configuration['--download-base']
117
118
    ez['use_setuptools'](**setuptools_args)
118
 
 
119
119
    import pkg_resources
 
120
    # This does not (always?) update the default working set.  We will
 
121
    # do it.
 
122
    for path in sys.path:
 
123
        if path not in pkg_resources.working_set.entries:
 
124
            pkg_resources.working_set.add_entry(path)
120
125
 
121
126
if sys.platform == 'win32':
122
127
    def quote(c):