Changeset 13707


Ignore:
Timestamp:
17 Feb 2016, 13:30:40 (9 years ago)
Author:
Henrik Bettermann
Message:

Use new bootstrap.py version. Use local grok versions file.

Location:
main/waeup.ikoba/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/bootstrap.py

    r12455 r13707  
    2626from optparse import OptionParser
    2727
    28 tmpeggs = tempfile.mkdtemp()
     28__version__ = '2015-07-01'
     29# See zc.buildout's changelog if this version is up to date.
     30
     31tmpeggs = tempfile.mkdtemp(prefix='bootstrap-')
    2932
    3033usage = '''\
     
    4144
    4245parser = OptionParser(usage=usage)
    43 parser.add_option("-v", "--version", help="use a specific zc.buildout version")
    44 
     46parser.add_option("--version",
     47                  action="store_true", default=False,
     48                  help=("Return bootstrap.py version."))
    4549parser.add_option("-t", "--accept-buildout-test-releases",
    4650                  dest='accept_buildout_test_releases',
     
    6064                  action="store_true", default=False,
    6165                  help=("Let bootstrap.py use existing site packages"))
     66parser.add_option("--buildout-version",
     67                  help="Use a specific zc.buildout version")
    6268parser.add_option("--setuptools-version",
    63                   help="use a specific setuptools version")
    64 
     69                  help="Use a specific setuptools version")
     70parser.add_option("--setuptools-to-dir",
     71                  help=("Allow for re-use of existing directory of "
     72                        "setuptools versions"))
    6573
    6674options, args = parser.parse_args()
     75if options.version:
     76    print("bootstrap.py version %s" % __version__)
     77    sys.exit(0)
     78
    6779
    6880######################################################################
     
    7082
    7183try:
    72     if options.allow_site_packages:
    73         import setuptools
    74         import pkg_resources
    7584    from urllib.request import urlopen
    7685except ImportError:
     
    7887
    7988ez = {}
    80 exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
     89if os.path.exists('ez_setup.py'):
     90    exec(open('ez_setup.py').read(), ez)
     91else:
     92    exec(urlopen('https://bootstrap.pypa.io/ez_setup.py').read(), ez)
    8193
    8294if not options.allow_site_packages:
     
    89101    if hasattr(site, 'getsitepackages'):
    90102        for sitepackage_path in site.getsitepackages():
    91             sys.path[:] = [x for x in sys.path if sitepackage_path not in x]
     103            # Strip all site-packages directories from sys.path that
     104            # are not sys.prefix; this is because on Windows
     105            # sys.prefix is a site-package directory.
     106            if sitepackage_path != sys.prefix:
     107                sys.path[:] = [x for x in sys.path
     108                               if sitepackage_path not in x]
    92109
    93110setup_args = dict(to_dir=tmpeggs, download_delay=0)
     
    95112if options.setuptools_version is not None:
    96113    setup_args['version'] = options.setuptools_version
     114if options.setuptools_to_dir is not None:
     115    setup_args['to_dir'] = options.setuptools_to_dir
    97116
    98117ez['use_setuptools'](**setup_args)
     
    111130ws = pkg_resources.working_set
    112131
     132setuptools_path = ws.find(
     133    pkg_resources.Requirement.parse('setuptools')).location
     134
     135# Fix sys.path here as easy_install.pth added before PYTHONPATH
    113136cmd = [sys.executable, '-c',
     137       'import sys; sys.path[0:0] = [%r]; ' % setuptools_path +
    114138       'from setuptools.command.easy_install import main; main()',
    115139       '-mZqNxd', tmpeggs]
     
    124148    cmd.extend(['-f', find_links])
    125149
    126 setuptools_path = ws.find(
    127     pkg_resources.Requirement.parse('setuptools')).location
    128 
    129150requirement = 'zc.buildout'
    130 version = options.version
     151version = options.buildout_version
    131152if version is None and not options.accept_buildout_test_releases:
    132153    # Figure out the most recent final version of zc.buildout.
     
    168189
    169190import subprocess
    170 if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
     191if subprocess.call(cmd) != 0:
    171192    raise Exception(
    172193        "Failed to execute command:\n%s" % repr(cmd)[1:-1])
  • main/waeup.ikoba/trunk/versions.cfg

    r12837 r13707  
    22[buildout]
    33# default set of versions we use.
    4 extends= http://grok.zope.org/releaseinfo/grok-1.1.cfg
     4#extends = http://grok.zope.org/releaseinfo/grok-1.1.cfg
     5extends = grok-1.1.cfg
    56
    67versions = versions
Note: See TracChangeset for help on using the changeset viewer.