Merge lp:~gary/zc.buildout/betafix6 into lp:zc.buildout

Proposed by Gary Poster
Status: Needs review
Proposed branch: lp:~gary/zc.buildout/betafix6
Merge into: lp:zc.buildout
Prerequisite: lp:~gary/zc.buildout/betafix5
Diff against target: 979 lines (+465/-123)
7 files modified
CHANGES.txt (+37/-4)
src/zc/buildout/bootstrap.txt (+103/-24)
src/zc/buildout/buildout.py (+60/-55)
src/zc/buildout/buildout.txt (+24/-12)
src/zc/buildout/easy_install.py (+20/-15)
src/zc/buildout/tests.py (+183/-11)
src/zc/buildout/update.txt (+38/-2)
To merge this branch: bzr merge lp:~gary/zc.buildout/betafix6
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) code Approve
Review via email: mp+31996@code.launchpad.net

Description of the change

By default, Buildout and the bootstrap script now prefer final versions of Buildout, recipes, and extensions. This was done to try and prevent problems such as those that happened the last time I tried to make a zc.buildout release. See the CHANGES file updates (which also include some notes I should have included in an earlier revision) for how it works; also not that betafix7 has a help document for users, so if you think the mechanism is fine but you want the users to have some better docs, please look at that branch. The logic for figuring out final versions in bootstrap was ripped from easy_install. The bootstrap test had to do some new tricks to exercise the changes. These new tricks revealed that, once the new version of zc.buildout was released, the bootstrap test would have failed. I believe this is now fixed as a side effect of the main effort.

I factored out some bool parsing behavior into a method on the Options object, because I was adding yet another bool and wanted to not copy and paste the code again. Note that I change the behavior of get_bool in betafix7, so it might be better to comment on its approach on that branch.

To post a comment you must log in.
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Hi Gary,

I don't understand the need for both an option to bootstrap and one for
buildout. What happen if we only use the bootstrap.py option?

Is it that buildout/setuptools will upgrade itself whenever the buildout is
used? Or only the recipes? I think some clarifications of why one would use
the various options is needed to make this clearer.

Otherwise, everything looks good.

review: Needs Information (code)
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

OK, after discussion on IRC it does seem that this limitation is what is best acceptable trade-off. There is already duplication of options already (download-cache, eggs) etc.

If it's easy to detect that buildout would be downgraded (boostrap used --accept, but the option is missing in buildout), then I'd suggest adding an error asking the user to either rerun bootstrap without the option or change the buildout.cfg variable.

Otherwise (or in addition) change the documentation of the option to make it clear that one should set the buildout.cfg option when using the bootstrap option otherwise things will get confused.

review: Approve (code)
lp:~gary/zc.buildout/betafix6 updated
564. By Gary Poster

clarify that --accept-early-release must be accompanied with prefer-final-build-system= false.

Revision history for this message
Gary Poster (gary) wrote :

Hey Francis. What do you think of this approach to addressing your concerns?

http://pastebin.ubuntu.com/479699/

Essentially, you only have to use --accept-early-release when calling the bootstrap. This flag is remembered thanks to code scribbled in the buildout script. When you rerun bootstrap without that argument it goes back to the usual behavior.

This is much nicer usability, at the expense of a somewhat odd pattern; however, I think it is defensible since what we are trying to control extends from bootstrapping through normal use.

If you think this is reasonable, I'll need to update CHANGES and make sure the rest of the tests still pass.

Revision history for this message
Francis J. Lacoste (flacoste) wrote :

I like that!

Revision history for this message
Gary Poster (gary) wrote :

Cool. The patch got on the big side (526 lines) so I made it into another branch based on betafix7: https://code.edge.launchpad.net/~gary/zc.buildout/betafix8/+merge/33077 .

Unmerged revisions

564. By Gary Poster

clarify that --accept-early-release must be accompanied with prefer-final-build-system= false.

563. By Gary Poster

merge from trunk/previous branches

562. By Gary Poster

By default, Buildout and the bootstrap script now prefer final versions of Buildout, recipes, and extensions.

561. By Gary Poster

get tests passing for Python 2.7. Also includes Lennart Regebro changes to use the standard library doctest.

560. By Gary Poster

small Python 2.6 bugfix and Distribute test clean-ups

559. By Gary Poster

fix tests for changes

558. By Gary Poster

mimic standard site.py behavior for inclusion of .pth files

557. By Gary Poster

eliminate spurious warning if you are using distribute.

556. By Gary Poster

add files so releases can be made from a non-SVN checkout

555. By Gary Poster

