[Checkins] SVN: zc.buildout/branches/prefer-final/ r96854@Avalon: jim | 2007-07-10 07:23:08 -0400

Jim Fulton jim at zope.com
Tue Jul 10 07:25:18 EDT 2007


Log message for revision 77676:
   r96854 at Avalon:  jim | 2007-07-10 07:23:08 -0400
   Added a buildout uption to enable older behavior of not prefering
   final releases.
   
  

Changed:
  _U  zc.buildout/branches/prefer-final/
  U   zc.buildout/branches/prefer-final/CHANGES.txt
  U   zc.buildout/branches/prefer-final/src/zc/buildout/buildout.py
  U   zc.buildout/branches/prefer-final/src/zc/buildout/buildout.txt
  U   zc.buildout/branches/prefer-final/src/zc/buildout/tests.py

-=-

Property changes on: zc.buildout/branches/prefer-final
___________________________________________________________________
Name: svk:merge
   - 62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/trunk:77455
c0866d8a-16ff-402e-90a7-1844f7e98520:/prefer-final:96853
   + 62d5b8a3-27da-0310-9561-8e5933582275:/zc.buildout/trunk:77455
c0866d8a-16ff-402e-90a7-1844f7e98520:/prefer-final:96854

Modified: zc.buildout/branches/prefer-final/CHANGES.txt
===================================================================
--- zc.buildout/branches/prefer-final/CHANGES.txt	2007-07-10 11:25:14 UTC (rev 77675)
+++ zc.buildout/branches/prefer-final/CHANGES.txt	2007-07-10 11:25:17 UTC (rev 77676)
@@ -16,9 +16,30 @@
 Change History
 **************
 
-1.0.0b28 (2007-07-05)
+1.0.0b28 (2007-07-??)
 =====================
 
+Feature Changes
+---------------
+
+- Now, final distributions are prefered over non-final versions.  If
+  both final and non-final versions satisfy a requirement, then the
+  final version will be used even if it is older.  The normal way to
+  override this for specific packages is to specifically require a
+  non-final version, either specifically or via a lower bound.
+
+- There is a buildout prefer-final version that can be used with a
+  value of "false"::
+
+    prefer-final = false
+
+  To prefer newer versions, regardless of whether or not they are
+  final, buildout-wide.
+
+
+1.0.0b29 (2007-07-05)
+=====================
+
 Bugs Fixed
 ----------
 

Modified: zc.buildout/branches/prefer-final/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/prefer-final/src/zc/buildout/buildout.py	2007-07-10 11:25:14 UTC (rev 77675)
+++ zc.buildout/branches/prefer-final/src/zc/buildout/buildout.py	2007-07-10 11:25:17 UTC (rev 77676)
@@ -152,6 +152,13 @@
         if versions:
             zc.buildout.easy_install.default_versions(dict(self[versions]))
 
+        prefer_final = options.get('prefer-final', 'true')
+        if prefer_final not in ('true', 'false'):
+            self._error('Invalid value for prefer-final option: %s',
+                        prefer_final)
+        zc.buildout.easy_install.prefer_final(prefer_final=='true')
+        
+
         download_cache = options.get('download-cache')
         if download_cache:
             download_cache = os.path.join(options['directory'], download_cache)

Modified: zc.buildout/branches/prefer-final/src/zc/buildout/buildout.txt
===================================================================
--- zc.buildout/branches/prefer-final/src/zc/buildout/buildout.txt	2007-07-10 11:25:14 UTC (rev 77675)
+++ zc.buildout/branches/prefer-final/src/zc/buildout/buildout.txt	2007-07-10 11:25:17 UTC (rev 77676)
@@ -2059,6 +2059,17 @@
 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. 
+
 Controlling the installation database
 -------------------------------------
 

Modified: zc.buildout/branches/prefer-final/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/prefer-final/src/zc/buildout/tests.py	2007-07-10 11:25:14 UTC (rev 77675)
+++ zc.buildout/branches/prefer-final/src/zc/buildout/tests.py	2007-07-10 11:25:17 UTC (rev 77676)
@@ -2193,7 +2193,98 @@
     
     """
 
+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:
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = eggs
+    ... find-links = %(link_server)s
+    ...
+    ... [eggs]
+    ... recipe = zc.recipe.egg:eggs
+    ... eggs = demo
+    ... ''' % globals())
+
+    >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
+    Installing 'zc.buildout', 'setuptools'.
+    ...
+    Picked: demo = 0.3
+    ...
+    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 = true
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = eggs
+    ... find-links = %(link_server)s
+    ... prefer-final = true
+    ...
+    ... [eggs]
+    ... recipe = zc.recipe.egg:eggs
+    ... eggs = demo
+    ... ''' % globals())
+
+    >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
+    Installing 'zc.buildout', 'setuptools'.
+    ...
+    Picked: demo = 0.3
+    ...
+    Picked: demoneeded = 1.1
+
+If we specify prefer-final = false, we'll get the newest
+distributions:
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = eggs
+    ... find-links = %(link_server)s
+    ... prefer-final = false
+    ...
+    ... [eggs]
+    ... recipe = zc.recipe.egg:eggs
+    ... eggs = demo
+    ... ''' % globals())
+
+    >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
+    Installing 'zc.buildout', 'setuptools'.
+    ...
+    Picked: demo = 0.4c1
+    ...
+    Picked: demoneeded = 1.2c1
+
+We get an error if we specify anything but true or false:
+
+    >>> write('buildout.cfg',
+    ... '''
+    ... [buildout]
+    ... parts = eggs
+    ... find-links = %(link_server)s
+    ... prefer-final = no
+    ...
+    ... [eggs]
+    ... recipe = zc.recipe.egg:eggs
+    ... eggs = demo
+    ... ''' % globals())
+
+    >>> print system(buildout+' -v'), # doctest: +ELLIPSIS
+    While:
+      Initializing.
+    Error: Invalid value for prefer-final option: no
+
+    """
+
+
 # XXX Tests needed:
 
 # Link added from package meta data



More information about the Checkins mailing list