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