fix virtualenv interaction by identfying broken virtualenv characteristic and reverting to previous behavior in that case.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2010-08-07 00:12:52 +0000
+++ CHANGES.txt 2010-08-07 00:12:52 +0000
@@ -1,19 +1,52 @@
1Change History1Change History
2**************2**************
33
41.5.0b3 (unreleased)
5====================
6
7New features:
8
9- zc.buildout supports Python 2.7.
10
11- By default, Buildout and the bootstrap script now prefer final versions of
12 Buildout, recipes, and extensions. This can be changed by setting
13 ``prefer-final-build-system = false`` in your configuration's
14 [buildout] section, and by using the --accept-early-release flag when
15 calling bootstrap. This will hopefully allow beta releases to be more
16 easily and safely made in the future. Note that dependencies of your
17 software do not have this behavior: use the pre-existing switch
18 ``prefer-final = true`` to get this behavior.
19
20Bugs fixed:
21
22- You can now again use virtualenv with zc.buildout. The new features to let
23 buildout be used with a system Python are disabled in this configuration,
24 and the previous script generation behavior (1.4.3) is used, even if
25 the new function ``zc.buildout.easy_install.sitepackage_safe_scripts``
26 is used.
27
281.5.0b2 (2010-04-29)
29====================
30
31This was a re-release of 1.4.3 in order to keep 1.5.0b1 release from hurting
32workflows that combined virtualenv with zc.buildout.
33
41.5.0b1 (2010-04-29)341.5.0b1 (2010-04-29)
5====================35====================
636
7New Features:37New Features:
838
9- zc.buildout supports Python 2.7.
10
11- Added buildout:socket-timout option so that socket timeout can be configured39- Added buildout:socket-timout option so that socket timeout can be configured
12 both from command line and from config files. (gotcha)40 both from command line and from config files. (gotcha)
1341
14- Buildout can be safely used with a system Python (or any Python with code42- Buildout can be safely used with a system Python (or any Python with code
15 in site-packages), as long as you use the new z3c.recipe.scripts43 in site-packages), as long as you use (1) A fresh checkout, (2) the
16 recipe to generate scripts and interpreters, rather than zc.recipe.egg.44 new bootstrap.py, and (3) recipes that use the new
45 ``zc.buildout.easy_install.sitepackage_safe_scripts`` function to generate
46 scripts and interpreters. Many recipes will need to be updated to use
47 this new function. The scripts and interpreters generated by
48 ``zc.recipe.egg`` will continue to use the older function, not safe
49 with system Pythons. Use the ``z3c.recipe.scripts`` as a replacement.
1750
18 zc.recipe.egg is still a fully supported, and simpler, way of51 zc.recipe.egg is still a fully supported, and simpler, way of
19 generating scripts and interpreters if you are using a "clean" Python,52 generating scripts and interpreters if you are using a "clean" Python,
2053
=== modified file 'src/zc/buildout/bootstrap.txt'
--- src/zc/buildout/bootstrap.txt 2010-08-07 00:12:52 +0000
+++ src/zc/buildout/bootstrap.txt 2010-08-07 00:12:52 +0000
@@ -47,6 +47,87 @@
47 X...47 X...
48 d zc.buildout-...egg48 d zc.buildout-...egg
4949
50The buildout script it has generated is a new-style script, using a
51customized site.py.
52
53 >>> buildout_script = join(sample_buildout, 'bin', 'buildout')
54 >>> if sys.platform.startswith('win'):
55 ... buildout_script += '-script.py'
56 >>> print open(buildout_script).read() # doctest: +ELLIPSIS
57 #...
58 <BLANKLINE>
59 import sys
60 sys.path[0:0] = [
61 '/sample/parts/buildout',
62 ]
63 <BLANKLINE>
64 <BLANKLINE>
65 import os
66 path = sys.path[0]
67 if os.environ.get('PYTHONPATH'):
68 path = os.pathsep.join([path, os.environ['PYTHONPATH']])
69 os.environ['PYTHONPATH'] = path
70 import site # imports custom buildout-generated site.py
71 <BLANKLINE>
72 import zc.buildout.buildout
73 <BLANKLINE>
74 if __name__ == '__main__':
75 zc.buildout.buildout.main()
76 <BLANKLINE>
77
78The bootstrap process prefers final versions of zc.buildout, so it has
79selected the (generated-locally) 99.99 egg rather than the also-available
80100.0b1 egg. We can see that in the buildout script's site.py.
81
82 >>> buildout_site_py = join(
83 ... sample_buildout, 'parts', 'buildout', 'site.py')
84 >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS
85 "...
86 buildout_paths = [
87 '/sample/eggs/setuptools-...egg',
88 '/sample/eggs/zc.buildout-99.99-pyN.N.egg'
89 ]
90 ...
91
92If you want to accept early releases of zc.buildout, you either need to
93specify an explicit version (using --version here and specifying the
94version in the buildout configuration file using the
95``buildout-version`` option or the ``versions`` option) or specify that you
96accept early releases.
97
98You accept early releases by using ``--accept-early-release`` on the
99bootstrap script and specifying ``prefer-final-build-system = false`` in the
100buildout configuration file. You must do both.
101
102Here's an example.
103
104 >>> write('buildout.cfg',
105 ... '''
106 ... [buildout]
107 ... parts =
108 ... prefer-final-build-system = false
109 ... ''')
110 >>> ignored = system(
111 ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+
112 ... 'bootstrap.py --accept-early-release')
113 >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS
114 "...
115 buildout_paths = [
116 '/sample/eggs/setuptools-...egg',
117 '/sample/eggs/zc.buildout-100.0b1-pyN.N.egg'
118 ]
119 ...
120
121Notice we are now using zc.buildout 100.0b1, a non-final release.
122
123Now we'll go back to the default of preferring final versions.
124
125 >>> write('buildout.cfg',
126 ... '''
127 ... [buildout]
128 ... parts =
129 ... ''')
130
50Now we will try the `--version` option, which lets you define a version for131Now we will try the `--version` option, which lets you define a version for
51`zc.buildout`. If not provided, bootstrap will look for the latest one.132`zc.buildout`. If not provided, bootstrap will look for the latest one.
52133
@@ -71,11 +152,9 @@
71 <BLANKLINE>152 <BLANKLINE>
72 X153 X
73154
74Let's make sure the generated `buildout` script uses it::155Versions older than 1.5.0 put their egg dependencies in the ``buildout`` script.
156Let's make sure it was generated as we expect::
75157
76 >>> buildout_script = join(sample_buildout, 'bin', 'buildout')
77 >>> if sys.platform.startswith('win'):
78 ... buildout_script += '-script.py'
79 >>> print open(buildout_script).read() # doctest: +ELLIPSIS158 >>> print open(buildout_script).read() # doctest: +ELLIPSIS
80 #...159 #...
81 <BLANKLINE>160 <BLANKLINE>
@@ -102,7 +181,7 @@
102 <BLANKLINE>181 <BLANKLINE>
103 X182 X
104183
105Let's make sure the generated `buildout` script uses it::184Let's make sure the generated ``buildout`` script uses it::
106185
107 >>> print open(buildout_script).read() # doctest: +ELLIPSIS186 >>> print open(buildout_script).read() # doctest: +ELLIPSIS
108 #...187 #...
@@ -119,7 +198,7 @@
119 zc.buildout.buildout.main()198 zc.buildout.buildout.main()
120 <BLANKLINE>199 <BLANKLINE>
121200
122`zc.buildout` now can also run with `Distribute` with the `--distribute`201``zc.buildout`` now can also run with `Distribute` with the `--distribute`
123option::202option::
124203
125 >>> print 'X'; print system(204 >>> print 'X'; print system(
@@ -131,22 +210,14 @@
131 Generated script '/sample/bin/buildout'...210 Generated script '/sample/bin/buildout'...
132 X211 X
133212
134Let's make sure the generated `buildout` script uses it::213Let's make sure the generated ``site.py`` uses it::
135214 >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS
136 >>> print open(buildout_script).read() # doctest: +ELLIPSIS215 "...
137 #...216 buildout_paths = [
138 <BLANKLINE>217 '/sample/eggs/distribute-...egg',
139 import sys218 '/sample/eggs/zc.buildout-99.99-pyN.N.egg'
140 sys.path[0:0] = [219 ]
141 '/sample/eggs/distribute-...egg',220 ...
142 '/sample/eggs/zc.buildout-...egg',
143 ]
144 <BLANKLINE>
145 import zc.buildout.buildout
146 <BLANKLINE>
147 if __name__ == '__main__':
148 zc.buildout.buildout.main()
149 <BLANKLINE>
150221
151Make sure both options can be used together::222Make sure both options can be used together::
152223
@@ -160,8 +231,8 @@
160 Generated script '/sample/bin/buildout'...231 Generated script '/sample/bin/buildout'...
161 X232 X
162233
163Let's make sure the generated `buildout` script uses ``Distribute`` *and*234Let's make sure the old-style generated ``buildout`` script uses
164``zc.buildout-1.2.1``::235``Distribute`` *and* ``zc.buildout-1.2.1``::
165236
166 >>> print open(buildout_script).read() # doctest: +ELLIPSIS237 >>> print open(buildout_script).read() # doctest: +ELLIPSIS
167 #...238 #...
@@ -258,5 +329,13 @@
258 --eggs=EGGS Specify a directory for storing eggs. Defaults to a329 --eggs=EGGS Specify a directory for storing eggs. Defaults to a
259 temporary directory that is deleted when the bootstrap330 temporary directory that is deleted when the bootstrap
260 script completes.331 script completes.
332 --accept-early-release
333 Normally, if you do not specify a --version, the
334 bootstrap script gets the newest *final* versions of
335 zc.buildout for you. If you use this flag, and also
336 set ``prefer-final-build-system= false`` in the
337 [buildout] section of your configuration file,
338 bootstrap will get the newest releases even if they
339 are alphas or betas.
261 -c CONFIG_FILE Specify the path to the buildout configuration file to340 -c CONFIG_FILE Specify the path to the buildout configuration file to
262 be used.341 be used.
263342
=== modified file 'src/zc/buildout/buildout.py'
--- src/zc/buildout/buildout.py 2010-08-07 00:12:52 +0000
+++ src/zc/buildout/buildout.py 2010-08-07 00:12:52 +0000
@@ -131,6 +131,7 @@
131 'offline': 'false',131 'offline': 'false',
132 'parts-directory': 'parts',132 'parts-directory': 'parts',
133 'prefer-final': 'false',133 'prefer-final': 'false',
134 'prefer-final-build-system': 'true',
134 'python': 'buildout',135 'python': 'buildout',
135 'relative-paths': 'false',136 'relative-paths': 'false',
136 'socket-timeout': '',137 'socket-timeout': '',
@@ -234,6 +235,8 @@
234 self._logger = logging.getLogger('zc.buildout')235 self._logger = logging.getLogger('zc.buildout')
235 self.offline = (buildout_section['offline'] == 'true')236 self.offline = (buildout_section['offline'] == 'true')
236 self.newest = (buildout_section['newest'] == 'true')237 self.newest = (buildout_section['newest'] == 'true')
238 self.prefer_final_build_system = (
239 buildout_section['prefer-final-build-system'] == 'true')
237240
238 ##################################################################241 ##################################################################
239 ## WARNING!!!242 ## WARNING!!!
@@ -267,42 +270,26 @@
267270
268 self._setup_logging()271 self._setup_logging()
269272
270 offline = options['offline']
271 if offline not in ('true', 'false'):
272 self._error('Invalid value for offline option: %s', offline)
273 self.offline = (offline == 'true')
274
275 if self.offline:
276 newest = options['newest'] = 'false'
277 else:
278 newest = options['newest']
279 if newest not in ('true', 'false'):
280 self._error('Invalid value for newest option: %s', newest)
281 self.newest = (newest == 'true')
282
283 versions = options.get('versions')273 versions = options.get('versions')
284 if versions:274 if versions:
285 zc.buildout.easy_install.default_versions(dict(self[versions]))275 zc.buildout.easy_install.default_versions(dict(self[versions]))
286276
287 prefer_final = options['prefer-final']
288 if prefer_final not in ('true', 'false'):
289 self._error('Invalid value for prefer-final option: %s',
290 prefer_final)
291 zc.buildout.easy_install.prefer_final(prefer_final=='true')
292277
293 use_dependency_links = options['use-dependency-links']278 self.offline = options.get_bool('offline')
294 if use_dependency_links not in ('true', 'false'):279 if self.offline:
295 self._error('Invalid value for use-dependency-links option: %s',280 options['newest'] = 'false'
296 use_dependency_links)281 self.newest = options.get_bool('newest')
282 zc.buildout.easy_install.prefer_final(
283 options.get_bool('prefer-final'))
284 self.prefer_final_build_system = options.get_bool(
285 'prefer-final-build-system')
297 zc.buildout.easy_install.use_dependency_links(286 zc.buildout.easy_install.use_dependency_links(
298 use_dependency_links == 'true')287 options.get_bool('use-dependency-links'))
299
300 allow_picked_versions = options['allow-picked-versions']
301 if allow_picked_versions not in ('true', 'false'):
302 self._error('Invalid value for allow-picked-versions option: %s',
303 allow_picked_versions)
304 zc.buildout.easy_install.allow_picked_versions(288 zc.buildout.easy_install.allow_picked_versions(
305 allow_picked_versions == 'true')289 options.get_bool('allow-picked-versions'))
290 zc.buildout.easy_install.install_from_cache(
291 options.get_bool('install-from-cache'))
292 zc.buildout.easy_install.always_unzip(options.get_bool('unzip'))
306293
307 download_cache = options.get('download-cache')294 download_cache = options.get('download-cache')
308 if download_cache:295 if download_cache:
@@ -319,19 +306,6 @@
319306
320 zc.buildout.easy_install.download_cache(download_cache)307 zc.buildout.easy_install.download_cache(download_cache)
321308
322 install_from_cache = options['install-from-cache']
323 if install_from_cache not in ('true', 'false'):
324 self._error('Invalid value for install-from-cache option: %s',
325 install_from_cache)
326 zc.buildout.easy_install.install_from_cache(
327 install_from_cache=='true')
328
329 always_unzip = options['unzip']
330 if always_unzip not in ('true', 'false'):
331 self._error('Invalid value for unzip option: %s',
332 always_unzip)
333 zc.buildout.easy_install.always_unzip(always_unzip=='true')
334
335 # "Use" each of the defaults so they aren't reported as unused options.309 # "Use" each of the defaults so they aren't reported as unused options.
336 for name in _buildout_default_options:310 for name in _buildout_default_options:
337 options[name]311 options[name]
@@ -364,6 +338,7 @@
364 [options['develop-eggs-directory'],338 [options['develop-eggs-directory'],
365 options['eggs-directory']],339 options['eggs-directory']],
366 include_site_packages=_sys_executable_has_broken_dash_S,340 include_site_packages=_sys_executable_has_broken_dash_S,
341 prefer_final = self.prefer_final_build_system,
367 )342 )
368 else:343 else:
369 ws = zc.buildout.easy_install.install(344 ws = zc.buildout.easy_install.install(
@@ -375,6 +350,7 @@
375 newest=self.newest,350 newest=self.newest,
376 allow_hosts=self._allow_hosts,351 allow_hosts=self._allow_hosts,
377 include_site_packages=_sys_executable_has_broken_dash_S,352 include_site_packages=_sys_executable_has_broken_dash_S,
353 prefer_final = self.prefer_final_build_system,
378 )354 )
379355
380 # Now copy buildout and setuptools eggs, and record destination eggs:356 # Now copy buildout and setuptools eggs, and record destination eggs:
@@ -410,6 +386,8 @@
410 else:386 else:
411 assert relative_paths == 'false'387 assert relative_paths == 'false'
412 relative_paths = ''388 relative_paths = ''
389 # Ideally the (possibly) new version of buildout would get a
390 # chance to write the script. Not sure how to do that.
413 zc.buildout.easy_install.sitepackage_safe_scripts(391 zc.buildout.easy_install.sitepackage_safe_scripts(
414 options['bin-directory'], ws, options['executable'], partsdir,392 options['bin-directory'], ws, options['executable'], partsdir,
415 reqs=['zc.buildout'], relative_paths=relative_paths,393 reqs=['zc.buildout'], relative_paths=relative_paths,
@@ -427,7 +405,7 @@
427 # for eggs:405 # for eggs:
428 sys.path.insert(0, self['buildout']['develop-eggs-directory'])406 sys.path.insert(0, self['buildout']['develop-eggs-directory'])
429407
430 # Check for updates. This could cause the process to be rstarted408 # Check for updates. This could cause the process to be restarted.
431 self._maybe_upgrade()409 self._maybe_upgrade()
432410
433 # load installed data411 # load installed data
@@ -480,7 +458,7 @@
480 # compute new part recipe signatures458 # compute new part recipe signatures
481 self._compute_part_signatures(install_parts)459 self._compute_part_signatures(install_parts)
482460
483 # uninstall parts that are no-longer used or who's configs461 # uninstall parts that are no-longer used or whose configs
484 # have changed462 # have changed
485 for part in reversed(installed_parts):463 for part in reversed(installed_parts):
486 if part in install_parts:464 if part in install_parts:
@@ -626,11 +604,11 @@
626 f.close()604 f.close()
627605
628 def _uninstall_part(self, part, installed_part_options):606 def _uninstall_part(self, part, installed_part_options):
629 # ununstall part607 # uninstall part
630 __doing__ = 'Uninstalling %s.', part608 __doing__ = 'Uninstalling %s.', part
631 self._logger.info(*__doing__)609 self._logger.info(*__doing__)
632610
633 # run uinstall recipe611 # run uninstall recipe
634 recipe, entry = _recipe(installed_part_options[part])612 recipe, entry = _recipe(installed_part_options[part])
635 try:613 try:
636 uninstaller = _install_and_load(614 uninstaller = _install_and_load(
@@ -859,7 +837,8 @@
859 index = options.get('index'),837 index = options.get('index'),
860 path = [options['develop-eggs-directory']],838 path = [options['develop-eggs-directory']],
861 allow_hosts = self._allow_hosts,839 allow_hosts = self._allow_hosts,
862 include_site_packages=_sys_executable_has_broken_dash_S840 include_site_packages=_sys_executable_has_broken_dash_S,
841 prefer_final=self.prefer_final_build_system,
863 )842 )
864843
865 upgraded = []844 upgraded = []
@@ -913,6 +892,8 @@
913 # fast for Python to know to regenerate the .pyc/.pyo files.892 # fast for Python to know to regenerate the .pyc/.pyo files.
914 shutil.rmtree(partsdir)893 shutil.rmtree(partsdir)
915 os.mkdir(partsdir)894 os.mkdir(partsdir)
895 # Ideally the new version of buildout would get a chance to write the
896 # script. Not sure how to do that.
916 zc.buildout.easy_install.sitepackage_safe_scripts(897 zc.buildout.easy_install.sitepackage_safe_scripts(
917 options['bin-directory'], ws, sys.executable, partsdir,898 options['bin-directory'], ws, sys.executable, partsdir,
918 reqs=['zc.buildout'],899 reqs=['zc.buildout'],
@@ -957,7 +938,8 @@
957 links = self['buildout'].get('find-links', '').split(),938 links = self['buildout'].get('find-links', '').split(),
958 index = self['buildout'].get('index'),939 index = self['buildout'].get('index'),
959 newest=self.newest, allow_hosts=self._allow_hosts,940 newest=self.newest, allow_hosts=self._allow_hosts,
960 include_site_packages=_sys_executable_has_broken_dash_S)941 include_site_packages=_sys_executable_has_broken_dash_S,
942 prefer_final=self.prefer_final_build_system)
961943
962 # Clear cache because extensions might now let us read pages we944 # Clear cache because extensions might now let us read pages we
963 # couldn't read before.945 # couldn't read before.
@@ -988,6 +970,7 @@
988 setup = os.path.abspath(setup)970 setup = os.path.abspath(setup)
989971
990 fd, tsetup = tempfile.mkstemp()972 fd, tsetup = tempfile.mkstemp()
973 exe = zc.buildout.easy_install._safe_arg(sys.executable)
991 try:974 try:
992 os.write(fd, zc.buildout.easy_install.runsetup_template % dict(975 os.write(fd, zc.buildout.easy_install.runsetup_template % dict(
993 setuptools=pkg_resources_loc,976 setuptools=pkg_resources_loc,
@@ -1001,14 +984,10 @@
1001 for a in args:984 for a in args:
1002 arg_list.append(zc.buildout.easy_install._safe_arg(a))985 arg_list.append(zc.buildout.easy_install._safe_arg(a))
1003986
1004 subprocess.Popen(987 subprocess.Popen([exe] + list(tsetup) + arg_list).wait()
1005 [zc.buildout.easy_install._safe_arg(sys.executable)]
1006 + list(tsetup)
1007 + arg_list
1008 ).wait()
1009988
1010 else:989 else:
1011 os.spawnl(os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable), tsetup,990 os.spawnl(os.P_WAIT, sys.executable, exe, tsetup,
1012 *[zc.buildout.easy_install._safe_arg(a)991 *[zc.buildout.easy_install._safe_arg(a)
1013 for a in args])992 for a in args])
1014 finally:993 finally:
@@ -1075,7 +1054,8 @@
1075 working_set=pkg_resources.working_set,1054 working_set=pkg_resources.working_set,
1076 newest=buildout.newest,1055 newest=buildout.newest,
1077 allow_hosts=buildout._allow_hosts,1056 allow_hosts=buildout._allow_hosts,
1078 include_site_packages=_sys_executable_has_broken_dash_S)1057 include_site_packages=_sys_executable_has_broken_dash_S,
1058 prefer_final=buildout.prefer_final_build_system)
10791059
1080 __doing__ = 'Loading %s recipe entry %s:%s.', group, spec, entry1060 __doing__ = 'Loading %s recipe entry %s:%s.', group, spec, entry
1081 return pkg_resources.load_entry_point(1061 return pkg_resources.load_entry_point(
@@ -1297,6 +1277,31 @@
1297 self.name)1277 self.name)
1298 return self._created1278 return self._created
12991279
1280 def get_bool(self, name, default=None, on_error=None):
1281 """Given a name, return a boolean value for that name.
1282
1283 ``default``, if given, should be 'true', 'false', or None. None
1284 is the default, and means that there is no default for the
1285 value: the call should raise a MissingOption error if the name
1286 is not present.
1287
1288 ``on_error``, if given, should be a callable that takes the name and
1289 the found value.
1290 """
1291 if default is None:
1292 value = self[name]
1293 else:
1294 value = self.get(name, default=default)
1295 if value not in ('true', 'false'):
1296 if on_error is None:
1297 raise zc.buildout.UserError(
1298 'Invalid value for %s option: %s' % (name, value))
1299 else:
1300 on_error(name, value)
1301 else:
1302 return value == 'true'
1303
1304
1300_spacey_nl = re.compile('[ \t\r\f\v]*\n[ \t\r\f\v\n]*'1305_spacey_nl = re.compile('[ \t\r\f\v]*\n[ \t\r\f\v\n]*'
1301 '|'1306 '|'
1302 '^[ \t\r\f\v]+'1307 '^[ \t\r\f\v]+'
13031308
=== modified file 'src/zc/buildout/buildout.txt'
--- src/zc/buildout/buildout.txt 2010-06-23 12:07:30 +0000
+++ src/zc/buildout/buildout.txt 2010-08-07 00:12:52 +0000
@@ -765,6 +765,8 @@
765 DEFAULT_VALUE765 DEFAULT_VALUE
766 prefer-final= false766 prefer-final= false
767 DEFAULT_VALUE767 DEFAULT_VALUE
768 prefer-final-build-system= true
769 DEFAULT_VALUE
768 python= buildout770 python= buildout
769 DEFAULT_VALUE771 DEFAULT_VALUE
770 relative-paths= false772 relative-paths= false
@@ -2244,6 +2246,7 @@
2244 parts =2246 parts =
2245 parts-directory = /sample-buildout/parts2247 parts-directory = /sample-buildout/parts
2246 prefer-final = false2248 prefer-final = false
2249 prefer-final-build-system = true
2247 python = buildout2250 python = buildout
2248 relative-paths = false2251 relative-paths = false
2249 socket-timeout =2252 socket-timeout =
@@ -2484,25 +2487,34 @@
2484Preferring Final Releases2487Preferring Final Releases
2485-------------------------2488-------------------------
24862489
2487Currently, when searching for new releases, the newest available2490Currently, when searching for new releases of your project's
2488release is used. This isn't usually ideal, as you may get a2491dependencies, the newest available release is used. This isn't usually
2489development release or alpha releases not ready to be widely used.2492ideal, as you may get a development release or alpha releases not ready
2490You can request that final releases be preferred using the prefer2493to be widely used. You can request that final releases be preferred
2491final option in the buildout section::2494using the ``prefer-final`` option in the buildout section::
24922495
2493 [buildout]2496 [buildout]
2494 ...2497 ...
2495 prefer-final = true2498 prefer-final = true
24962499
2497When the prefer-final option is set to true, then when searching for2500When the ``prefer-final`` option is set to true, then when searching for
2498new releases, final releases are preferred. If there are final2501new releases, final releases are preferred. If there are final
2499releases that satisfy distribution requirements, then those releases2502releases that satisfy distribution requirements, then those releases
2500are used even if newer non-final releases are available. The buildout2503are used even if newer non-final releases are available.
2501prefer-final option can be used to override this behavior.2504
25022505A separate option controls the behavior of the build system itself.
2503In buildout version 2, final releases will be preferred by default.2506When buildout looks for recipes, extensions, and for updates to itself,
2504You will then need to use a false value for prefer-final to get the2507it does prefer final releases by default, as of the 1.5.0 release. The
2505newest releases.2508``prefer-final-build-system`` option will let you override this behavior.
2509
2510 [buildout]
2511 ...
2512 prefer-final-build-system = false
2513
2514In buildout version 2, all final releases will be preferred by
2515default--that is ``prefer-final`` will also default to 'true'. You will
2516then need to use a 'false' value for ``prefer-final`` to get the newest
2517releases, like with ``prefer-final-build-system``.
25062518
2507Finding distributions2519Finding distributions
2508---------------------2520---------------------
25092521
=== modified file 'src/zc/buildout/easy_install.py'
--- src/zc/buildout/easy_install.py 2010-08-07 00:12:52 +0000
+++ src/zc/buildout/easy_install.py 2010-08-07 00:12:52 +0000
@@ -322,7 +322,8 @@
322 use_dependency_links=None,322 use_dependency_links=None,
323 allow_hosts=('*',),323 allow_hosts=('*',),
324 include_site_packages=None,324 include_site_packages=None,
325 allowed_eggs_from_site_packages=None325 allowed_eggs_from_site_packages=None,
326 prefer_final=None,
326 ):327 ):
327 self._dest = dest328 self._dest = dest
328 self._allow_hosts = allow_hosts329 self._allow_hosts = allow_hosts
@@ -336,6 +337,8 @@
336337
337 if use_dependency_links is not None:338 if use_dependency_links is not None:
338 self._use_dependency_links = use_dependency_links339 self._use_dependency_links = use_dependency_links
340 if prefer_final is not None:
341 self._prefer_final = prefer_final
339 self._links = links = list(_fix_file_links(links))342 self._links = links = list(_fix_file_links(links))
340 if self._download_cache and (self._download_cache not in links):343 if self._download_cache and (self._download_cache not in links):
341 links.insert(0, self._download_cache)344 links.insert(0, self._download_cache)
@@ -1060,13 +1063,14 @@
1060 executable=sys.executable, always_unzip=None,1063 executable=sys.executable, always_unzip=None,
1061 path=None, working_set=None, newest=True, versions=None,1064 path=None, working_set=None, newest=True, versions=None,
1062 use_dependency_links=None, allow_hosts=('*',),1065 use_dependency_links=None, allow_hosts=('*',),
1063 include_site_packages=None, allowed_eggs_from_site_packages=None):1066 include_site_packages=None, allowed_eggs_from_site_packages=None,
1064 installer = Installer(dest, links, index, executable, always_unzip, path,1067 prefer_final=None):
1065 newest, versions, use_dependency_links,1068 installer = Installer(
1066 allow_hosts=allow_hosts,1069 dest, links, index, executable, always_unzip, path, newest,
1067 include_site_packages=include_site_packages,1070 versions, use_dependency_links, allow_hosts=allow_hosts,
1068 allowed_eggs_from_site_packages=1071 include_site_packages=include_site_packages,
1069 allowed_eggs_from_site_packages)1072 allowed_eggs_from_site_packages=allowed_eggs_from_site_packages,
1073 prefer_final=prefer_final)
1070 return installer.install(specs, working_set)1074 return installer.install(specs, working_set)
10711075
10721076
@@ -1075,11 +1079,11 @@
1075 executable=sys.executable,1079 executable=sys.executable,
1076 path=None, newest=True, versions=None, allow_hosts=('*',),1080 path=None, newest=True, versions=None, allow_hosts=('*',),
1077 include_site_packages=None, allowed_eggs_from_site_packages=None):1081 include_site_packages=None, allowed_eggs_from_site_packages=None):
1078 installer = Installer(dest, links, index, executable, True, path, newest,1082 installer = Installer(
1079 versions, allow_hosts=allow_hosts,1083 dest, links, index, executable, True, path, newest, versions,
1080 include_site_packages=include_site_packages,1084 allow_hosts=allow_hosts,
1081 allowed_eggs_from_site_packages=1085 include_site_packages=include_site_packages,
1082 allowed_eggs_from_site_packages)1086 allowed_eggs_from_site_packages=allowed_eggs_from_site_packages)
1083 return installer.build(spec, build_ext)1087 return installer.build(spec, build_ext)
10841088
10851089
@@ -1175,11 +1179,12 @@
1175 [f() for f in undo]1179 [f() for f in undo]
11761180
1177def working_set(specs, executable, path, include_site_packages=None,1181def working_set(specs, executable, path, include_site_packages=None,
1178 allowed_eggs_from_site_packages=None):1182 allowed_eggs_from_site_packages=None, prefer_final=None):
1179 return install(1183 return install(
1180 specs, None, executable=executable, path=path,1184 specs, None, executable=executable, path=path,
1181 include_site_packages=include_site_packages,1185 include_site_packages=include_site_packages,
1182 allowed_eggs_from_site_packages=allowed_eggs_from_site_packages)1186 allowed_eggs_from_site_packages=allowed_eggs_from_site_packages,
1187 prefer_final=prefer_final)
11831188
1184############################################################################1189############################################################################
1185# Script generation functions1190# Script generation functions
11861191
=== modified file 'src/zc/buildout/tests.py'
--- src/zc/buildout/tests.py 2010-08-07 00:12:52 +0000
+++ src/zc/buildout/tests.py 2010-08-07 00:12:52 +0000
@@ -3126,6 +3126,105 @@
31263126
3127 """3127 """
31283128
3129def buildout_prefer_final_build_system_option():
3130 """
3131The prefer-final-build-system buildout option can be used for overriding
3132the default preference for final distributions for recipes, buildout
3133extensions, and buildout itself.
3134
3135Set up. This creates sdists for demorecipe 1.0 and 1.1b1, and for
3136demoextension 1.0 and 1.1b1.
3137
3138 >>> create_sample_recipe_sdists(sample_eggs)
3139 >>> create_sample_extension_sdists(sample_eggs)
3140
3141The default is prefer-final-build-system = true:
3142
3143 >>> write('buildout.cfg',
3144 ... '''
3145 ... [buildout]
3146 ... parts = demo
3147 ... find-links = %(link_server)s
3148 ... extensions = demoextension
3149 ...
3150 ... [demo]
3151 ... recipe = demorecipe
3152 ... ''' % globals())
3153
3154 >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
3155 Installing ...
3156 Picked: demoextension = 1.0
3157 ...
3158 Picked: demorecipe = 1.0
3159 ...
3160
3161Here we see that the final versions of demorecipe and demoextension were used.
3162
3163We get the same behavior if we explicitly state that
3164prefer-final-build-system = true.
3165
3166 >>> write('buildout.cfg',
3167 ... '''
3168 ... [buildout]
3169 ... parts = demo
3170 ... find-links = %(link_server)s
3171 ... extensions = demoextension
3172 ... prefer-final-build-system = true
3173 ...
3174 ... [demo]
3175 ... recipe = demorecipe
3176 ... ''' % globals())
3177
3178 >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
3179 Installing ...
3180 Picked: demoextension = 1.0
3181 ...
3182 Picked: demorecipe = 1.0
3183 ...
3184
3185If we specify prefer-final-build-system = false, we'll get the newest
3186distributions in the build system:
3187
3188 >>> write('buildout.cfg',
3189 ... '''
3190 ... [buildout]
3191 ... parts = demo
3192 ... find-links = %(link_server)s
3193 ... extensions = demoextension
3194 ... prefer-final-build-system = false
3195 ...
3196 ... [demo]
3197 ... recipe = demorecipe
3198 ... ''' % globals())
3199
3200 >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
3201 Installing ...
3202 Picked: demoextension = 1.1b1
3203 ...
3204 Picked: demorecipe = 1.1b1
3205 ...
3206
3207We get an error if we specify anything but true or false:
3208
3209 >>> write('buildout.cfg',
3210 ... '''
3211 ... [buildout]
3212 ... parts = demo
3213 ... find-links = %(link_server)s
3214 ... extensions = demoextension
3215 ... prefer-final-build-system = no
3216 ...
3217 ... [demo]
3218 ... recipe = demorecipe
3219 ... ''' % globals())
3220
3221 >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
3222 While:
3223 Initializing.
3224 Error: Invalid value for prefer-final-build-system option: no
3225
3226 """
3227
3129def develop_with_modules():3228def develop_with_modules():
3130 """3229 """
3131Distribution setup scripts can import modules in the distribution directory:3230Distribution setup scripts can import modules in the distribution directory:
@@ -3492,6 +3591,68 @@
3492 finally:3591 finally:
3493 shutil.rmtree(tmp)3592 shutil.rmtree(tmp)
34943593
3594def create_sample_extension_sdists(dest):
3595 from zc.buildout.testing import write, mkdir
3596 name = 'demoextension'
3597 for version in ('1.0', '1.1b1'):
3598 tmp = tempfile.mkdtemp()
3599 try:
3600 write(tmp, 'README.txt', '')
3601 write(tmp, name + '.py',
3602 "def ext(buildout):\n"
3603 " pass\n"
3604 "def unload(buildout):\n"
3605 " pass\n"
3606 % locals())
3607 write(tmp, 'setup.py',
3608 "from setuptools import setup\n"
3609 "setup(\n"
3610 " name = %(name)r,\n"
3611 " py_modules = [%(name)r],\n"
3612 " entry_points = {\n"
3613 " 'zc.buildout.extension': "
3614 "['ext = %(name)s:ext'],\n"
3615 " 'zc.buildout.unloadextension': "
3616 "['ext = %(name)s:unload'],\n"
3617 " },\n"
3618 " zip_safe=True, version=%(version)r,\n"
3619 " author='bob', url='bob', author_email='bob')\n"
3620 % locals())
3621 zc.buildout.testing.sdist(tmp, dest)
3622 finally:
3623 shutil.rmtree(tmp)
3624
3625def create_sample_recipe_sdists(dest):
3626 from zc.buildout.testing import write, mkdir
3627 name = 'demorecipe'
3628 for version in ('1.0', '1.1b1'):
3629 tmp = tempfile.mkdtemp()
3630 try:
3631 write(tmp, 'README.txt', '')
3632 write(tmp, name + '.py',
3633 "import logging, os, zc.buildout\n"
3634 "class Demorecipe:\n"
3635 " def __init__(self, buildout, name, options):\n"
3636 " self.name, self.options = name, options\n"
3637 " def install(self):\n"
3638 " return ()\n"
3639 " def update(self):\n"
3640 " pass\n"
3641 % locals())
3642 write(tmp, 'setup.py',
3643 "from setuptools import setup\n"
3644 "setup(\n"
3645 " name = %(name)r,\n"
3646 " py_modules = [%(name)r],\n"
3647 " entry_points = {'zc.buildout': "
3648 "['default = %(name)s:Demorecipe']},\n"
3649 " zip_safe=True, version=%(version)r,\n"
3650 " author='bob', url='bob', author_email='bob')\n"
3651 % locals())
3652 zc.buildout.testing.sdist(tmp, dest)
3653 finally:
3654 shutil.rmtree(tmp)
3655
3495def _write_eggrecipedemoneeded(tmp, minor_version, suffix=''):3656def _write_eggrecipedemoneeded(tmp, minor_version, suffix=''):
3496 from zc.buildout.testing import write3657 from zc.buildout.testing import write
3497 write(tmp, 'README.txt', '')3658 write(tmp, 'README.txt', '')
@@ -3639,37 +3800,33 @@
36393800
3640egg_parse = re.compile('([0-9a-zA-Z_.]+)-([0-9a-zA-Z_.]+)-py(\d[.]\d).egg$'3801egg_parse = re.compile('([0-9a-zA-Z_.]+)-([0-9a-zA-Z_.]+)-py(\d[.]\d).egg$'
3641 ).match3802 ).match
3642def makeNewRelease(project, ws, dest):3803def makeNewRelease(project, ws, dest, version='99.99'):
3643 dist = ws.find(pkg_resources.Requirement.parse(project))3804 dist = ws.find(pkg_resources.Requirement.parse(project))
3644 eggname, oldver, pyver = egg_parse(3805 eggname, oldver, pyver = egg_parse(
3645 os.path.basename(dist.location)3806 os.path.basename(dist.location)
3646 ).groups()3807 ).groups()
3647 dest = os.path.join(dest, "%s-99.99-py%s.egg" % (eggname, pyver))3808 dest = os.path.join(dest, "%s-%s-py%s.egg" % (eggname, version, pyver))
3648 if os.path.isfile(dist.location):3809 if os.path.isfile(dist.location):
3649 shutil.copy(dist.location, dest)3810 shutil.copy(dist.location, dest)
3650 zip = zipfile.ZipFile(dest, 'a')3811 zip = zipfile.ZipFile(dest, 'a')
3651 zip.writestr(3812 zip.writestr(
3652 'EGG-INFO/PKG-INFO',3813 'EGG-INFO/PKG-INFO',
3653 zip.read('EGG-INFO/PKG-INFO').replace("Version: %s" % oldver,3814 zip.read('EGG-INFO/PKG-INFO').replace("Version: %s" % oldver,
3654 "Version: 99.99")3815 "Version: %s" % version)
3655 )3816 )
3656 zip.close()3817 zip.close()
3657 else:3818 else:
3658 shutil.copytree(dist.location, dest)3819 shutil.copytree(dist.location, dest)
3659 info_path = os.path.join(dest, 'EGG-INFO', 'PKG-INFO')3820 info_path = os.path.join(dest, 'EGG-INFO', 'PKG-INFO')
3660 info = open(info_path).read().replace("Version: %s" % oldver,3821 info = open(info_path).read().replace("Version: %s" % oldver,
3661 "Version: 99.99")3822 "Version: %s" % version)
3662 open(info_path, 'w').write(info)3823 open(info_path, 'w').write(info)
36633824
36643825def getWorkingSetWithBuildoutEgg(test):
3665def updateSetup(test):
3666 zc.buildout.testing.buildoutSetUp(test)
3667 new_releases = test.globs['tmpdir']('new_releases')
3668 test.globs['new_releases'] = new_releases
3669 sample_buildout = test.globs['sample_buildout']3826 sample_buildout = test.globs['sample_buildout']
3670 eggs = os.path.join(sample_buildout, 'eggs')3827 eggs = os.path.join(sample_buildout, 'eggs')
36713828
3672 # If the zc.buildout dist is a develo dist, convert it to a3829 # If the zc.buildout dist is a develop dist, convert it to a
3673 # regular egg in the sample buildout3830 # regular egg in the sample buildout
3674 req = pkg_resources.Requirement.parse('zc.buildout')3831 req = pkg_resources.Requirement.parse('zc.buildout')
3675 dist = pkg_resources.working_set.find(req)3832 dist = pkg_resources.working_set.find(req)
@@ -3699,9 +3856,16 @@
3699 os.path.join(sample_buildout, 'bin'))3856 os.path.join(sample_buildout, 'bin'))
3700 else:3857 else:
3701 ws = pkg_resources.working_set3858 ws = pkg_resources.working_set
3859 return ws
37023860
3861def updateSetup(test):
3862 zc.buildout.testing.buildoutSetUp(test)
3863 new_releases = test.globs['tmpdir']('new_releases')
3864 test.globs['new_releases'] = new_releases
3865 ws = getWorkingSetWithBuildoutEgg(test)
3703 # now let's make the new releases3866 # now let's make the new releases
3704 makeNewRelease('zc.buildout', ws, new_releases)3867 makeNewRelease('zc.buildout', ws, new_releases)
3868 makeNewRelease('zc.buildout', ws, new_releases, '100.0b1')
3705 os.mkdir(os.path.join(new_releases, 'zc.buildout'))3869 os.mkdir(os.path.join(new_releases, 'zc.buildout'))
3706 if zc.buildout.easy_install.is_distribute:3870 if zc.buildout.easy_install.is_distribute:
3707 makeNewRelease('distribute', ws, new_releases)3871 makeNewRelease('distribute', ws, new_releases)
@@ -3710,6 +3874,13 @@
3710 makeNewRelease('setuptools', ws, new_releases)3874 makeNewRelease('setuptools', ws, new_releases)
3711 os.mkdir(os.path.join(new_releases, 'setuptools'))3875 os.mkdir(os.path.join(new_releases, 'setuptools'))
37123876
3877def bootstrapSetup(test):
3878 easy_install_SetUp(test)
3879 sample_eggs = test.globs['sample_eggs']
3880 ws = getWorkingSetWithBuildoutEgg(test)
3881 makeNewRelease('zc.buildout', ws, sample_eggs)
3882 makeNewRelease('zc.buildout', ws, sample_eggs, '100.0b1')
3883 os.environ['bootstrap-testing-find-links'] = test.globs['link_server']
37133884
3714normalize_bang = (3885normalize_bang = (
3715 re.compile(re.escape('#!'+3886 re.compile(re.escape('#!'+
@@ -3952,12 +4123,13 @@
3952 if os.path.exists(bootstrap_py):4123 if os.path.exists(bootstrap_py):
3953 test_suite.append(doctest.DocFileSuite(4124 test_suite.append(doctest.DocFileSuite(
3954 'bootstrap.txt',4125 'bootstrap.txt',
3955 setUp=easy_install_SetUp,4126 setUp=bootstrapSetup,
3956 tearDown=zc.buildout.testing.buildoutTearDown,4127 tearDown=zc.buildout.testing.buildoutTearDown,
3957 checker=renormalizing.RENormalizing([4128 checker=renormalizing.RENormalizing([
3958 zc.buildout.testing.normalize_path,4129 zc.buildout.testing.normalize_path,
3959 zc.buildout.testing.normalize_endings,4130 zc.buildout.testing.normalize_endings,
3960 zc.buildout.testing.normalize_script,4131 zc.buildout.testing.normalize_script,
4132 zc.buildout.testing.normalize_egg_py,
3961 normalize_bang,4133 normalize_bang,
3962 (re.compile('Downloading.*setuptools.*egg\n'), ''),4134 (re.compile('Downloading.*setuptools.*egg\n'), ''),
3963 (re.compile('options:'), 'Options:'),4135 (re.compile('options:'), 'Options:'),
39644136
=== modified file 'src/zc/buildout/update.txt'
--- src/zc/buildout/update.txt 1970-01-01 00:00:00 +0000
+++ src/zc/buildout/update.txt 2010-08-07 00:12:52 +0000
@@ -3,13 +3,14 @@
33
4When a buildout is run, one of the first steps performed is to check4When a buildout is run, one of the first steps performed is to check
5for updates to either zc.buildout or setuptools. To demonstrate this,5for updates to either zc.buildout or setuptools. To demonstrate this,
6we've creates some "new releases" of buildout and setuptools in a6we've created some "new releases" of buildout and setuptools in a
7new_releases folder:7new_releases folder:
88
9 >>> ls(new_releases)9 >>> ls(new_releases)
10 d setuptools10 d setuptools
11 - setuptools-99.99-py2.4.egg11 - setuptools-99.99-py2.4.egg
12 d zc.buildout12 d zc.buildout
13 - zc.buildout-100.0b1-pyN.N.egg
13 - zc.buildout-99.99-py2.4.egg14 - zc.buildout-99.99-py2.4.egg
1415
15Let's update the sample buildout.cfg to look in this area:16Let's update the sample buildout.cfg to look in this area:
@@ -78,6 +79,11 @@
78 zc.buildout 99.9979 zc.buildout 99.99
79 setuptools 99.9980 setuptools 99.99
8081
82Notice that, even though we have a newer beta version of zc.buildout
83available, the final "99.99" was selected. If you want to get non-final
84versions, specify a specific version in your buildout's versions section,
85or use the ``prefer-final-build-system = false`` discussed below.
86
81Our buildout script's site.py has been updated to use the new eggs:87Our buildout script's site.py has been updated to use the new eggs:
8288
83 >>> cat(sample_buildout, 'parts', 'buildout', 'site.py')89 >>> cat(sample_buildout, 'parts', 'buildout', 'site.py')
@@ -162,7 +168,7 @@
162 setuptools 0.6168 setuptools 0.6
163169
164We also won't upgrade if the buildout script being run isn't in the170We also won't upgrade if the buildout script being run isn't in the
165buildouts bin directory. To see this we'll create a new buildout171buildout's bin directory. To see this we'll create a new buildout
166directory:172directory:
167173
168 >>> sample_buildout2 = tmpdir('sample_buildout2')174 >>> sample_buildout2 = tmpdir('sample_buildout2')
@@ -187,3 +193,33 @@
187 Not upgrading because not running a local buildout command.193 Not upgrading because not running a local buildout command.
188194
189 >>> ls('bin')195 >>> ls('bin')
196
197Notice that, as mentioned above, the ``prefer-final-build-system =
198false`` means that newer non-final versions of these dependencies are
199preferred.
200
201 >>> cd(sample_buildout)
202 >>> write(sample_buildout, 'buildout.cfg',
203 ... """
204 ... [buildout]
205 ... find-links = %(new_releases)s
206 ... index = %(new_releases)s
207 ... parts = show-versions
208 ... develop = showversions
209 ... prefer-final-build-system = false
210 ...
211 ... [show-versions]
212 ... recipe = showversions
213 ... """ % dict(new_releases=new_releases))
214
215 >>> print system(buildout),
216 Getting distribution for 'zc.buildout'.
217 Got zc.buildout 100.0b1.
218 Upgraded:
219 zc.buildout version 100.0b1,
220 setuptools version 99.99;
221 restarting.
222 Develop: '/sample-buildout/showversions'
223 Updating show-versions.
224 zc.buildout 100.0b1
225 setuptools 99.99

Subscribers

People subscribed via source and target branches

to all changes: