Merge lp:~gary/launchpad/buildout1.5.0 into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Aaron Bentley
Approved revision: no longer in the source branch.
Merged at revision: 11419
Proposed branch: lp:~gary/launchpad/buildout1.5.0
Merge into: lp:launchpad
Diff against target: 212 lines (+79/-27)
2 files modified
bootstrap.py (+76/-24)
versions.cfg (+3/-3)
To merge this branch: bzr merge lp:~gary/launchpad/buildout1.5.0
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+33410@code.launchpad.net

Commit message

Use newest released versions of zc.buildout and friends

Description of the change

This branch moves to using a final release of zc.buildout, zc.recipe.egg, and z3c.recipe.scripts, each of which I released today.

The changes to the bootstrap script are merely copied over from the new zc.buildout's version: the file might be included from an external source if bzr had that feature.

The changes to the packages themselves were reviewed by flacoste over several branches.

Thanks

Gary

To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bootstrap.py'
--- bootstrap.py 2010-03-20 01:13:25 +0000
+++ bootstrap.py 2010-08-23 16:12:51 +0000
@@ -1,6 +1,6 @@
1##############################################################################1##############################################################################
2#2#
3# Copyright (c) 2006 Zope Corporation and Contributors.3# Copyright (c) 2006 Zope Foundation and Contributors.
4# All Rights Reserved.4# All Rights Reserved.
5#5#
6# This software is subject to the provisions of the Zope Public License,6# This software is subject to the provisions of the Zope Public License,
@@ -16,11 +16,9 @@
16Simply run this script in a directory containing a buildout.cfg.16Simply run this script in a directory containing a buildout.cfg.
17The script accepts buildout command-line options, so you can17The script accepts buildout command-line options, so you can
18use the -c option to specify an alternate configuration file.18use the -c option to specify an alternate configuration file.
19
20$Id$
21"""19"""
2220
23import os, shutil, sys, tempfile, textwrap, urllib, urllib221import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess
24from optparse import OptionParser22from optparse import OptionParser
2523
26if sys.platform == 'win32':24if sys.platform == 'win32':
@@ -32,11 +30,23 @@
32else:30else:
33 quote = str31 quote = str
3432
33# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
34stdout, stderr = subprocess.Popen(
35 [sys.executable, '-Sc',
36 'try:\n'
37 ' import ConfigParser\n'
38 'except ImportError:\n'
39 ' print 1\n'
40 'else:\n'
41 ' print 0\n'],
42 stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
43has_broken_dash_S = bool(int(stdout.strip()))
44
35# In order to be more robust in the face of system Pythons, we want to45# In order to be more robust in the face of system Pythons, we want to
36# run without site-packages loaded. This is somewhat tricky, in46# run without site-packages loaded. This is somewhat tricky, in
37# particular because Python 2.6's distutils imports site, so starting47# particular because Python 2.6's distutils imports site, so starting
38# with the -S flag is not sufficient. However, we'll start with that:48# with the -S flag is not sufficient. However, we'll start with that:
39if 'site' in sys.modules:49if not has_broken_dash_S and 'site' in sys.modules:
40 # We will restart with python -S.50 # We will restart with python -S.
41 args = sys.argv[:]51 args = sys.argv[:]
42 args[0:0] = [sys.executable, '-S']52 args[0:0] = [sys.executable, '-S']
@@ -109,13 +119,22 @@
109 help=("Specify a directory for storing eggs. Defaults to "119 help=("Specify a directory for storing eggs. Defaults to "
110 "a temporary directory that is deleted when the "120 "a temporary directory that is deleted when the "
111 "bootstrap script completes."))121 "bootstrap script completes."))
122parser.add_option("-t", "--accept-buildout-test-releases",
123 dest='accept_buildout_test_releases',
124 action="store_true", default=False,
125 help=("Normally, if you do not specify a --version, the "
126 "bootstrap script and buildout gets the newest "
127 "*final* versions of zc.buildout and its recipes and "
128 "extensions for you. If you use this flag, "
129 "bootstrap and buildout will get the newest releases "
130 "even if they are alphas or betas."))
112parser.add_option("-c", None, action="store", dest="config_file",131parser.add_option("-c", None, action="store", dest="config_file",
113 help=("Specify the path to the buildout configuration "132 help=("Specify the path to the buildout configuration "
114 "file to be used."))133 "file to be used."))
115134
116options, args = parser.parse_args()135options, args = parser.parse_args()
117136
118# if -c was provided, we push it back into args for buildout' main function137# if -c was provided, we push it back into args for buildout's main function
119if options.config_file is not None:138if options.config_file is not None:
120 args += ['-c', options.config_file]139 args += ['-c', options.config_file]
121140
@@ -130,16 +149,15 @@
130 else:149 else:
131 options.setup_source = setuptools_source150 options.setup_source = setuptools_source
132151
133args = args + ['bootstrap']152if options.accept_buildout_test_releases:
134153 args.append('buildout:accept-buildout-test-releases=true')
154args.append('bootstrap')
135155
136try:156try:
137 to_reload = False
138 import pkg_resources157 import pkg_resources
139 to_reload = True158 import setuptools # A flag. Sometimes pkg_resources is installed alone.
140 if not hasattr(pkg_resources, '_distribute'):159 if not hasattr(pkg_resources, '_distribute'):
141 raise ImportError160 raise ImportError
142 import setuptools # A flag. Sometimes pkg_resources is installed alone.
143except ImportError:161except ImportError:
144 ez_code = urllib2.urlopen(162 ez_code = urllib2.urlopen(
145 options.setup_source).read().replace('\r\n', '\n')163 options.setup_source).read().replace('\r\n', '\n')
@@ -151,10 +169,8 @@
151 if options.use_distribute:169 if options.use_distribute:
152 setup_args['no_fake'] = True170 setup_args['no_fake'] = True
153 ez['use_setuptools'](**setup_args)171 ez['use_setuptools'](**setup_args)
154 if to_reload:172 reload(sys.modules['pkg_resources'])
155 reload(pkg_resources)173 import pkg_resources
156 else:
157 import pkg_resources
158 # This does not (always?) update the default working set. We will174 # This does not (always?) update the default working set. We will
159 # do it.175 # do it.
160 for path in sys.path:176 for path in sys.path:
@@ -167,23 +183,59 @@
167 '-mqNxd',183 '-mqNxd',
168 quote(eggs_dir)]184 quote(eggs_dir)]
169185
170if options.download_base:186if not has_broken_dash_S:
171 cmd.extend(['-f', quote(options.download_base)])187 cmd.insert(1, '-S')
172188
173requirement = 'zc.buildout'189find_links = options.download_base
174if options.version:190if not find_links:
175 requirement = '=='.join((requirement, options.version))191 find_links = os.environ.get('bootstrap-testing-find-links')
176cmd.append(requirement)192if find_links:
193 cmd.extend(['-f', quote(find_links)])
177194
178if options.use_distribute:195if options.use_distribute:
179 setup_requirement = 'distribute'196 setup_requirement = 'distribute'
180else:197else:
181 setup_requirement = 'setuptools'198 setup_requirement = 'setuptools'
182ws = pkg_resources.working_set199ws = pkg_resources.working_set
200setup_requirement_path = ws.find(
201 pkg_resources.Requirement.parse(setup_requirement)).location
183env = dict(202env = dict(
184 os.environ,203 os.environ,
185 PYTHONPATH=ws.find(204 PYTHONPATH=setup_requirement_path)
186 pkg_resources.Requirement.parse(setup_requirement)).location)205
206requirement = 'zc.buildout'
207version = options.version
208if version is None and not options.accept_buildout_test_releases:
209 # Figure out the most recent final version of zc.buildout.
210 import setuptools.package_index
211 _final_parts = '*final-', '*final'
212 def _final_version(parsed_version):
213 for part in parsed_version:
214 if (part[:1] == '*') and (part not in _final_parts):
215 return False
216 return True
217 index = setuptools.package_index.PackageIndex(
218 search_path=[setup_requirement_path])
219 if find_links:
220 index.add_find_links((find_links,))
221 req = pkg_resources.Requirement.parse(requirement)
222 if index.obtain(req) is not None:
223 best = []
224 bestv = None
225 for dist in index[req.project_name]:
226 distv = dist.parsed_version
227 if _final_version(distv):
228 if bestv is None or distv > bestv:
229 best = [dist]
230 bestv = distv
231 elif distv == bestv:
232 best.append(dist)
233 if best:
234 best.sort()
235 version = best[-1].version
236if version:
237 requirement = '=='.join((requirement, version))
238cmd.append(requirement)
187239
188if is_jython:240if is_jython:
189 import subprocess241 import subprocess
@@ -193,7 +245,7 @@
193if exitcode != 0:245if exitcode != 0:
194 sys.stdout.flush()246 sys.stdout.flush()
195 sys.stderr.flush()247 sys.stderr.flush()
196 print ("An error occured when trying to install zc.buildout. "248 print ("An error occurred when trying to install zc.buildout. "
197 "Look above this message for any errors that "249 "Look above this message for any errors that "
198 "were output by easy_install.")250 "were output by easy_install.")
199 sys.exit(exitcode)251 sys.exit(exitcode)
200252
=== modified file 'versions.cfg'
--- versions.cfg 2010-08-18 19:41:20 +0000
+++ versions.cfg 2010-08-23 16:12:51 +0000
@@ -101,7 +101,7 @@
101z3c.ptcompat = 0.5.3101z3c.ptcompat = 0.5.3
102z3c.recipe.filetemplate = 2.1.0102z3c.recipe.filetemplate = 2.1.0
103z3c.recipe.i18n = 0.5.3103z3c.recipe.i18n = 0.5.3
104z3c.recipe.scripts = 1.0.0dev-gary-r110068104z3c.recipe.scripts = 1.0.0
105z3c.recipe.tag = 0.2.0105z3c.recipe.tag = 0.2.0
106z3c.rml = 0.7.3106z3c.rml = 0.7.3
107z3c.skin.pagelet = 1.0.2107z3c.skin.pagelet = 1.0.2
@@ -111,12 +111,12 @@
111z3c.viewlet = 1.0.0111z3c.viewlet = 1.0.0
112z3c.viewtemplate = 0.3.2112z3c.viewtemplate = 0.3.2
113z3c.zrtresource = 1.0.1113z3c.zrtresource = 1.0.1
114zc.buildout = 1.5.0dev-gary-r111190114zc.buildout = 1.5.0
115zc.catalog = 1.2.0115zc.catalog = 1.2.0
116zc.datetimewidget = 0.5.2116zc.datetimewidget = 0.5.2
117zc.i18n = 0.5.2117zc.i18n = 0.5.2
118zc.lockfile = 1.0.0118zc.lockfile = 1.0.0
119zc.recipe.egg = 1.2.3dev-gary-r110068119zc.recipe.egg = 1.3.0
120zc.zservertracelog = 1.1.5120zc.zservertracelog = 1.1.5
121ZConfig = 2.7.1121ZConfig = 2.7.1
122zdaemon = 2.0.4122zdaemon = 2.0.4