Commit d0672d2c authored by Jim Fulton's avatar Jim Fulton

Enable prefer-final by default

parent ccdf2870
......@@ -134,7 +134,7 @@ _buildout_default_options = _annotate_section({
'newest': 'true',
'offline': 'false',
'parts-directory': 'parts',
'prefer-final': 'false',
'prefer-final': 'true',
'python': 'buildout',
'socket-timeout': '',
'use-dependency-links': 'true',
......
......@@ -764,7 +764,7 @@ COMMAND_LINE_VALUE).
/sample-buildout/buildout.cfg
parts-directory= parts
DEFAULT_VALUE
prefer-final= false
prefer-final= true
DEFAULT_VALUE
python= buildout
DEFAULT_VALUE
......@@ -2284,7 +2284,7 @@ database is shown.
offline = false
parts =
parts-directory = /sample-buildout/parts
prefer-final = false
prefer-final = true
python = buildout
socket-timeout =
use-dependency-links = true
......@@ -2581,11 +2581,11 @@ or paths to use:
Got zc.recipe.egg 1.3.3dev.
Installing py.
Getting distribution for 'demo'.
Got demo 0.4c1.
Got demo 0.3.
Getting distribution for 'other'.
Got other 1.0.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Generated script '/sample-bootstrapped/bin/demo'.
Generated script '/sample-bootstrapped/bin/distutilsscript'.
Generated interpreter '/sample-bootstrapped/bin/py'.
......
......@@ -55,11 +55,11 @@ Now we can run the buildout.
>>> print_(system(buildout), end='')
GET 200 /
GET 200 /demoneeded-1.2c1.zip
GET 200 /demoneeded-1.1.zip
Develop: '/sample-buildout/depdemo'
Installing eggs.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Notice that the egg was retrieved from the logging server.
......@@ -112,7 +112,7 @@ to look for eggs.
Develop: '/sample-buildout/depdemo'
Installing eggs.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
This time the dependency egg was found on the server without logging
configured.
......@@ -134,7 +134,7 @@ specify different places to look for the dependency egg.
Develop: '/sample-buildout/depdemo'
Updating eggs.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
So when both setuptools and buildout specify places to search for
eggs, the dependency_links takes precedence over find-links.
......@@ -164,7 +164,7 @@ Here is an example of using this option to disable dependency_links.
Develop: '/sample-buildout/depdemo'
Updating eggs.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Notice that this time the egg isn't downloaded from the logging server.
......@@ -189,4 +189,4 @@ before. The dependency's are looked for first in the logging server.
Develop: '/sample-buildout/depdemo'
Updating eggs.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
......@@ -61,12 +61,12 @@ server as usual:
>>> print_(system(buildout), end='')
GET 200 /
GET 200 /demo-0.2-py2.4.egg
GET 200 /demoneeded-1.2c1.zip
GET 200 /demoneeded-1.1.zip
Installing eggs.
Getting distribution for 'demo==0.2'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Generated script '/sample-buildout/bin/demo'.
We'll also get the download cache populated. The buildout doesn't put
......@@ -79,7 +79,7 @@ dist:
>>> ls(cache, 'dist')
- demo-0.2-py2.4.egg
- demoneeded-1.2c1.zip
- demoneeded-1.1.zip
If we remove the installed eggs from eggs directory and re-run the buildout:
......@@ -94,7 +94,7 @@ If we remove the installed eggs from eggs directory and re-run the buildout:
Getting distribution for 'demo==0.2'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
We see that the distributions aren't downloaded, because they're
downloaded from the cache.
......@@ -137,5 +137,5 @@ install-from-cache option set to true:
Getting distribution for 'demo'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Generated script '/sample-buildout/bin/demo'.
......@@ -1708,13 +1708,13 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
>>> print_(system(buildout), end='')
Installing x.
Getting distribution for 'demo'.
Got demo 0.4c1.
Got demo 0.3.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Generated script '/sample-buildout/bin/demo'.
>>> print_(system(join('bin', 'demo')), end='')
4 2
3 1
>>> write('buildout.cfg',
... '''
......@@ -1735,7 +1735,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
Generated script '/sample-buildout/bin/demo'.
>>> print_(system(join('bin', 'demo')), end='')
1 2
1 1
"""
if sys.version_info > (2, 4):
......@@ -2213,7 +2213,7 @@ def buildout_prefer_final_option():
The prefer-final buildout option can be used for override the default
preference for newer distributions.
The default is prefer-final = false:
The default is prefer-final = true:
>>> write('buildout.cfg',
... '''
......@@ -2229,19 +2229,19 @@ The default is prefer-final = false:
>>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'.
...
Picked: demo = 0.4c1
Picked: demo = 0.3
...
Picked: demoneeded = 1.2c1
Picked: demoneeded = 1.1
Here we see that the final versions of demo and demoneeded are used.
We get the same behavior if we add prefer-final = false
We get the same behavior if we add prefer-final = true
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = eggs
... find-links = %(link_server)s
... prefer-final = false
... prefer-final = true
...
... [eggs]
... recipe = zc.recipe.egg:eggs
......@@ -2251,11 +2251,11 @@ We get the same behavior if we add prefer-final = false
>>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'.
...
Picked: demo = 0.4c1
Picked: demo = 0.3
...
Picked: demoneeded = 1.2c1
Picked: demoneeded = 1.1
If we specify prefer-final = true, we'll get the newest
If we specify prefer-final = false, we'll get the newest
distributions:
>>> write('buildout.cfg',
......@@ -2263,7 +2263,7 @@ distributions:
... [buildout]
... parts = eggs
... find-links = %(link_server)s
... prefer-final = true
... prefer-final = false
...
... [eggs]
... recipe = zc.recipe.egg:eggs
......@@ -2273,9 +2273,9 @@ distributions:
>>> print_(system(buildout+' -v'), end='') # doctest: +ELLIPSIS
Installing 'zc.buildout', 'distribute'.
...
Picked: demo = 0.3
Picked: demo = 0.4c1
...
Picked: demoneeded = 1.1
Picked: demoneeded = 1.2c1
We get an error if we specify anything but true or false:
......@@ -2398,8 +2398,8 @@ def pyc_and_pyo_files_have_correct_paths():
... ''')
>>> print_(system(join('bin', 'py')+ ' t.py'), end='')
/sample-buildout/eggs/demo-0.4c1-py2.4.egg/eggrecipedemo.py
/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg/eggrecipedemoneeded.py
/sample-buildout/eggs/demo-0.3-py2.4.egg/eggrecipedemo.py
/sample-buildout/eggs/demoneeded-1.1-py2.4.egg/eggrecipedemoneeded.py
"""
def dont_mess_with_standard_dirs_with_variable_refs():
......
......@@ -67,13 +67,13 @@ Let's run the buildout:
Getting distribution for 'demo<0.3'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.2c1.
Got demoneeded 1.1.
Now, if we look at the buildout eggs directory:
>>> ls(sample_buildout, 'eggs')
d demo-0.2-py2.3.egg
d demoneeded-1.2c1-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.3.egg
d zc.buildout-1.0-py2.3.egg
......@@ -204,7 +204,7 @@ This is useful for debugging and testing.
If we run the demo script, it prints out some minimal data:
>>> print_(system(join(sample_buildout, 'bin', 'demo')), end='')
2 2
2 1
The value it prints out happens to be some values defined in the
modules installed.
......@@ -221,7 +221,7 @@ the bits if the path added to reflect the eggs:
... """).replace('>>> ', '').replace('... ', ''), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
demo-0.2-py2.4.egg
demoneeded-1.2c1-py2.4.egg
demoneeded-1.1-py2.4.egg
Egg updating
------------
......@@ -262,7 +262,7 @@ We didn't get an update for demo:
>>> ls(sample_buildout, 'eggs')
d demo-0.2-py2.3.egg
d demoneeded-1.2c1-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.3.egg
d zc.buildout-1.0-py2.3.egg
......@@ -272,22 +272,22 @@ we'll get an update for demo:
>>> print_(system(buildout), end='')
Updating demo.
Getting distribution for 'demo'.
Got demo 0.4c1.
Got demo 0.3.
Generated script '/sample-buildout/bin/demo'.
Then we'll get a new demo egg:
>>> ls(sample_buildout, 'eggs')
d demo-0.2-py2.3.egg
d demo-0.4c1-py2.3.egg
d demoneeded-1.2c1-py2.3.egg
d demo-0.3-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.4.egg
d zc.buildout-1.0-py2.4.egg
The script is updated too:
>>> print_(system(join(sample_buildout, 'bin', 'demo')), end='')
4 2
3 1
Controlling script generation
-----------------------------
......@@ -372,8 +372,8 @@ Let's look at the script that was generated:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/foo/bar',
'/sample-buildout/spam',
]
......@@ -425,8 +425,8 @@ Let's look at the script that was generated:
<BLANKLINE>
import sys
sys.path[0:0] = [
join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
join(base, 'eggs/demo-0.3-pyN.N.egg'),
join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
'/foo/bar',
join(base, 'spam'),
]
......@@ -472,8 +472,8 @@ each individual script section:
<BLANKLINE>
import sys
sys.path[0:0] = [
join(base, 'eggs/demo-0.4c1-pyN.N.egg'),
join(base, 'eggs/demoneeded-1.2c1-pyN.N.egg'),
join(base, 'eggs/demo-0.3-pyN.N.egg'),
join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
'/foo/bar',
join(base, 'spam'),
]
......@@ -519,8 +519,8 @@ to be included in generated scripts:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/foo/bar',
'/sample-buildout/spam',
]
......@@ -577,8 +577,8 @@ declare entry points using the entry-points option:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/foo/bar',
'/sample-buildout/spam',
]
......
......@@ -91,7 +91,7 @@ of extra requirements to be included in the working set.
Working set:
demo 0.2
other 1.0
demoneeded 1.2c1
demoneeded 1.1
extra paths: []
We can see that the options were augmented with additional data
......@@ -149,6 +149,6 @@ recipe instance:
Working set:
demo 0.2
other 1.0
demoneeded 1.2c1
demoneeded 1.1
extra paths: ['/foo/bar', '/spam/eggs']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment