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:
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)
=====================
......
......@@ -35,7 +35,7 @@ open('doc.txt', 'w').write(long_description)
name = "zc.buildout"
setup(
name = name,
version = "1.0.0b29",
version = "1.0.0b30",
author = "Jim Fulton",
author_email = "jim@zope.com",
description = "System for managing development buildouts",
......
......@@ -152,7 +152,7 @@ class Buildout(UserDict.DictMixin):
if 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'):
self._error('Invalid value for prefer-final option: %s',
prefer_final)
......
......@@ -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
the buildout -o option.
Final releases prefered
-----------------------
By default, 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. If a buildout prefer-final option is given
with the value "false", then, when looking for distributions, the
newest will be used regardless of whether or not they are final.
Prefering Final Releases
------------------------
Currently, when searching for new releases, the newest available
release is used. This isn't usually ideal, as you may get development
releaes or alpha releases not ready to be widely used. You can
request that final releases be prefered using the prefer final option
in the buildout section::
[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
-------------------------------------
......
......@@ -60,12 +60,12 @@ server as usual:
>>> print system(buildout),
GET 200 /
GET 200 /demo-0.2-py2.4.egg
GET 200 /demoneeded-1.1.zip
GET 200 /demoneeded-1.2c1.zip
Installing eggs.
Getting distribution for 'demo==0.2'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.1.
Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'.
We'll also get the download cache populated. The buildout doesn't put
......@@ -78,7 +78,7 @@ dist:
>>> ls(cache, 'dist')
- 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:
......@@ -93,7 +93,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.1.
Got demoneeded 1.2c1.
We see that the distributions aren't downloaded, because they're
downloaded from the cache.
......@@ -136,5 +136,5 @@ install-from-cache option set to true:
Getting distribution for 'demo'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.1.
Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'.
##############################################################################
#############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
......@@ -153,6 +153,11 @@ def buildoutSetUp(test):
test.globs['__tear_downs'] = __tear_downs = []
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()
register_teardown(lambda: os.chdir(here))
......@@ -203,6 +208,8 @@ def buildoutSetUp(test):
]
).bootstrap([])
# Create the develop-eggs dir, which didn't get created the usual
# way due to thr trick above:
os.mkdir('develop-eggs')
......@@ -232,6 +239,8 @@ def buildoutSetUp(test):
buildout = os.path.join(sample, 'bin', 'buildout'),
))
zc.buildout.easy_install.prefer_final(prefer_final)
def buildoutTearDown(test):
for f in test.globs['__tear_downs']:
f()
......
......@@ -1721,13 +1721,13 @@ def bug_105081_Specific_egg_versions_are_ignored_when_newer_eggs_are_around():
>>> print system(buildout),
Installing x.
Getting distribution for 'demo'.
Got demo 0.3.
Got demo 0.4c1.
Getting distribution for 'demoneeded'.
Got demoneeded 1.1.
Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'.
>>> print system(join('bin', 'demo')),
3 1
4 2
>>> write('buildout.cfg',
... '''
......@@ -1748,7 +1748,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')),
1 1
1 2
"""
if sys.version_info > (2, 4):
......@@ -2198,7 +2198,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 = true:
The default is prefer-final = false:
>>> write('buildout.cfg',
... '''
......@@ -2214,20 +2214,19 @@ The default is prefer-final = true:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
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.
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',
... '''
... [buildout]
... parts = eggs
... find-links = %(link_server)s
... prefer-final = true
... prefer-final = false
...
... [eggs]
... recipe = zc.recipe.egg:eggs
......@@ -2237,11 +2236,11 @@ We get the same behavior if we add prefer-final = true
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
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:
>>> write('buildout.cfg',
......@@ -2249,7 +2248,7 @@ distributions:
... [buildout]
... parts = eggs
... find-links = %(link_server)s
... prefer-final = false
... prefer-final = true
...
... [eggs]
... recipe = zc.recipe.egg:eggs
......@@ -2259,9 +2258,9 @@ distributions:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
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:
......
......@@ -71,13 +71,13 @@ Let's run the buildout:
Getting distribution for 'demo<0.3'.
Got demo 0.2.
Getting distribution for 'demoneeded'.
Got demoneeded 1.1.
Got demoneeded 1.2c1.
Now, if we look at the buildout eggs directory:
>>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.3.egg
- demoneeded-1.1-py2.3.egg
- demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.3.egg
- zc.buildout-1.0-py2.3.egg
......@@ -190,7 +190,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')),
2 1
2 2
The value it prints out happens to be some values defined in the
modules installed.
......@@ -207,7 +207,7 @@ the bits if the path added to reflect the eggs:
... """).replace('>>> ', '').replace('... ', ''),
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
demo-0.2-py2.4.egg
demoneeded-1.1-py2.4.egg
demoneeded-1.2c1-py2.4.egg
Egg updating
------------
......@@ -248,7 +248,7 @@ We didn't get an update for demo:
>>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.3.egg
- demoneeded-1.1-py2.3.egg
- demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.3.egg
- zc.buildout-1.0-py2.3.egg
......@@ -258,22 +258,22 @@ we'll get an update for demo:
>>> print system(buildout),
Updating demo.
Getting distribution for 'demo'.
Got demo 0.3.
Got demo 0.4c1.
Generated script '/sample-buildout/bin/demo'.
Then we'll get a new demo egg:
>>> ls(sample_buildout, 'eggs')
- demo-0.2-py2.3.egg
- demo-0.3-py2.3.egg
- demoneeded-1.1-py2.3.egg
- demo-0.4c1-py2.3.egg
- demoneeded-1.2c1-py2.3.egg
- setuptools-0.6-py2.4.egg
- zc.buildout-1.0-py2.4.egg
The script is updated too:
>>> print system(join(sample_buildout, 'bin', 'demo')),
3 1
4 2
Controlling script generation
-----------------------------
......@@ -358,8 +358,8 @@ Let's look at the script that was generated:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar',
'/spam/eggs',
]
......@@ -405,8 +405,8 @@ to be included in generated scripts:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar',
'/spam/eggs',
]
......@@ -463,8 +463,8 @@ declare entry points using the entry-points option:
<BLANKLINE>
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/demo-0.3-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.1-py2.4.egg',
'/sample-buildout/eggs/demo-0.4c1-py2.4.egg',
'/sample-buildout/eggs/demoneeded-1.2c1-py2.4.egg',
'/foo/bar',
'/spam/eggs',
]
......
......@@ -88,7 +88,7 @@ of extra requirements to be included in the working set.
Working set:
demo 0.2
other 1.0
demoneeded 1.1
demoneeded 1.2c1
extra paths: []
We can see that the options were augmented with additionl data
......@@ -147,6 +147,6 @@ recipe instance:
Working set:
demo 0.2
other 1.0
demoneeded 1.1
demoneeded 1.2c1
extra paths: ['/foo/bar', '/spam/eggs']
......@@ -56,7 +56,7 @@ Now, if we run the buildout:
Getting distribution for 'demoneeded'.
Getting distribution for 'setuptools'.
Got setuptools 0.6.
Got demoneeded 1.1.
Got demoneeded 1.2c1.
Generated script '/sample-buildout/bin/demo'.
Generated interpreter '/sample-buildout/bin/py-demo'.
......@@ -64,7 +64,7 @@ we'll get the Python 2.3 eggs for demo and demoneeded:
>>> ls(sample_buildout, 'eggs')
- 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.4.egg
- zc.buildout-1.0-py2.4.egg
......@@ -84,7 +84,7 @@ And the generated scripts invoke Python 2.3:
import sys
sys.path[0:0] = [
'/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>
import eggrecipedemo
......@@ -103,7 +103,7 @@ And the generated scripts invoke Python 2.3:
<BLANKLINE>
sys.path[0:0] = [
'/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>
_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