Commit 5de1766b authored by jim's avatar jim

Changed the default policy back to what it was to avoid breakage in

  existing buildouts.  Use::

[buildout]
    prefer-final = true

to get the new policy.  The new policy will go into effect in
  buildout 2.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@79052 62d5b8a3-27da-0310-9561-8e5933582275
parent 40d56013
...@@ -11,6 +11,21 @@ priorities include: ...@@ -11,6 +11,21 @@ priorities include:
Change History Change History
************** **************
1.0.0b30 (2007-08-20)
=====================
Feature Changes
---------------
- Changed the default policy back to what it was to avoid breakage in
existing buildouts. Use::
[buildout]
prefer-final = true
to get the new policy. The new policy will go into effect in
buildout 2.
1.0.0b29 (2007-08-20) 1.0.0b29 (2007-08-20)
===================== =====================
......
...@@ -35,7 +35,7 @@ open('doc.txt', 'w').write(long_description) ...@@ -35,7 +35,7 @@ open('doc.txt', 'w').write(long_description)
name = "zc.buildout" name = "zc.buildout"
setup( setup(
name = name, name = name,
version = "1.0.0b29", version = "1.0.0b30",
author = "Jim Fulton", author = "Jim Fulton",
author_email = "jim@zope.com", author_email = "jim@zope.com",
description = "System for managing development buildouts", description = "System for managing development buildouts",
......
...@@ -152,7 +152,7 @@ class Buildout(UserDict.DictMixin): ...@@ -152,7 +152,7 @@ class Buildout(UserDict.DictMixin):
if versions: if versions:
zc.buildout.easy_install.default_versions(dict(self[versions])) zc.buildout.easy_install.default_versions(dict(self[versions]))
prefer_final = options.get('prefer-final', 'true') prefer_final = options.get('prefer-final', 'false')
if prefer_final not in ('true', 'false'): if prefer_final not in ('true', 'false'):
self._error('Invalid value for prefer-final option: %s', self._error('Invalid value for prefer-final option: %s',
prefer_final) prefer_final)
......
...@@ -2060,16 +2060,28 @@ running the buildout when not connected to the internet. It also ...@@ -2060,16 +2060,28 @@ running the buildout when not connected to the internet. It also
makes buildouts run much faster. This option is typically set using makes buildouts run much faster. This option is typically set using
the buildout -o option. the buildout -o option.
Final releases prefered Prefering Final Releases
----------------------- ------------------------
By default, when searching for new releases, final releases are Currently, when searching for new releases, the newest available
prefered. If there are final releases that satisfy distribution release is used. This isn't usually ideal, as you may get development
requirements, then those releases are used even if newer non-final releaes or alpha releases not ready to be widely used. You can
releases are available. The buildout prefer-final option can be used request that final releases be prefered using the prefer final option
to override this behavior. If a buildout prefer-final option is given in the buildout section::
with the value "false", then, when looking for distributions, the
newest will be used regardless of whether or not they are final. [buildout]
...
prefer-final = true
When the prefer-final option is set to true, then when searching for
new releases, final releases are prefered. If there are final
releases that satisfy distribution requirements, then those releases
are used even if newer non-final releases are available. The buildout
prefer-final option can be used to override this behavior.
In buildout version 2, final releases will be prefered by default.
You will then need to use a false value for prefer-final to get the
newset releases.
Controlling the installation database Controlling the installation database
------------------------------------- -------------------------------------
......
...@@ -60,12 +60,12 @@ server as usual: ...@@ -60,12 +60,12 @@ server as usual:
>>> print system(buildout), >>> print system(buildout),
GET 200 / GET 200 /
GET 200 /demo-0.2-py2.4.egg GET 200 /demo-0.2-py2.4.egg
GET 200 /demoneeded-1.1.zip GET 200 /demoneeded-1.2c1.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.1. Got demoneeded 1.2c1.
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
...@@ -78,7 +78,7 @@ dist: ...@@ -78,7 +78,7 @@ dist:
>>> ls(cache, 'dist') >>> ls(cache, 'dist')
- demo-0.2-py2.4.egg - demo-0.2-py2.4.egg
- demoneeded-1.1.zip - demoneeded-1.2c1.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:
...@@ -93,7 +93,7 @@ If we remove the installed eggs from eggs directory and re-run the buildout: ...@@ -93,7 +93,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.1. Got demoneeded 1.2c1.
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.
...@@ -136,5 +136,5 @@ install-from-cache option set to true: ...@@ -136,5 +136,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.1. Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
############################################################################## #############################################################################
# #
# Copyright (c) 2004 Zope Corporation and Contributors. # Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved. # All Rights Reserved.
...@@ -153,6 +153,11 @@ def buildoutSetUp(test): ...@@ -153,6 +153,11 @@ def buildoutSetUp(test):
test.globs['__tear_downs'] = __tear_downs = [] test.globs['__tear_downs'] = __tear_downs = []
test.globs['register_teardown'] = register_teardown = __tear_downs.append test.globs['register_teardown'] = register_teardown = __tear_downs.append
prefer_final = zc.buildout.easy_install.prefer_final()
register_teardown(
lambda: zc.buildout.easy_install.prefer_final(prefer_final)
)
here = os.getcwd() here = os.getcwd()
register_teardown(lambda: os.chdir(here)) register_teardown(lambda: os.chdir(here))
...@@ -203,6 +208,8 @@ def buildoutSetUp(test): ...@@ -203,6 +208,8 @@ def buildoutSetUp(test):
] ]
).bootstrap([]) ).bootstrap([])
# Create the develop-eggs dir, which didn't get created the usual # Create the develop-eggs dir, which didn't get created the usual
# way due to thr trick above: # way due to thr trick above:
os.mkdir('develop-eggs') os.mkdir('develop-eggs')
...@@ -232,6 +239,8 @@ def buildoutSetUp(test): ...@@ -232,6 +239,8 @@ def buildoutSetUp(test):
buildout = os.path.join(sample, 'bin', 'buildout'), buildout = os.path.join(sample, 'bin', 'buildout'),
)) ))
zc.buildout.easy_install.prefer_final(prefer_final)
def buildoutTearDown(test): def buildoutTearDown(test):
for f in test.globs['__tear_downs']: for f in test.globs['__tear_downs']:
f() f()
......
...@@ -1721,13 +1721,13 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1721,13 +1721,13 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
>>> print system(buildout), >>> print system(buildout),
Installing x. Installing x.
Getting distribution for 'demo'. Getting distribution for 'demo'.
Got demo 0.3. Got demo 0.4c1.
Getting distribution for 'demoneeded'. Getting distribution for 'demoneeded'.
Got demoneeded 1.1. Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
>>> print system(join('bin', 'demo')), >>> print system(join('bin', 'demo')),
3 1 4 2
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
...@@ -1748,7 +1748,7 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around(): ...@@ -1748,7 +1748,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')), >>> print system(join('bin', 'demo')),
1 1 1 2
""" """
if sys.version_info > (2, 4): if sys.version_info > (2, 4):
...@@ -2198,7 +2198,7 @@ def buildout_prefer_final_option(): ...@@ -2198,7 +2198,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 = true: The default is prefer-final = false:
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
...@@ -2214,20 +2214,19 @@ The default is prefer-final = true: ...@@ -2214,20 +2214,19 @@ The default is prefer-final = true:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'. Installing 'zc.buildout', 'setuptools'.
... ...
Picked: demo = 0.3 Picked: demo = 0.4c1
... ...
Picked: demoneeded = 1.1 Picked: demoneeded = 1.2c1
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 = true We get the same behavior if we add prefer-final = false
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
... [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
...@@ -2237,11 +2236,11 @@ We get the same behavior if we add prefer-final = true ...@@ -2237,11 +2236,11 @@ We get the same behavior if we add prefer-final = true
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'. Installing 'zc.buildout', 'setuptools'.
... ...
Picked: demo = 0.3 Picked: demo = 0.4c1
... ...
Picked: demoneeded = 1.1 Picked: demoneeded = 1.2c1
If we specify prefer-final = false, we'll get the newest If we specify prefer-final = true, we'll get the newest
distributions: distributions:
>>> write('buildout.cfg', >>> write('buildout.cfg',
...@@ -2249,7 +2248,7 @@ distributions: ...@@ -2249,7 +2248,7 @@ distributions:
... [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
...@@ -2259,9 +2258,9 @@ distributions: ...@@ -2259,9 +2258,9 @@ distributions:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'. Installing 'zc.buildout', 'setuptools'.
... ...
Picked: demo = 0.4c1 Picked: demo = 0.3
... ...
Picked: demoneeded = 1.2c1 Picked: demoneeded = 1.1
We get an error if we specify anything but true or false: We get an error if we specify anything but true or false:
......
...@@ -71,13 +71,13 @@ Let's run the buildout: ...@@ -71,13 +71,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.1. Got demoneeded 1.2c1.
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')
- demo-0.2-py2.3.egg - demo-0.2-py2.3.egg
- demoneeded-1.1-py2.3.egg - demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.3.egg - setuptools-0.6-py2.3.egg
- zc.buildout-1.0-py2.3.egg - zc.buildout-1.0-py2.3.egg
...@@ -190,7 +190,7 @@ This is useful for debugging and testing. ...@@ -190,7 +190,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')), >>> print system(join(sample_buildout, 'bin', 'demo')),
2 1 2 2
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.
...@@ -207,7 +207,7 @@ the bits if the path added to reflect the eggs: ...@@ -207,7 +207,7 @@ the bits if the path added to reflect the eggs:
... """).replace('>>> ', '').replace('... ', ''), ... """).replace('>>> ', '').replace('... ', ''),
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE ... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
demo-0.2-py2.4.egg demo-0.2-py2.4.egg
demoneeded-1.1-py2.4.egg demoneeded-1.2c1-py2.4.egg
Egg updating Egg updating
------------ ------------
...@@ -248,7 +248,7 @@ We didn't get an update for demo: ...@@ -248,7 +248,7 @@ We didn't get an update for demo:
>>> ls(sample_buildout, 'eggs') >>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.3.egg - demo-0.2-py2.3.egg
- demoneeded-1.1-py2.3.egg - demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.3.egg - setuptools-0.6-py2.3.egg
- zc.buildout-1.0-py2.3.egg - zc.buildout-1.0-py2.3.egg
...@@ -258,22 +258,22 @@ we'll get an update for demo: ...@@ -258,22 +258,22 @@ we'll get an update for demo:
>>> print system(buildout), >>> print system(buildout),
Updating demo. Updating demo.
Getting distribution for 'demo'. Getting distribution for 'demo'.
Got demo 0.3. Got demo 0.4c1.
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')
- demo-0.2-py2.3.egg - demo-0.2-py2.3.egg
- demo-0.3-py2.3.egg - demo-0.4c1-py2.3.egg
- demoneeded-1.1-py2.3.egg - demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.4.egg - setuptools-0.6-py2.4.egg
- zc.buildout-1.0-py2.4.egg - zc.buildout-1.0-py2.4.egg
The script is updated too: The script is updated too:
>>> print system(join(sample_buildout, 'bin', 'demo')), >>> print system(join(sample_buildout, 'bin', 'demo')),
3 1 4 2
Controlling script generation Controlling script generation
----------------------------- -----------------------------
...@@ -358,8 +358,8 @@ Let's look at the script that was generated: ...@@ -358,8 +358,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.3-py2.4.egg', '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar', '/foo/bar',
'/spam/eggs', '/spam/eggs',
] ]
...@@ -405,8 +405,8 @@ to be included in generated scripts: ...@@ -405,8 +405,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.3-py2.4.egg', '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar', '/foo/bar',
'/spam/eggs', '/spam/eggs',
] ]
...@@ -463,8 +463,8 @@ declare entry points using the entry-points option: ...@@ -463,8 +463,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.3-py2.4.egg', '/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar', '/foo/bar',
'/spam/eggs', '/spam/eggs',
] ]
......
...@@ -88,7 +88,7 @@ of extra requirements to be included in the working set. ...@@ -88,7 +88,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.1 demoneeded 1.2c1
extra paths: [] extra paths: []
We can see that the options were augmented with additionl data We can see that the options were augmented with additionl data
...@@ -147,6 +147,6 @@ recipe instance: ...@@ -147,6 +147,6 @@ recipe instance:
Working set: Working set:
demo 0.2 demo 0.2
other 1.0 other 1.0
demoneeded 1.1 demoneeded 1.2c1
extra paths: ['/foo/bar', '/spam/eggs'] extra paths: ['/foo/bar', '/spam/eggs']
...@@ -56,7 +56,7 @@ Now, if we run the buildout: ...@@ -56,7 +56,7 @@ Now, if we run the buildout:
Getting distribution for 'demoneeded'. Getting distribution for 'demoneeded'.
Getting distribution for 'setuptools'. Getting distribution for 'setuptools'.
Got setuptools 0.6. Got setuptools 0.6.
Got demoneeded 1.1. Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'. Generated script '/sample-buildout/bin/demo'.
Generated interpreter '/sample-buildout/bin/py-demo'. Generated interpreter '/sample-buildout/bin/py-demo'.
...@@ -64,7 +64,7 @@ we'll get the Python 2.3 eggs for demo and demoneeded: ...@@ -64,7 +64,7 @@ we'll get the Python 2.3 eggs for demo and demoneeded:
>>> ls(sample_buildout, 'eggs') >>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.3.egg - demo-0.2-py2.3.egg
- demoneeded-1.1-py2.3.egg - demoneeded-1.2c1-py2.3.egg
d setuptools-0.6-py2.3.egg d setuptools-0.6-py2.3.egg
d setuptools-0.6-py2.4.egg d setuptools-0.6-py2.4.egg
- zc.buildout-1.0-py2.4.egg - zc.buildout-1.0-py2.4.egg
...@@ -84,7 +84,7 @@ And the generated scripts invoke Python 2.3: ...@@ -84,7 +84,7 @@ And the generated scripts invoke Python 2.3:
import sys import sys
sys.path[0:0] = [ sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.2-py2.3.egg', '/sample-buildout/eggs/demo-0.2-py2.3.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.3.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.3.egg',
] ]
<BLANKLINE> <BLANKLINE>
import eggrecipedemo import eggrecipedemo
...@@ -103,7 +103,7 @@ And the generated scripts invoke Python 2.3: ...@@ -103,7 +103,7 @@ And the generated scripts invoke Python 2.3:
<BLANKLINE> <BLANKLINE>
sys.path[0:0] = [ sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.2-py2.3.egg', '/sample-buildout/eggs/demo-0.2-py2.3.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.3.egg', '/sample-buildout/eggs/demoneeded-1.2c1-py2.3.egg',
] ]
<BLANKLINE> <BLANKLINE>
_interactive = True _interactive = True
......
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