Merge lp:~gary/zc.buildout/python-support-3-options into lp:zc.buildout
- python-support-3-options
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~gary/zc.buildout/python-support-3-options |
Merge into: | lp:zc.buildout |
Prerequisite: | lp:~gary/zc.buildout/python-support-2-bootstrap |
Diff against target: |
672 lines (+233/-169) 5 files modified
CHANGES.txt (+6/-0) src/zc/buildout/buildout.py (+51/-42) src/zc/buildout/buildout.txt (+162/-116) src/zc/buildout/tests.py (+3/-0) zc.recipe.egg_/src/zc/recipe/egg/egg.py (+11/-11) |
To merge this branch: | bzr merge lp:~gary/zc.buildout/python-support-3-options |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Francis J. Lacoste (community) | Approve | ||
Review via email: mp+19539@code.launchpad.net |
Commit message
Description of the change
- 542. By Gary Poster
-
propagate merge from gary-2 <- gary-1 <- trunk
Francis J. Lacoste (flacoste) wrote : | # |
Hi Gary,
Everything looks fine, the only snippet I don't understand is that one
> === modified file 'src/zc/
> --- src/zc/
> +++ src/zc/
> @@ -2981,6 +2981,9 @@
> '-q develop -mxN -d /sample-
> ),
> (re.compile(
> + # for bug_92891_
> + (re.compile(
> + "Unused options for buildout: 'scripts' 'eggs'."),
> ]),
> ),
> zc.buildout.
>
I assume it's good, but I'd like to have an explanation for it, since you
didn't mention it in your presentation.
Cheers
Gary Poster (gary) wrote : | # |
Thank you, Francis.
Yes, arguably this should have gone in the first branch, since it is a test cleanup, though it is a test cleanup of the option code so I put it over here. It doesn't have anything specifically to do with the basic point of the branch, so it was a good catch to bring up.
The order that the unused options were presented ("'eggs' 'scripts'" or "'scripts' 'eggs'") varied across Python versions. I could have changed the generation to order alphabetically (or similarly), but instead I normalized in the test results.
Gary
Unmerged revisions
- 542. By Gary Poster
-
propagate merge from gary-2 <- gary-1 <- trunk
- 541. By gary
-
push whitespace changes across branches
- 540. By gary
-
svn merge -r 108901:108902 svn+ssh:
//svn.zope. org/repos/ main/zc. buildout/ branches/ gary-2 - 539. By gary
-
merge gary-3-
options- cleanup with trunk - 538. By gary
-
branch to merge gary-3-
options- cleanup with trunk - 537. By gary
-
merge of gary-2-
bootstrap- changes into trunk, resolving lots of conflicts with the distribute changes. - 536. By gary
-
look, more branches from Gary!
Preview Diff
1 | === modified file 'CHANGES.txt' |
2 | --- CHANGES.txt 2010-02-17 21:27:15 +0000 |
3 | +++ CHANGES.txt 2010-02-17 21:27:15 +0000 |
4 | @@ -17,6 +17,12 @@ |
5 | * The buildout script generated by bootstrap honors more of the settings |
6 | in the designated configuration file (e.g., buildout.cfg). |
7 | |
8 | +Bugs fixed: |
9 | + |
10 | +- The handling and documenting of default buildout options was normalized. |
11 | + This means, among other things, that ``bin/buildout -vv`` and |
12 | + ``bin/buildout annotate`` correctly list more of the options. |
13 | + |
14 | 1.4.3 (2009-12-10) |
15 | ================== |
16 | |
17 | |
18 | === modified file 'src/zc/buildout/buildout.py' |
19 | --- src/zc/buildout/buildout.py 2010-02-17 21:27:15 +0000 |
20 | +++ src/zc/buildout/buildout.py 2010-02-17 21:27:15 +0000 |
21 | @@ -112,15 +112,24 @@ |
22 | return data |
23 | |
24 | _buildout_default_options = _annotate_section({ |
25 | + 'allow-hosts': '*', |
26 | + 'allow-picked-versions': 'true', |
27 | + 'bin-directory': 'bin', |
28 | + 'develop-eggs-directory': 'develop-eggs', |
29 | 'eggs-directory': 'eggs', |
30 | - 'develop-eggs-directory': 'develop-eggs', |
31 | - 'bin-directory': 'bin', |
32 | + 'executable': sys.executable, |
33 | + 'find-links': '', |
34 | + 'install-from-cache': 'false', |
35 | + 'installed': '.installed.cfg', |
36 | + 'log-format': '', |
37 | + 'log-level': 'INFO', |
38 | + 'newest': 'true', |
39 | + 'offline': 'false', |
40 | 'parts-directory': 'parts', |
41 | - 'installed': '.installed.cfg', |
42 | + 'prefer-final': 'false', |
43 | 'python': 'buildout', |
44 | - 'executable': sys.executable, |
45 | - 'log-level': 'INFO', |
46 | - 'log-format': '', |
47 | + 'unzip': 'false', |
48 | + 'use-dependency-links': 'true', |
49 | }, 'DEFAULT_VALUE') |
50 | |
51 | |
52 | @@ -191,7 +200,7 @@ |
53 | # provide some defaults before options are parsed |
54 | # because while parsing options those attributes might be |
55 | # used already (Gottfried Ganssauge) |
56 | - buildout_section = data.get('buildout') |
57 | + buildout_section = data['buildout'] |
58 | |
59 | # Try to make sure we have absolute paths for standard |
60 | # directories. We do this before doing substitutions, in case |
61 | @@ -204,22 +213,28 @@ |
62 | d = self._buildout_path(buildout_section[name+'-directory']) |
63 | buildout_section[name+'-directory'] = d |
64 | |
65 | - links = buildout_section and buildout_section.get('find-links', '') |
66 | + # Attributes on this buildout object shouldn't be used by |
67 | + # recipes in their __init__. It can cause bugs, because the |
68 | + # recipes will be instantiated below (``options = self['buildout']``) |
69 | + # before this has completed initializing. These attributes are |
70 | + # left behind for legacy support but recipe authors should |
71 | + # beware of using them. A better practice is for a recipe to |
72 | + # use the buildout['buildout'] options. |
73 | + links = buildout_section['find-links'] |
74 | self._links = links and links.split() or () |
75 | - |
76 | - allow_hosts = buildout_section and buildout_section.get( |
77 | - 'allow-hosts', '*').split('\n') |
78 | + allow_hosts = buildout_section['allow-hosts'].split('\n') |
79 | self._allow_hosts = tuple([host.strip() for host in allow_hosts |
80 | if host.strip() != '']) |
81 | - |
82 | self._logger = logging.getLogger('zc.buildout') |
83 | - self.offline = False |
84 | - self.newest = True |
85 | + self.offline = (buildout_section['offline'] == 'true') |
86 | + self.newest = (buildout_section['newest'] == 'true') |
87 | |
88 | ################################################################## |
89 | ## WARNING!!! |
90 | ## ALL ATTRIBUTES MUST HAVE REASONABLE DEFAULTS AT THIS POINT |
91 | - ## OTHERWISE ATTRIBUTEERRORS MIGHT HAPPEN ANY TIME |
92 | + ## OTHERWISE ATTRIBUTEERRORS MIGHT HAPPEN ANY TIME FROM RECIPES. |
93 | + ## RECIPES SHOULD GENERALLY USE buildout['buildout'] OPTIONS, NOT |
94 | + ## BUILDOUT ATTRIBUTES. |
95 | ################################################################## |
96 | # initialize some attrs and buildout directories. |
97 | options = self['buildout'] |
98 | @@ -228,7 +243,7 @@ |
99 | links = options.get('find-links', '') |
100 | self._links = links and links.split() or () |
101 | |
102 | - allow_hosts = options.get('allow-hosts', '*').split('\n') |
103 | + allow_hosts = options['allow-hosts'].split('\n') |
104 | self._allow_hosts = tuple([host.strip() for host in allow_hosts |
105 | if host.strip() != '']) |
106 | |
107 | @@ -246,44 +261,42 @@ |
108 | |
109 | self._setup_logging() |
110 | |
111 | - offline = options.get('offline', 'false') |
112 | + offline = options['offline'] |
113 | if offline not in ('true', 'false'): |
114 | self._error('Invalid value for offline option: %s', offline) |
115 | - options['offline'] = offline |
116 | - self.offline = offline == 'true' |
117 | + self.offline = (offline == 'true') |
118 | |
119 | if self.offline: |
120 | newest = options['newest'] = 'false' |
121 | else: |
122 | - newest = options.get('newest', 'true') |
123 | + newest = options['newest'] |
124 | if newest not in ('true', 'false'): |
125 | self._error('Invalid value for newest option: %s', newest) |
126 | - options['newest'] = newest |
127 | - self.newest = newest == 'true' |
128 | + self.newest = (newest == 'true') |
129 | |
130 | versions = options.get('versions') |
131 | if versions: |
132 | zc.buildout.easy_install.default_versions(dict(self[versions])) |
133 | |
134 | - prefer_final = options.get('prefer-final', 'false') |
135 | + prefer_final = options['prefer-final'] |
136 | if prefer_final not in ('true', 'false'): |
137 | self._error('Invalid value for prefer-final option: %s', |
138 | prefer_final) |
139 | zc.buildout.easy_install.prefer_final(prefer_final=='true') |
140 | |
141 | - use_dependency_links = options.get('use-dependency-links', 'true') |
142 | + use_dependency_links = options['use-dependency-links'] |
143 | if use_dependency_links not in ('true', 'false'): |
144 | self._error('Invalid value for use-dependency-links option: %s', |
145 | use_dependency_links) |
146 | zc.buildout.easy_install.use_dependency_links( |
147 | use_dependency_links == 'true') |
148 | |
149 | - allow_picked_versions = options.get('allow-picked-versions', 'true') |
150 | + allow_picked_versions = options['allow-picked-versions'] |
151 | if allow_picked_versions not in ('true', 'false'): |
152 | self._error('Invalid value for allow-picked-versions option: %s', |
153 | allow_picked_versions) |
154 | zc.buildout.easy_install.allow_picked_versions( |
155 | - allow_picked_versions=='true') |
156 | + allow_picked_versions == 'true') |
157 | |
158 | download_cache = options.get('download-cache') |
159 | if download_cache: |
160 | @@ -300,22 +313,18 @@ |
161 | |
162 | zc.buildout.easy_install.download_cache(download_cache) |
163 | |
164 | - install_from_cache = options.get('install-from-cache') |
165 | - if install_from_cache: |
166 | - if install_from_cache not in ('true', 'false'): |
167 | - self._error('Invalid value for install-from-cache option: %s', |
168 | - install_from_cache) |
169 | - if install_from_cache == 'true': |
170 | - zc.buildout.easy_install.install_from_cache(True) |
171 | - |
172 | - |
173 | - always_unzip = options.get('unzip') |
174 | - if always_unzip: |
175 | - if always_unzip not in ('true', 'false'): |
176 | - self._error('Invalid value for unzip option: %s', |
177 | - always_unzip) |
178 | - if always_unzip == 'true': |
179 | - zc.buildout.easy_install.always_unzip(True) |
180 | + install_from_cache = options['install-from-cache'] |
181 | + if install_from_cache not in ('true', 'false'): |
182 | + self._error('Invalid value for install-from-cache option: %s', |
183 | + install_from_cache) |
184 | + zc.buildout.easy_install.install_from_cache( |
185 | + install_from_cache=='true') |
186 | + |
187 | + always_unzip = options['unzip'] |
188 | + if always_unzip not in ('true', 'false'): |
189 | + self._error('Invalid value for unzip option: %s', |
190 | + always_unzip) |
191 | + zc.buildout.easy_install.always_unzip(always_unzip=='true') |
192 | |
193 | # "Use" each of the defaults so they aren't reported as unused options. |
194 | for name in _buildout_default_options: |
195 | |
196 | === modified file 'src/zc/buildout/buildout.txt' |
197 | --- src/zc/buildout/buildout.txt 2009-11-06 22:33:23 +0000 |
198 | +++ src/zc/buildout/buildout.txt 2010-02-17 21:27:15 +0000 |
199 | @@ -576,7 +576,7 @@ |
200 | .. Wait for the file to really disappear. My linux is weird. |
201 | |
202 | >>> wait_until("foo goes away", lambda : not os.path.exists('foo'), |
203 | - ... timeout=100) |
204 | + ... timeout=200) |
205 | |
206 | we get the same error, but we don't get the directory left behind: |
207 | |
208 | @@ -724,6 +724,10 @@ |
209 | ================== |
210 | <BLANKLINE> |
211 | [buildout] |
212 | + allow-hosts= * |
213 | + DEFAULT_VALUE |
214 | + allow-picked-versions= true |
215 | + DEFAULT_VALUE |
216 | bin-directory= bin |
217 | DEFAULT_VALUE |
218 | develop= recipes |
219 | @@ -736,18 +740,32 @@ |
220 | DEFAULT_VALUE |
221 | executable= ... |
222 | DEFAULT_VALUE |
223 | + find-links= |
224 | + DEFAULT_VALUE |
225 | + install-from-cache= false |
226 | + DEFAULT_VALUE |
227 | installed= .installed.cfg |
228 | DEFAULT_VALUE |
229 | log-format= |
230 | DEFAULT_VALUE |
231 | log-level= INFO |
232 | DEFAULT_VALUE |
233 | + newest= true |
234 | + DEFAULT_VALUE |
235 | + offline= false |
236 | + DEFAULT_VALUE |
237 | parts= data-dir |
238 | /sample-buildout/buildout.cfg |
239 | parts-directory= parts |
240 | DEFAULT_VALUE |
241 | + prefer-final= false |
242 | + DEFAULT_VALUE |
243 | python= buildout |
244 | DEFAULT_VALUE |
245 | + unzip= false |
246 | + DEFAULT_VALUE |
247 | + use-dependency-links= true |
248 | + DEFAULT_VALUE |
249 | <BLANKLINE> |
250 | [data-dir] |
251 | path= foo bins |
252 | @@ -2194,17 +2212,21 @@ |
253 | |
254 | >>> print system(buildout+' -vv'), # doctest: +NORMALIZE_WHITESPACE |
255 | Installing 'zc.buildout', 'setuptools'. |
256 | - We have a develop egg: zc.buildout 1.0.0. |
257 | + We have a develop egg: zc.buildout X.X. |
258 | We have the best distribution that satisfies 'setuptools'. |
259 | - Picked: setuptools = 0.6 |
260 | + Picked: setuptools = V.V |
261 | <BLANKLINE> |
262 | Configuration data: |
263 | [buildout] |
264 | + allow-hosts = * |
265 | + allow-picked-versions = true |
266 | bin-directory = /sample-buildout/bin |
267 | develop-eggs-directory = /sample-buildout/develop-eggs |
268 | directory = /sample-buildout |
269 | eggs-directory = /sample-buildout/eggs |
270 | - executable = /usr/local/bin/python2.3 |
271 | + executable = python |
272 | + find-links = |
273 | + install-from-cache = false |
274 | installed = /sample-buildout/.installed.cfg |
275 | log-format = |
276 | log-level = INFO |
277 | @@ -2212,7 +2234,10 @@ |
278 | offline = false |
279 | parts = |
280 | parts-directory = /sample-buildout/parts |
281 | + prefer-final = false |
282 | python = buildout |
283 | + unzip = false |
284 | + use-dependency-links = true |
285 | verbosity = 20 |
286 | <BLANKLINE> |
287 | |
288 | @@ -2220,6 +2245,37 @@ |
289 | command-line assignments. We've discussed most of these options |
290 | already, but let's review them and touch on some we haven't discussed: |
291 | |
292 | +allow-hosts |
293 | + On some environments the links visited by `zc.buildout` can be forbidden by |
294 | + paranoid firewalls. These URLs might be in the chain of links visited by |
295 | + `zc.buildout` as defined by buildout's `find-links` option, or as defined |
296 | + by various eggs in their `url`, `download_url`, `dependency_links` metadata. |
297 | + |
298 | + The fact that package_index works like a spider and might visit links and |
299 | + go to other locations makes this even harder. |
300 | + |
301 | + The `allow-hosts` option provides a way to prevent this, and |
302 | + works exactly like the one provided in `easy_install`. |
303 | + |
304 | + You can provide a list of allowed host, together with wildcards:: |
305 | + |
306 | + [buildout] |
307 | + ... |
308 | + |
309 | + allow-hosts = |
310 | + *.python.org |
311 | + example.com |
312 | + |
313 | + All URLs that does not match these hosts will not be visited. |
314 | + |
315 | +allow-picked-versions |
316 | + By default, the buildout will choose the best match for a given requirement |
317 | + if the requirement is not specified precisely (for instance, using the |
318 | + "versions" option. This behavior corresponds to the |
319 | + "allow-picked-versions" being set to its default value, "true". If |
320 | + "allow-picked-versions" is "false," instead of picking the best match, |
321 | + buildout will raise an error. This helps enforce repeatability. |
322 | + |
323 | bin-directory |
324 | The directory path where scripts are written. This can be a |
325 | relative path, which is interpreted relative to the directory |
326 | @@ -2244,6 +2300,47 @@ |
327 | The Python executable used to run the buildout. See the python |
328 | option below. |
329 | |
330 | +find-links |
331 | + You can specify more locations to search for distributions using the |
332 | + `find-links` option. All locations specified will be searched for |
333 | + distributions along with the package index as described before. |
334 | + |
335 | + Locations can be urls:: |
336 | + |
337 | + [buildout] |
338 | + ... |
339 | + find-links = http://download.zope.org/distribution/ |
340 | + |
341 | + They can also be directories on disk:: |
342 | + |
343 | + [buildout] |
344 | + ... |
345 | + find-links = /some/path |
346 | + |
347 | + Finally, they can also be direct paths to distributions:: |
348 | + |
349 | + [buildout] |
350 | + ... |
351 | + find-links = /some/path/someegg-1.0.0-py2.3.egg |
352 | + |
353 | + Any number of locations can be specified in the `find-links` option:: |
354 | + |
355 | + [buildout] |
356 | + ... |
357 | + find-links = |
358 | + http://download.zope.org/distribution/ |
359 | + /some/otherpath |
360 | + /some/path/someegg-1.0.0-py2.3.egg |
361 | + |
362 | +install-from-cache |
363 | + A download cache can be used as the basis of application source releases. |
364 | + In an application source release, we want to distribute an application that |
365 | + can be built without making any network accesses. In this case, we |
366 | + distribute a buildout with download cache and tell the buildout to install |
367 | + from the download cache only, without making network accesses. The |
368 | + buildout install-from-cache option can be used to signal that packages |
369 | + should be installed only from the download cache. |
370 | + |
371 | installed |
372 | The file path where information about the results of the previous |
373 | buildout run is written. This can be a relative path, which is |
374 | @@ -2257,12 +2354,51 @@ |
375 | log-level |
376 | The log level before verbosity adjustment |
377 | |
378 | +newest |
379 | + By default buildout and recipes will try to find the newest versions of |
380 | + distributions needed to satisfy requirements. This can be very time |
381 | + consuming, especially when incrementally working on setting up a buildout |
382 | + or working on a recipe. The buildout "newest" option can be used to to |
383 | + suppress this. If the "newest" option is set to false, then new |
384 | + distributions won't be sought if an installed distribution meets |
385 | + requirements. The "newest" option can also be set to false using the -N |
386 | + command-line option. See also the "offline" option. |
387 | + |
388 | +offline |
389 | + The "offline" option goes a bit further than the "newest" option. If the |
390 | + buildout "offline" option is given a value of "true", the buildout and |
391 | + recipes that are aware of the option will avoid doing network access. This |
392 | + is handy when running the buildout when not connected to the internet. It |
393 | + also makes buildouts run much faster. This option is typically set using |
394 | + the buildout -o option. |
395 | + |
396 | parts |
397 | A white space separated list of parts to be installed. |
398 | |
399 | parts-directory |
400 | A working directory that parts can used to store data. |
401 | |
402 | +prefer-final |
403 | + Currently, when searching for new releases, the newest available |
404 | + release is used. This isn't usually ideal, as you may get a |
405 | + development release or alpha releases not ready to be widely used. |
406 | + You can request that final releases be preferred using the prefer |
407 | + final option in the buildout section:: |
408 | + |
409 | + [buildout] |
410 | + ... |
411 | + prefer-final = true |
412 | + |
413 | + When the prefer-final option is set to true, then when searching for |
414 | + new releases, final releases are preferred. If there are final |
415 | + releases that satisfy distribution requirements, then those releases |
416 | + are used even if newer non-final releases are available. The buildout |
417 | + prefer-final option can be used to override this behavior. |
418 | + |
419 | + In buildout version 2, final releases will be preferred by default. |
420 | + You will then need to use a false value for prefer-final to get the |
421 | + newest releases. |
422 | + |
423 | python |
424 | The name of a section containing information about the default |
425 | Python interpreter. Recipes that need a installation |
426 | @@ -2273,6 +2409,26 @@ |
427 | Python executable. By default, the buildout section defines the |
428 | default Python as the Python used to run the buildout. |
429 | |
430 | +unzip |
431 | + By default, zc.buildout doesn't unzip zip-safe eggs ("unzip = false"). |
432 | + This follows the policy followed by setuptools itself. Experience shows |
433 | + this policy to to be inconvenient. Zipped eggs make debugging more |
434 | + difficult and often import more slowly. You can include an unzip option in |
435 | + the buildout section to change the default unzipping policy ("unzip = |
436 | + true"). |
437 | + |
438 | +use-dependency-links |
439 | + By default buildout will obey the setuptools dependency_links metadata |
440 | + when it looks for dependencies. This behavior can be controlled with |
441 | + the use-dependency-links buildout option:: |
442 | + |
443 | + [buildout] |
444 | + ... |
445 | + use-dependency-links = false |
446 | + |
447 | + The option defaults to true. If you set it to false, then dependency |
448 | + links are only looked for in the locations specified by find-links. |
449 | + |
450 | verbosity |
451 | A log-level adjustment. Typically, this is set via the -q and -v |
452 | command-line options. |
453 | @@ -2351,48 +2507,6 @@ |
454 | Generated script '/sample-bootstrapped2/bin/buildout'. |
455 | |
456 | |
457 | -Newest and Offline Modes |
458 | ------------------------- |
459 | - |
460 | -By default buildout and recipes will try to find the newest versions |
461 | -of distributions needed to satisfy requirements. This can be very |
462 | -time consuming, especially when incrementally working on setting up a |
463 | -buildout or working on a recipe. The buildout newest option can be |
464 | -used to to suppress this. If the newest option is set to false, then |
465 | -new distributions won't be sought if an installed distribution meets |
466 | -requirements. The newest option can be set to false using the -N |
467 | -command-line option. |
468 | - |
469 | -The offline option goes a bit further. If the buildout offline option |
470 | -is given a value of "true", the buildout and recipes that are aware of |
471 | -the option will avoid doing network access. This is handy when |
472 | -running the buildout when not connected to the internet. It also |
473 | -makes buildouts run much faster. This option is typically set using |
474 | -the buildout -o option. |
475 | - |
476 | -Preferring Final Releases |
477 | -------------------------- |
478 | - |
479 | -Currently, when searching for new releases, the newest available |
480 | -release is used. This isn't usually ideal, as you may get a |
481 | -development release or alpha releases not ready to be widely used. |
482 | -You can request that final releases be preferred using the prefer |
483 | -final option in the buildout section:: |
484 | - |
485 | - [buildout] |
486 | - ... |
487 | - prefer-final = true |
488 | - |
489 | -When the prefer-final option is set to true, then when searching for |
490 | -new releases, final releases are preferred. If there are final |
491 | -releases that satisfy distribution requirements, then those releases |
492 | -are used even if newer non-final releases are available. The buildout |
493 | -prefer-final option can be used to override this behavior. |
494 | - |
495 | -In buildout version 2, final releases will be preferred by default. |
496 | -You will then need to use a false value for prefer-final to get the |
497 | -newest releases. |
498 | - |
499 | Finding distributions |
500 | --------------------- |
501 | |
502 | @@ -2411,49 +2525,7 @@ |
503 | requirements of the buildout will always be used. |
504 | |
505 | You can also specify more locations to search for distributions using |
506 | -the `find-links` option. All locations specified will be searched for |
507 | -distributions along with the package index as described before. |
508 | - |
509 | -Locations can be urls:: |
510 | - |
511 | - [buildout] |
512 | - ... |
513 | - find-links = http://download.zope.org/distribution/ |
514 | - |
515 | -They can also be directories on disk:: |
516 | - |
517 | - [buildout] |
518 | - ... |
519 | - find-links = /some/path |
520 | - |
521 | -Finally, they can also be direct paths to distributions:: |
522 | - |
523 | - [buildout] |
524 | - ... |
525 | - find-links = /some/path/someegg-1.0.0-py2.3.egg |
526 | - |
527 | -Any number of locations can be specified in the `find-links` option:: |
528 | - |
529 | - [buildout] |
530 | - ... |
531 | - find-links = |
532 | - http://download.zope.org/distribution/ |
533 | - /some/otherpath |
534 | - /some/path/someegg-1.0.0-py2.3.egg |
535 | - |
536 | -Dependency links |
537 | ----------------- |
538 | - |
539 | -By default buildout will obey the setuptools dependency_links metadata |
540 | -when it looks for dependencies. This behavior can be controlled with |
541 | -the use-dependency-links buildout option:: |
542 | - |
543 | - [buildout] |
544 | - ... |
545 | - use-dependency-links = false |
546 | - |
547 | -The option defaults to true. If you set it to false, then dependency |
548 | -links are only looked for in the locations specified by find-links. |
549 | +the `find-links` option. See its description above. |
550 | |
551 | Controlling the installation database |
552 | ------------------------------------- |
553 | @@ -2615,37 +2687,11 @@ |
554 | Develop: '/sample-bootstrapped/demo' |
555 | unload ['buildout'] |
556 | |
557 | -Allow hosts |
558 | ------------ |
559 | - |
560 | -On some environments the links visited by `zc.buildout` can be forbidden |
561 | -by paranoiac firewalls. These URL might be on the chain of links |
562 | -visited by `zc.buildout` wheter they are defined in the `find-links` option, |
563 | -wheter they are defined by various eggs in their `url`, `download_url`, |
564 | -`dependency_links` metadata. |
565 | - |
566 | -It is even harder to track that package_index works like a spider and |
567 | -might visit links and go to other location. |
568 | - |
569 | -The `allow-hosts` option provides a way to prevent this, and |
570 | -works exactly like the one provided in `easy_install`. |
571 | - |
572 | -You can provide a list of allowed host, together with wildcards:: |
573 | - |
574 | - [buildout] |
575 | - ... |
576 | - |
577 | - allow-hosts = |
578 | - *.python.org |
579 | - example.com |
580 | - |
581 | -All urls that does not match these hosts will not be visited. |
582 | - |
583 | .. [#future_recipe_methods] In the future, additional methods may be |
584 | added. Older recipes with fewer methods will still be |
585 | supported. |
586 | |
587 | .. [#packaging_info] If we wanted to create a distribution from this |
588 | - package, we would need specify much more information. See the |
589 | + package, we would need to specify much more information. See the |
590 | `setuptools documentation |
591 | <http://peak.telecommunity.com/DevCenter/setuptools>`_. |
592 | |
593 | === modified file 'src/zc/buildout/tests.py' |
594 | --- src/zc/buildout/tests.py 2010-02-17 21:27:15 +0000 |
595 | +++ src/zc/buildout/tests.py 2010-02-17 21:27:15 +0000 |
596 | @@ -2981,6 +2981,9 @@ |
597 | '-q develop -mxN -d /sample-buildout/develop-eggs' |
598 | ), |
599 | (re.compile(r'^[*]...'), '...'), |
600 | + # for bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section |
601 | + (re.compile(r"Unused options for buildout: 'eggs' 'scripts'\."), |
602 | + "Unused options for buildout: 'scripts' 'eggs'."), |
603 | ]), |
604 | ), |
605 | zc.buildout.testselectingpython.test_suite(), |
606 | |
607 | === modified file 'zc.recipe.egg_/src/zc/recipe/egg/egg.py' |
608 | --- zc.recipe.egg_/src/zc/recipe/egg/egg.py 2009-11-06 22:33:23 +0000 |
609 | +++ zc.recipe.egg_/src/zc/recipe/egg/egg.py 2010-02-17 21:27:15 +0000 |
610 | @@ -25,8 +25,8 @@ |
611 | self.buildout = buildout |
612 | self.name = name |
613 | self.options = options |
614 | - links = options.get('find-links', |
615 | - buildout['buildout'].get('find-links')) |
616 | + b_options = buildout['buildout'] |
617 | + links = options.get('find-links', b_options['find-links']) |
618 | if links: |
619 | links = links.split() |
620 | options['find-links'] = '\n'.join(links) |
621 | @@ -34,25 +34,25 @@ |
622 | links = () |
623 | self.links = links |
624 | |
625 | - index = options.get('index', buildout['buildout'].get('index')) |
626 | + index = options.get('index', b_options.get('index')) |
627 | if index is not None: |
628 | options['index'] = index |
629 | self.index = index |
630 | |
631 | - allow_hosts = buildout['buildout'].get('allow-hosts', '*') |
632 | + allow_hosts = b_options['allow-hosts'] |
633 | allow_hosts = tuple([host.strip() for host in allow_hosts.split('\n') |
634 | if host.strip()!='']) |
635 | self.allow_hosts = allow_hosts |
636 | |
637 | - options['eggs-directory'] = buildout['buildout']['eggs-directory'] |
638 | + options['eggs-directory'] = b_options['eggs-directory'] |
639 | options['_e'] = options['eggs-directory'] # backward compat. |
640 | - options['develop-eggs-directory' |
641 | - ] = buildout['buildout']['develop-eggs-directory'] |
642 | + options['develop-eggs-directory'] = b_options['develop-eggs-directory'] |
643 | options['_d'] = options['develop-eggs-directory'] # backward compat. |
644 | |
645 | - assert options.get('unzip') in ('true', 'false', None) |
646 | + # verify that this is None, 'true' or 'false' |
647 | + get_bool(options, 'unzip') |
648 | |
649 | - python = options.get('python', buildout['buildout']['python']) |
650 | + python = options.get('python', b_options['python']) |
651 | options['executable'] = buildout[python]['executable'] |
652 | |
653 | def working_set(self, extra=()): |
654 | @@ -61,6 +61,7 @@ |
655 | This is intended for reuse by similar recipes. |
656 | """ |
657 | options = self.options |
658 | + b_options = self.buildout['buildout'] |
659 | |
660 | distributions = [ |
661 | r.strip() |
662 | @@ -76,9 +77,8 @@ |
663 | ) |
664 | else: |
665 | kw = {} |
666 | - if options.get('unzip'): |
667 | + if 'unzip' in options: |
668 | kw['always_unzip'] = get_bool(options, 'unzip') |
669 | - |
670 | ws = zc.buildout.easy_install.install( |
671 | distributions, options['eggs-directory'], |
672 | links=self.links, |
This branch cleans up the way default options are handled in buildout so that it is all done in the same way. As a nice side-effect, this means that ``./bin/buildout annotate`` and similar tools give a more thorough description of the values being used.