Merge lp:~gary/zc.buildout/betafix8 into lp:zc.buildout
- betafix8
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~gary/zc.buildout/betafix8 |
Merge into: | lp:zc.buildout |
Prerequisite: | lp:~gary/zc.buildout/betafix7 |
Diff against target: |
526 lines (+155/-80) 6 files modified
CHANGES.txt (+14/-8) src/zc/buildout/bootstrap.txt (+43/-26) src/zc/buildout/buildout.py (+42/-17) src/zc/buildout/buildout.txt (+12/-13) src/zc/buildout/tests.py (+11/-9) src/zc/buildout/update.txt (+33/-7) |
To merge this branch: | bzr merge lp:~gary/zc.buildout/betafix8 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | Approve | ||
Review via email: mp+33077@code.launchpad.net |
Commit message
Description of the change
In the review of betafix6 (https:/
I am slightly abusing command-line overrides for the new option, but I think it is a reasonable compromise in practice.
In light of these changes, I also changed the pertinent option names. Before, we had tightly related behavior called "--accept-
Unmerged revisions
- 565. By Gary Poster
-
make it much simpler to try out new buildout versions: instead of having to make a gesture in bootstrap *and* buildout.cfg, you can make the gesture once in bootstrap. Changed pertinent option names to reflect new thinking.
- 564. By Gary Poster
-
merge from trunk/previous branches
- 563. By Gary Poster
-
docs, test fixes and cleanups
- 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
Preview Diff
1 | === modified file 'CHANGES.txt' | |||
2 | --- CHANGES.txt 2010-08-19 02:27:43 +0000 | |||
3 | +++ CHANGES.txt 2010-08-19 02:27:43 +0000 | |||
4 | @@ -9,17 +9,23 @@ | |||
5 | 9 | - zc.buildout supports Python 2.7. | 9 | - zc.buildout supports Python 2.7. |
6 | 10 | 10 | ||
7 | 11 | - By default, Buildout and the bootstrap script now prefer final versions of | 11 | - By default, Buildout and the bootstrap script now prefer final versions of |
15 | 12 | Buildout, recipes, and extensions. This can be changed by setting | 12 | Buildout, recipes, and extensions. This can be changed by using the |
16 | 13 | ``prefer-final-build-system = false`` in your configuration's | 13 | --accept-buildout-test-releases flag (or -t for short) when calling |
17 | 14 | [buildout] section, and by using the --accept-early-release flag when | 14 | bootstrap. This will hopefully allow beta releases of these items to |
18 | 15 | calling bootstrap. This will hopefully allow beta releases to be more | 15 | be more easily and safely made in the future. |
19 | 16 | easily and safely made in the future. Note that dependencies of your | 16 | |
20 | 17 | software do not have this behavior: use the pre-existing switch | 17 | NOTE: dependencies of your own software are not affected by this new |
21 | 18 | ``prefer-final = true`` to get this behavior. | 18 | behavior. Buildout continues to choose the newest available versions |
22 | 19 | of your dependencies regardless of whether they are final releases. To | ||
23 | 20 | prevent this, use the pre-existing switch ``prefer-final = true`` in | ||
24 | 21 | the [buildout] section of your configuration file (see | ||
25 | 22 | http://pypi.python.org/pypi/zc.buildout#preferring-final-releases) or | ||
26 | 23 | pin your versions using a versions section (see | ||
27 | 24 | http://pypi.python.org/pypi/zc.buildout#repeatable-buildouts-controlling-eggs-used). | ||
28 | 19 | 25 | ||
29 | 20 | Bugs fixed: | 26 | Bugs fixed: |
30 | 21 | 27 | ||
32 | 22 | - You can now again use virtualenv with zc.buildout. The new features to let | 28 | - You can now again use virtualenv with Buildout. The new features to let |
33 | 23 | buildout be used with a system Python are disabled in this configuration, | 29 | buildout be used with a system Python are disabled in this configuration, |
34 | 24 | and the previous script generation behavior (1.4.3) is used, even if | 30 | and the previous script generation behavior (1.4.3) is used, even if |
35 | 25 | the new function ``zc.buildout.easy_install.sitepackage_safe_scripts`` | 31 | the new function ``zc.buildout.easy_install.sitepackage_safe_scripts`` |
36 | 26 | 32 | ||
37 | === modified file 'src/zc/buildout/bootstrap.txt' | |||
38 | --- src/zc/buildout/bootstrap.txt 2010-08-19 02:27:43 +0000 | |||
39 | +++ src/zc/buildout/bootstrap.txt 2010-08-19 02:27:43 +0000 | |||
40 | @@ -93,23 +93,14 @@ | |||
41 | 93 | specify an explicit version (using --version here and specifying the | 93 | specify an explicit version (using --version here and specifying the |
42 | 94 | version in the buildout configuration file using the | 94 | version in the buildout configuration file using the |
43 | 95 | ``buildout-version`` option or the ``versions`` option) or specify that you | 95 | ``buildout-version`` option or the ``versions`` option) or specify that you |
49 | 96 | accept early releases. | 96 | accept early releases by using ``--accept-buildout-test-releases`` on the |
50 | 97 | 97 | bootstrap script. | |
46 | 98 | You accept early releases by using ``--accept-early-release`` on the | ||
47 | 99 | bootstrap script and specifying ``prefer-final-build-system = false`` in the | ||
48 | 100 | buildout configuration file. You must do both. | ||
51 | 101 | 98 | ||
52 | 102 | Here's an example. | 99 | Here's an example. |
53 | 103 | 100 | ||
54 | 104 | >>> write('buildout.cfg', | ||
55 | 105 | ... ''' | ||
56 | 106 | ... [buildout] | ||
57 | 107 | ... parts = | ||
58 | 108 | ... prefer-final-build-system = false | ||
59 | 109 | ... ''') | ||
60 | 110 | >>> ignored = system( | 101 | >>> ignored = system( |
61 | 111 | ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+ | 102 | ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+ |
63 | 112 | ... 'bootstrap.py --accept-early-release') | 103 | ... 'bootstrap.py --accept-buildout-test-releases') |
64 | 113 | >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS | 104 | >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS |
65 | 114 | "... | 105 | "... |
66 | 115 | buildout_paths = [ | 106 | buildout_paths = [ |
67 | @@ -120,13 +111,41 @@ | |||
68 | 120 | 111 | ||
69 | 121 | Notice we are now using zc.buildout 100.0b1, a non-final release. | 112 | Notice we are now using zc.buildout 100.0b1, a non-final release. |
70 | 122 | 113 | ||
78 | 123 | Now we'll go back to the default of preferring final versions. | 114 | The buildout script remembers the decision to accept early releases, and |
79 | 124 | 115 | alerts the user. | |
80 | 125 | >>> write('buildout.cfg', | 116 | |
81 | 126 | ... ''' | 117 | >>> print system(join('bin', 'buildout')), |
82 | 127 | ... [buildout] | 118 | ... # doctest: +NORMALIZE_WHITESPACE |
83 | 128 | ... parts = | 119 | NOTE: Accepting early releases of build system packages. Rerun bootstrap |
84 | 129 | ... ''') | 120 | without --accept-buildout-test-releases (-t) to return to default |
85 | 121 | behavior. | ||
86 | 122 | |||
87 | 123 | This is accomplished within the script itself. | ||
88 | 124 | |||
89 | 125 | >>> print open(buildout_script).read() # doctest: +ELLIPSIS | ||
90 | 126 | #... | ||
91 | 127 | sys.argv.insert(1, 'buildout:accept-buildout-test-releases=true') | ||
92 | 128 | print ('NOTE: Accepting early releases of build system packages. Rerun ' | ||
93 | 129 | 'bootstrap without --accept-buildout-test-releases (-t) to return to ' | ||
94 | 130 | 'default behavior.') | ||
95 | 131 | ... | ||
96 | 132 | |||
97 | 133 | As the note says, to undo, you just need to re-run bootstrap without | ||
98 | 134 | --accept-buildout-test-releases. | ||
99 | 135 | |||
100 | 136 | >>> ignored = system( | ||
101 | 137 | ... zc.buildout.easy_install._safe_arg(sys.executable)+' '+ | ||
102 | 138 | ... 'bootstrap.py') | ||
103 | 139 | >>> print open(buildout_site_py).read() # doctest: +ELLIPSIS | ||
104 | 140 | "... | ||
105 | 141 | buildout_paths = [ | ||
106 | 142 | '/sample/eggs/setuptools-...egg', | ||
107 | 143 | '/sample/eggs/zc.buildout-99.99-pyN.N.egg' | ||
108 | 144 | ] | ||
109 | 145 | ... | ||
110 | 146 | >>> ('buildout:accept-buildout-test-releases=true' in | ||
111 | 147 | ... open(buildout_script).read()) | ||
112 | 148 | False | ||
113 | 130 | 149 | ||
114 | 131 | Now we will try the `--version` option, which lets you define a version for | 150 | Now we will try the `--version` option, which lets you define a version for |
115 | 132 | `zc.buildout`. If not provided, bootstrap will look for the latest one. | 151 | `zc.buildout`. If not provided, bootstrap will look for the latest one. |
116 | @@ -329,14 +348,12 @@ | |||
117 | 329 | --eggs=EGGS Specify a directory for storing eggs. Defaults to a | 348 | --eggs=EGGS Specify a directory for storing eggs. Defaults to a |
118 | 330 | temporary directory that is deleted when the bootstrap | 349 | temporary directory that is deleted when the bootstrap |
119 | 331 | script completes. | 350 | script completes. |
121 | 332 | --accept-early-release | 351 | -t, --accept-buildout-test-releases |
122 | 333 | Normally, if you do not specify a --version, the | 352 | Normally, if you do not specify a --version, the |
125 | 334 | bootstrap script gets the newest *final* versions of | 353 | bootstrap script and buildout gets the newest *final* |
126 | 335 | zc.buildout for you. If you use this flag, bootstrap | 354 | versions of zc.buildout and its recipes and extensions |
127 | 355 | for you. If you use this flag, bootstrap and buildout | ||
128 | 336 | will get the newest releases even if they are alphas | 356 | will get the newest releases even if they are alphas |
133 | 337 | or betas. Note that, if you do want to use early | 357 | or betas. |
130 | 338 | buildout releases, you probably want to also set | ||
131 | 339 | ``prefer-final-build-system= false`` in the [buildout] | ||
132 | 340 | section of your configuration file. | ||
134 | 341 | -c CONFIG_FILE Specify the path to the buildout configuration file to | 358 | -c CONFIG_FILE Specify the path to the buildout configuration file to |
135 | 342 | be used. | 359 | be used. |
136 | 343 | 360 | ||
137 | === modified file 'src/zc/buildout/buildout.py' | |||
138 | --- src/zc/buildout/buildout.py 2010-08-19 02:27:43 +0000 | |||
139 | +++ src/zc/buildout/buildout.py 2010-08-19 02:27:43 +0000 | |||
140 | @@ -116,6 +116,7 @@ | |||
141 | 116 | return data | 116 | return data |
142 | 117 | 117 | ||
143 | 118 | _buildout_default_options = _annotate_section({ | 118 | _buildout_default_options = _annotate_section({ |
144 | 119 | 'accept-buildout-test-releases': 'false', | ||
145 | 119 | 'allow-hosts': '*', | 120 | 'allow-hosts': '*', |
146 | 120 | 'allow-picked-versions': 'true', | 121 | 'allow-picked-versions': 'true', |
147 | 121 | 'bin-directory': 'bin', | 122 | 'bin-directory': 'bin', |
148 | @@ -131,7 +132,6 @@ | |||
149 | 131 | 'offline': 'false', | 132 | 'offline': 'false', |
150 | 132 | 'parts-directory': 'parts', | 133 | 'parts-directory': 'parts', |
151 | 133 | 'prefer-final': 'false', | 134 | 'prefer-final': 'false', |
152 | 134 | 'prefer-final-build-system': 'true', | ||
153 | 135 | 'python': 'buildout', | 135 | 'python': 'buildout', |
154 | 136 | 'relative-paths': 'false', | 136 | 'relative-paths': 'false', |
155 | 137 | 'socket-timeout': '', | 137 | 'socket-timeout': '', |
156 | @@ -235,8 +235,8 @@ | |||
157 | 235 | self._logger = logging.getLogger('zc.buildout') | 235 | self._logger = logging.getLogger('zc.buildout') |
158 | 236 | self.offline = (buildout_section['offline'] == 'true') | 236 | self.offline = (buildout_section['offline'] == 'true') |
159 | 237 | self.newest = (buildout_section['newest'] == 'true') | 237 | self.newest = (buildout_section['newest'] == 'true') |
162 | 238 | self.prefer_final_build_system = ( | 238 | self.accept_buildout_test_releases = ( |
163 | 239 | buildout_section['prefer-final-build-system'] == 'true') | 239 | buildout_section['accept-buildout-test-releases'] == 'true') |
164 | 240 | 240 | ||
165 | 241 | ################################################################## | 241 | ################################################################## |
166 | 242 | ## WARNING!!! | 242 | ## WARNING!!! |
167 | @@ -281,8 +281,8 @@ | |||
168 | 281 | self.newest = options.get_bool('newest') | 281 | self.newest = options.get_bool('newest') |
169 | 282 | zc.buildout.easy_install.prefer_final( | 282 | zc.buildout.easy_install.prefer_final( |
170 | 283 | options.get_bool('prefer-final')) | 283 | options.get_bool('prefer-final')) |
173 | 284 | self.prefer_final_build_system = options.get_bool( | 284 | self.accept_buildout_test_releases = options.get_bool( |
174 | 285 | 'prefer-final-build-system') | 285 | 'accept-buildout-test-releases') |
175 | 286 | zc.buildout.easy_install.use_dependency_links( | 286 | zc.buildout.easy_install.use_dependency_links( |
176 | 287 | options.get_bool('use-dependency-links')) | 287 | options.get_bool('use-dependency-links')) |
177 | 288 | zc.buildout.easy_install.allow_picked_versions( | 288 | zc.buildout.easy_install.allow_picked_versions( |
178 | @@ -338,7 +338,7 @@ | |||
179 | 338 | [options['develop-eggs-directory'], | 338 | [options['develop-eggs-directory'], |
180 | 339 | options['eggs-directory']], | 339 | options['eggs-directory']], |
181 | 340 | include_site_packages=_sys_executable_has_broken_dash_S, | 340 | include_site_packages=_sys_executable_has_broken_dash_S, |
183 | 341 | prefer_final = self.prefer_final_build_system, | 341 | prefer_final=not self.accept_buildout_test_releases, |
184 | 342 | ) | 342 | ) |
185 | 343 | else: | 343 | else: |
186 | 344 | ws = zc.buildout.easy_install.install( | 344 | ws = zc.buildout.easy_install.install( |
187 | @@ -350,7 +350,7 @@ | |||
188 | 350 | newest=self.newest, | 350 | newest=self.newest, |
189 | 351 | allow_hosts=self._allow_hosts, | 351 | allow_hosts=self._allow_hosts, |
190 | 352 | include_site_packages=_sys_executable_has_broken_dash_S, | 352 | include_site_packages=_sys_executable_has_broken_dash_S, |
192 | 353 | prefer_final = self.prefer_final_build_system, | 353 | prefer_final=not self.accept_buildout_test_releases, |
193 | 354 | ) | 354 | ) |
194 | 355 | 355 | ||
195 | 356 | # Now copy buildout and setuptools eggs, and record destination eggs: | 356 | # Now copy buildout and setuptools eggs, and record destination eggs: |
196 | @@ -373,7 +373,9 @@ | |||
197 | 373 | else: | 373 | else: |
198 | 374 | shutil.copy2(dist.location, dest) | 374 | shutil.copy2(dist.location, dest) |
199 | 375 | 375 | ||
201 | 376 | # Create buildout script | 376 | # Create buildout script. |
202 | 377 | # Ideally the (possibly) new version of buildout would get a | ||
203 | 378 | # chance to write the script. Not sure how to do that. | ||
204 | 377 | ws = pkg_resources.WorkingSet(entries) | 379 | ws = pkg_resources.WorkingSet(entries) |
205 | 378 | ws.require('zc.buildout') | 380 | ws.require('zc.buildout') |
206 | 379 | partsdir = os.path.join(options['parts-directory'], 'buildout') | 381 | partsdir = os.path.join(options['parts-directory'], 'buildout') |
207 | @@ -386,12 +388,19 @@ | |||
208 | 386 | else: | 388 | else: |
209 | 387 | assert relative_paths == 'false' | 389 | assert relative_paths == 'false' |
210 | 388 | relative_paths = '' | 390 | relative_paths = '' |
213 | 389 | # Ideally the (possibly) new version of buildout would get a | 391 | if (self.accept_buildout_test_releases and |
214 | 390 | # chance to write the script. Not sure how to do that. | 392 | self._annotated['buildout']['accept-buildout-test-releases'][1] == |
215 | 393 | 'COMMAND_LINE_VALUE'): | ||
216 | 394 | # Bootstrap was called with '--accept-buildout-test-releases'. | ||
217 | 395 | # Continue to honor that setting. | ||
218 | 396 | script_initialization = _early_release_initialization_code | ||
219 | 397 | else: | ||
220 | 398 | script_initialization = '' | ||
221 | 391 | zc.buildout.easy_install.sitepackage_safe_scripts( | 399 | zc.buildout.easy_install.sitepackage_safe_scripts( |
222 | 392 | options['bin-directory'], ws, options['executable'], partsdir, | 400 | options['bin-directory'], ws, options['executable'], partsdir, |
223 | 393 | reqs=['zc.buildout'], relative_paths=relative_paths, | 401 | reqs=['zc.buildout'], relative_paths=relative_paths, |
225 | 394 | include_site_packages=_sys_executable_has_broken_dash_S) | 402 | include_site_packages=_sys_executable_has_broken_dash_S, |
226 | 403 | script_initialization=script_initialization,) | ||
227 | 395 | 404 | ||
228 | 396 | init = bootstrap | 405 | init = bootstrap |
229 | 397 | 406 | ||
230 | @@ -838,7 +847,7 @@ | |||
231 | 838 | path = [options['develop-eggs-directory']], | 847 | path = [options['develop-eggs-directory']], |
232 | 839 | allow_hosts = self._allow_hosts, | 848 | allow_hosts = self._allow_hosts, |
233 | 840 | include_site_packages=_sys_executable_has_broken_dash_S, | 849 | include_site_packages=_sys_executable_has_broken_dash_S, |
235 | 841 | prefer_final=self.prefer_final_build_system, | 850 | prefer_final=not self.accept_buildout_test_releases, |
236 | 842 | ) | 851 | ) |
237 | 843 | 852 | ||
238 | 844 | upgraded = [] | 853 | upgraded = [] |
239 | @@ -886,18 +895,27 @@ | |||
240 | 886 | 895 | ||
241 | 887 | # the new dist is different, so we've upgraded. | 896 | # the new dist is different, so we've upgraded. |
242 | 888 | # Update the scripts and return True | 897 | # Update the scripts and return True |
243 | 898 | # Ideally the new version of buildout would get a chance to write the | ||
244 | 899 | # script. Not sure how to do that. | ||
245 | 889 | partsdir = os.path.join(options['parts-directory'], 'buildout') | 900 | partsdir = os.path.join(options['parts-directory'], 'buildout') |
246 | 890 | if os.path.exists(partsdir): | 901 | if os.path.exists(partsdir): |
247 | 891 | # This is primarily for unit tests, in which .py files change too | 902 | # This is primarily for unit tests, in which .py files change too |
248 | 892 | # fast for Python to know to regenerate the .pyc/.pyo files. | 903 | # fast for Python to know to regenerate the .pyc/.pyo files. |
249 | 893 | shutil.rmtree(partsdir) | 904 | shutil.rmtree(partsdir) |
250 | 894 | os.mkdir(partsdir) | 905 | os.mkdir(partsdir) |
253 | 895 | # Ideally the new version of buildout would get a chance to write the | 906 | if (self.accept_buildout_test_releases and |
254 | 896 | # script. Not sure how to do that. | 907 | self._annotated['buildout']['accept-buildout-test-releases'][1] == |
255 | 908 | 'COMMAND_LINE_VALUE'): | ||
256 | 909 | # Bootstrap was called with '--accept-buildout-test-releases'. | ||
257 | 910 | # Continue to honor that setting. | ||
258 | 911 | script_initialization = _early_release_initialization_code | ||
259 | 912 | else: | ||
260 | 913 | script_initialization = '' | ||
261 | 897 | zc.buildout.easy_install.sitepackage_safe_scripts( | 914 | zc.buildout.easy_install.sitepackage_safe_scripts( |
262 | 898 | options['bin-directory'], ws, sys.executable, partsdir, | 915 | options['bin-directory'], ws, sys.executable, partsdir, |
263 | 899 | reqs=['zc.buildout'], | 916 | reqs=['zc.buildout'], |
265 | 900 | include_site_packages=_sys_executable_has_broken_dash_S) | 917 | include_site_packages=_sys_executable_has_broken_dash_S, |
266 | 918 | script_initialization=script_initialization) | ||
267 | 901 | 919 | ||
268 | 902 | # Restart | 920 | # Restart |
269 | 903 | args = map(zc.buildout.easy_install._safe_arg, sys.argv) | 921 | args = map(zc.buildout.easy_install._safe_arg, sys.argv) |
270 | @@ -939,7 +957,7 @@ | |||
271 | 939 | index = self['buildout'].get('index'), | 957 | index = self['buildout'].get('index'), |
272 | 940 | newest=self.newest, allow_hosts=self._allow_hosts, | 958 | newest=self.newest, allow_hosts=self._allow_hosts, |
273 | 941 | include_site_packages=_sys_executable_has_broken_dash_S, | 959 | include_site_packages=_sys_executable_has_broken_dash_S, |
275 | 942 | prefer_final=self.prefer_final_build_system) | 960 | prefer_final=not self.accept_buildout_test_releases) |
276 | 943 | 961 | ||
277 | 944 | # Clear cache because extensions might now let us read pages we | 962 | # Clear cache because extensions might now let us read pages we |
278 | 945 | # couldn't read before. | 963 | # couldn't read before. |
279 | @@ -1055,7 +1073,7 @@ | |||
280 | 1055 | newest=buildout.newest, | 1073 | newest=buildout.newest, |
281 | 1056 | allow_hosts=buildout._allow_hosts, | 1074 | allow_hosts=buildout._allow_hosts, |
282 | 1057 | include_site_packages=_sys_executable_has_broken_dash_S, | 1075 | include_site_packages=_sys_executable_has_broken_dash_S, |
284 | 1058 | prefer_final=buildout.prefer_final_build_system) | 1076 | prefer_final=not buildout.accept_buildout_test_releases) |
285 | 1059 | 1077 | ||
286 | 1060 | __doing__ = 'Loading %s recipe entry %s:%s.', group, spec, entry | 1078 | __doing__ = 'Loading %s recipe entry %s:%s.', group, spec, entry |
287 | 1061 | return pkg_resources.load_entry_point( | 1079 | return pkg_resources.load_entry_point( |
288 | @@ -1526,6 +1544,13 @@ | |||
289 | 1526 | % (section, ' '.join(map(repr, unused))) | 1544 | % (section, ' '.join(map(repr, unused))) |
290 | 1527 | ) | 1545 | ) |
291 | 1528 | 1546 | ||
292 | 1547 | _early_release_initialization_code = """\ | ||
293 | 1548 | sys.argv.insert(1, 'buildout:accept-buildout-test-releases=true') | ||
294 | 1549 | print ('NOTE: Accepting early releases of build system packages. Rerun ' | ||
295 | 1550 | 'bootstrap without --accept-buildout-test-releases (-t) to return to ' | ||
296 | 1551 | 'default behavior.') | ||
297 | 1552 | """ | ||
298 | 1553 | |||
299 | 1529 | _usage = """\ | 1554 | _usage = """\ |
300 | 1530 | Usage: buildout [options] [assignments] [command [command arguments]] | 1555 | Usage: buildout [options] [assignments] [command [command arguments]] |
301 | 1531 | 1556 | ||
302 | 1532 | 1557 | ||
303 | === modified file 'src/zc/buildout/buildout.txt' | |||
304 | --- src/zc/buildout/buildout.txt 2010-08-19 02:27:43 +0000 | |||
305 | +++ src/zc/buildout/buildout.txt 2010-08-19 02:27:43 +0000 | |||
306 | @@ -729,6 +729,8 @@ | |||
307 | 729 | ================== | 729 | ================== |
308 | 730 | <BLANKLINE> | 730 | <BLANKLINE> |
309 | 731 | [buildout] | 731 | [buildout] |
310 | 732 | accept-buildout-test-releases= false | ||
311 | 733 | DEFAULT_VALUE | ||
312 | 732 | allow-hosts= * | 734 | allow-hosts= * |
313 | 733 | DEFAULT_VALUE | 735 | DEFAULT_VALUE |
314 | 734 | allow-picked-versions= true | 736 | allow-picked-versions= true |
315 | @@ -765,8 +767,6 @@ | |||
316 | 765 | DEFAULT_VALUE | 767 | DEFAULT_VALUE |
317 | 766 | prefer-final= false | 768 | prefer-final= false |
318 | 767 | DEFAULT_VALUE | 769 | DEFAULT_VALUE |
319 | 768 | prefer-final-build-system= true | ||
320 | 769 | DEFAULT_VALUE | ||
321 | 770 | python= buildout | 770 | python= buildout |
322 | 771 | DEFAULT_VALUE | 771 | DEFAULT_VALUE |
323 | 772 | relative-paths= false | 772 | relative-paths= false |
324 | @@ -2229,6 +2229,7 @@ | |||
325 | 2229 | <BLANKLINE> | 2229 | <BLANKLINE> |
326 | 2230 | Configuration data: | 2230 | Configuration data: |
327 | 2231 | [buildout] | 2231 | [buildout] |
328 | 2232 | accept-buildout-test-releases = false | ||
329 | 2232 | allow-hosts = * | 2233 | allow-hosts = * |
330 | 2233 | allow-picked-versions = true | 2234 | allow-picked-versions = true |
331 | 2234 | bin-directory = /sample-buildout/bin | 2235 | bin-directory = /sample-buildout/bin |
332 | @@ -2246,7 +2247,6 @@ | |||
333 | 2246 | parts = | 2247 | parts = |
334 | 2247 | parts-directory = /sample-buildout/parts | 2248 | parts-directory = /sample-buildout/parts |
335 | 2248 | prefer-final = false | 2249 | prefer-final = false |
336 | 2249 | prefer-final-build-system = true | ||
337 | 2250 | python = buildout | 2250 | python = buildout |
338 | 2251 | relative-paths = false | 2251 | relative-paths = false |
339 | 2252 | socket-timeout = | 2252 | socket-timeout = |
340 | @@ -2502,19 +2502,18 @@ | |||
341 | 2502 | releases that satisfy distribution requirements, then those releases | 2502 | releases that satisfy distribution requirements, then those releases |
342 | 2503 | are used even if newer non-final releases are available. | 2503 | are used even if newer non-final releases are available. |
343 | 2504 | 2504 | ||
344 | 2505 | In buildout version 2, all final releases will be preferred by | ||
345 | 2506 | default--that is ``prefer-final`` will also default to 'true'. You will | ||
346 | 2507 | then need to use a 'false' value for ``prefer-final`` to get the newest | ||
347 | 2508 | releases. | ||
348 | 2509 | |||
349 | 2505 | A separate option controls the behavior of the build system itself. | 2510 | A separate option controls the behavior of the build system itself. |
350 | 2506 | When buildout looks for recipes, extensions, and for updates to itself, | 2511 | When buildout looks for recipes, extensions, and for updates to itself, |
351 | 2507 | it does prefer final releases by default, as of the 1.5.0 release. The | 2512 | it does prefer final releases by default, as of the 1.5.0 release. The |
362 | 2508 | ``prefer-final-build-system`` option will let you override this behavior. | 2513 | ``accept-buildout-test-releases`` option will let you override this behavior. |
363 | 2509 | 2514 | However, it is typically changed by the --accept-buildout-test-releases | |
364 | 2510 | [buildout] | 2515 | option to the bootstrap script, since bootstrapping is the first step to |
365 | 2511 | ... | 2516 | selecting a buildout. |
356 | 2512 | prefer-final-build-system = false | ||
357 | 2513 | |||
358 | 2514 | In buildout version 2, all final releases will be preferred by | ||
359 | 2515 | default--that is ``prefer-final`` will also default to 'true'. You will | ||
360 | 2516 | then need to use a 'false' value for ``prefer-final`` to get the newest | ||
361 | 2517 | releases, like with ``prefer-final-build-system``. | ||
366 | 2518 | 2517 | ||
367 | 2519 | Finding distributions | 2518 | Finding distributions |
368 | 2520 | --------------------- | 2519 | --------------------- |
369 | 2521 | 2520 | ||
370 | === modified file 'src/zc/buildout/tests.py' | |||
371 | --- src/zc/buildout/tests.py 2010-08-19 02:27:43 +0000 | |||
372 | +++ src/zc/buildout/tests.py 2010-08-19 02:27:43 +0000 | |||
373 | @@ -3128,9 +3128,11 @@ | |||
374 | 3128 | 3128 | ||
375 | 3129 | def buildout_prefer_final_build_system_option(): | 3129 | def buildout_prefer_final_build_system_option(): |
376 | 3130 | """ | 3130 | """ |
378 | 3131 | The prefer-final-build-system buildout option can be used for overriding | 3131 | The accept-buildout-test-releases buildout option can be used for overriding |
379 | 3132 | the default preference for final distributions for recipes, buildout | 3132 | the default preference for final distributions for recipes, buildout |
381 | 3133 | extensions, and buildout itself. | 3133 | extensions, and buildout itself. It is usually controlled via the bootstrap |
382 | 3134 | script rather than in the configuration file, but we will test the machinery | ||
383 | 3135 | using the file. | ||
384 | 3134 | 3136 | ||
385 | 3135 | Set up. This creates sdists for demorecipe 1.0 and 1.1b1, and for | 3137 | Set up. This creates sdists for demorecipe 1.0 and 1.1b1, and for |
386 | 3136 | demoextension 1.0 and 1.1b1. | 3138 | demoextension 1.0 and 1.1b1. |
387 | @@ -3138,7 +3140,7 @@ | |||
388 | 3138 | >>> create_sample_recipe_sdists(sample_eggs) | 3140 | >>> create_sample_recipe_sdists(sample_eggs) |
389 | 3139 | >>> create_sample_extension_sdists(sample_eggs) | 3141 | >>> create_sample_extension_sdists(sample_eggs) |
390 | 3140 | 3142 | ||
392 | 3141 | The default is prefer-final-build-system = true: | 3143 | The default is accept-buildout-test-releases = false: |
393 | 3142 | 3144 | ||
394 | 3143 | >>> write('buildout.cfg', | 3145 | >>> write('buildout.cfg', |
395 | 3144 | ... ''' | 3146 | ... ''' |
396 | @@ -3161,7 +3163,7 @@ | |||
397 | 3161 | Here we see that the final versions of demorecipe and demoextension were used. | 3163 | Here we see that the final versions of demorecipe and demoextension were used. |
398 | 3162 | 3164 | ||
399 | 3163 | We get the same behavior if we explicitly state that | 3165 | We get the same behavior if we explicitly state that |
401 | 3164 | prefer-final-build-system = true. | 3166 | accept-buildout-test-releases = false. |
402 | 3165 | 3167 | ||
403 | 3166 | >>> write('buildout.cfg', | 3168 | >>> write('buildout.cfg', |
404 | 3167 | ... ''' | 3169 | ... ''' |
405 | @@ -3169,7 +3171,7 @@ | |||
406 | 3169 | ... parts = demo | 3171 | ... parts = demo |
407 | 3170 | ... find-links = %(link_server)s | 3172 | ... find-links = %(link_server)s |
408 | 3171 | ... extensions = demoextension | 3173 | ... extensions = demoextension |
410 | 3172 | ... prefer-final-build-system = true | 3174 | ... accept-buildout-test-releases = false |
411 | 3173 | ... | 3175 | ... |
412 | 3174 | ... [demo] | 3176 | ... [demo] |
413 | 3175 | ... recipe = demorecipe | 3177 | ... recipe = demorecipe |
414 | @@ -3182,7 +3184,7 @@ | |||
415 | 3182 | Picked: demorecipe = 1.0 | 3184 | Picked: demorecipe = 1.0 |
416 | 3183 | ... | 3185 | ... |
417 | 3184 | 3186 | ||
419 | 3185 | If we specify prefer-final-build-system = false, we'll get the newest | 3187 | If we specify accept-buildout-test-releases = true, we'll get the newest |
420 | 3186 | distributions in the build system: | 3188 | distributions in the build system: |
421 | 3187 | 3189 | ||
422 | 3188 | >>> write('buildout.cfg', | 3190 | >>> write('buildout.cfg', |
423 | @@ -3191,7 +3193,7 @@ | |||
424 | 3191 | ... parts = demo | 3193 | ... parts = demo |
425 | 3192 | ... find-links = %(link_server)s | 3194 | ... find-links = %(link_server)s |
426 | 3193 | ... extensions = demoextension | 3195 | ... extensions = demoextension |
428 | 3194 | ... prefer-final-build-system = false | 3196 | ... accept-buildout-test-releases = true |
429 | 3195 | ... | 3197 | ... |
430 | 3196 | ... [demo] | 3198 | ... [demo] |
431 | 3197 | ... recipe = demorecipe | 3199 | ... recipe = demorecipe |
432 | @@ -3212,7 +3214,7 @@ | |||
433 | 3212 | ... parts = demo | 3214 | ... parts = demo |
434 | 3213 | ... find-links = %(link_server)s | 3215 | ... find-links = %(link_server)s |
435 | 3214 | ... extensions = demoextension | 3216 | ... extensions = demoextension |
437 | 3215 | ... prefer-final-build-system = no | 3217 | ... accept-buildout-test-releases = no |
438 | 3216 | ... | 3218 | ... |
439 | 3217 | ... [demo] | 3219 | ... [demo] |
440 | 3218 | ... recipe = demorecipe | 3220 | ... recipe = demorecipe |
441 | @@ -3221,7 +3223,7 @@ | |||
442 | 3221 | >>> print system(buildout+' -v'), # doctest: +ELLIPSIS | 3223 | >>> print system(buildout+' -v'), # doctest: +ELLIPSIS |
443 | 3222 | While: | 3224 | While: |
444 | 3223 | Initializing. | 3225 | Initializing. |
446 | 3224 | Error: Invalid value for prefer-final-build-system option: no | 3226 | Error: Invalid value for accept-buildout-test-releases option: no |
447 | 3225 | 3227 | ||
448 | 3226 | """ | 3228 | """ |
449 | 3227 | 3229 | ||
450 | 3228 | 3230 | ||
451 | === modified file 'src/zc/buildout/update.txt' | |||
452 | --- src/zc/buildout/update.txt 2010-08-19 02:27:43 +0000 | |||
453 | +++ src/zc/buildout/update.txt 2010-08-19 02:27:43 +0000 | |||
454 | @@ -81,8 +81,10 @@ | |||
455 | 81 | 81 | ||
456 | 82 | Notice that, even though we have a newer beta version of zc.buildout | 82 | Notice that, even though we have a newer beta version of zc.buildout |
457 | 83 | available, the final "99.99" was selected. If you want to get non-final | 83 | available, the final "99.99" was selected. If you want to get non-final |
460 | 84 | versions, specify a specific version in your buildout's versions section, | 84 | versions, specify a specific version in your buildout's versions |
461 | 85 | or use the ``prefer-final-build-system = false`` discussed below. | 85 | section, you typically want to use the --accept-buildout-test-releases |
462 | 86 | option to the bootstrap script, which internally uses the | ||
463 | 87 | ``accept-buildout-test-releases = true`` discussed below. | ||
464 | 86 | 88 | ||
465 | 87 | Our buildout script's site.py has been updated to use the new eggs: | 89 | Our buildout script's site.py has been updated to use the new eggs: |
466 | 88 | 90 | ||
467 | @@ -194,9 +196,14 @@ | |||
468 | 194 | 196 | ||
469 | 195 | >>> ls('bin') | 197 | >>> ls('bin') |
470 | 196 | 198 | ||
474 | 197 | Notice that, as mentioned above, the ``prefer-final-build-system = | 199 | As mentioned above, the ``accept-buildout-test-releases = true`` means that |
475 | 198 | false`` means that newer non-final versions of these dependencies are | 200 | newer non-final versions of these dependencies are preferred. Typically |
476 | 199 | preferred. | 201 | users are not expected to actually manipulate this value. Instead, the |
477 | 202 | bootstrap script creates a buildout buildout script that passes in the | ||
478 | 203 | value as a command line override. This then results in the buildout | ||
479 | 204 | script being rewritten to remember the decision. | ||
480 | 205 | |||
481 | 206 | We'll mimic this by passing the argument actually in the command line. | ||
482 | 200 | 207 | ||
483 | 201 | >>> cd(sample_buildout) | 208 | >>> cd(sample_buildout) |
484 | 202 | >>> write(sample_buildout, 'buildout.cfg', | 209 | >>> write(sample_buildout, 'buildout.cfg', |
485 | @@ -206,20 +213,39 @@ | |||
486 | 206 | ... index = %(new_releases)s | 213 | ... index = %(new_releases)s |
487 | 207 | ... parts = show-versions | 214 | ... parts = show-versions |
488 | 208 | ... develop = showversions | 215 | ... develop = showversions |
489 | 209 | ... prefer-final-build-system = false | ||
490 | 210 | ... | 216 | ... |
491 | 211 | ... [show-versions] | 217 | ... [show-versions] |
492 | 212 | ... recipe = showversions | 218 | ... recipe = showversions |
493 | 213 | ... """ % dict(new_releases=new_releases)) | 219 | ... """ % dict(new_releases=new_releases)) |
494 | 214 | 220 | ||
496 | 215 | >>> print system(buildout), | 221 | >>> print system(buildout + |
497 | 222 | ... ' buildout:accept-buildout-test-releases=true'), | ||
498 | 223 | ... # doctest: +NORMALIZE_WHITESPACE | ||
499 | 216 | Getting distribution for 'zc.buildout'. | 224 | Getting distribution for 'zc.buildout'. |
500 | 217 | Got zc.buildout 100.0b1. | 225 | Got zc.buildout 100.0b1. |
501 | 218 | Upgraded: | 226 | Upgraded: |
502 | 219 | zc.buildout version 100.0b1, | 227 | zc.buildout version 100.0b1, |
503 | 220 | setuptools version 99.99; | 228 | setuptools version 99.99; |
504 | 221 | restarting. | 229 | restarting. |
505 | 230 | Generated script '/sample-buildout/bin/buildout'. | ||
506 | 231 | NOTE: Accepting early releases of build system packages. Rerun bootstrap | ||
507 | 232 | without --accept-buildout-test-releases (-t) to return to default | ||
508 | 233 | behavior. | ||
509 | 222 | Develop: '/sample-buildout/showversions' | 234 | Develop: '/sample-buildout/showversions' |
510 | 223 | Updating show-versions. | 235 | Updating show-versions. |
511 | 224 | zc.buildout 100.0b1 | 236 | zc.buildout 100.0b1 |
512 | 225 | setuptools 99.99 | 237 | setuptools 99.99 |
513 | 238 | |||
514 | 239 | The buildout script shows the change. | ||
515 | 240 | |||
516 | 241 | >>> buildout_script = join(sample_buildout, 'bin', 'buildout') | ||
517 | 242 | >>> import sys | ||
518 | 243 | >>> if sys.platform.startswith('win'): | ||
519 | 244 | ... buildout_script += '-script.py' | ||
520 | 245 | >>> print open(buildout_script).read() # doctest: +ELLIPSIS | ||
521 | 246 | #... | ||
522 | 247 | sys.argv.insert(1, 'buildout:accept-buildout-test-releases=true') | ||
523 | 248 | print ('NOTE: Accepting early releases of build system packages. Rerun ' | ||
524 | 249 | 'bootstrap without --accept-buildout-test-releases (-t) to return to ' | ||
525 | 250 | 'default behavior.') | ||
526 | 251 | ... |
This is great, thanks for doing this.
I think losing the parallel with prefer-final is not important since that's really an 'internal' configuration value. The API is the command-line switch.