[Checkins] SVN: zc.buildout/branches/1.4/ the "aspirin" release.

Gary Poster gary.poster at canonical.com
Mon Aug 2 20:03:03 EDT 2010


Log message for revision 115394:
  the "aspirin" release.

Changed:
  U   zc.buildout/branches/1.4/README.txt
  U   zc.buildout/branches/1.4/bootstrap/bootstrap.py
  U   zc.buildout/branches/1.4/buildout.cfg
  U   zc.buildout/branches/1.4/setup.py
  U   zc.buildout/branches/1.4/src/zc/buildout/allowhosts.txt
  U   zc.buildout/branches/1.4/src/zc/buildout/buildout.py
  U   zc.buildout/branches/1.4/src/zc/buildout/easy_install.txt
  U   zc.buildout/branches/1.4/src/zc/buildout/testing_bugfix.txt
  U   zc.buildout/branches/1.4/src/zc/buildout/tests.py
  U   zc.buildout/branches/1.4/src/zc/buildout/update.txt

-=-
Modified: zc.buildout/branches/1.4/README.txt
===================================================================
--- zc.buildout/branches/1.4/README.txt	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/README.txt	2010-08-03 00:03:02 UTC (rev 115394)
@@ -2,6 +2,11 @@
 Buildout
 ********
 
+*Note*: the 1.4.4 release is a release for people who encounter trouble
+with the 1.5 line.  By switching to `the associated bootstrap script
+<http://svn.zope.org/repos/main/zc.buildout/branches/1.4/bootstrap/bootstrap.py>`_
+you can stay on 1.4.4 until you are ready to migrate.
+
 .. contents::
 
 The Buildout project provides support for creating applications,
@@ -126,7 +131,7 @@
 `--version` option of the bootstrap.py script::
 
     $ python bootstrap.py --version 1.1.3
-    
+
 The `zc.buildout project <http://svn.zope.org/zc.buildout/trunk>`_
 is a slightly more complex example of this type of buildout.
 

Modified: zc.buildout/branches/1.4/bootstrap/bootstrap.py
===================================================================
--- zc.buildout/branches/1.4/bootstrap/bootstrap.py	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/bootstrap/bootstrap.py	2010-08-03 00:03:02 UTC (rev 115394)
@@ -28,9 +28,14 @@
 is_jython = sys.platform.startswith('java')
 
 # parsing arguments
-parser = OptionParser()
-parser.add_option("-v", "--version", dest="version",
-                          help="use a specific zc.buildout version")
+parser = OptionParser(
+    'This is a custom version of the zc.buildout %prog script.  It is '
+    'intended to meet a temporary need if you encounter problems with '
+    'the zc.buildout 1.5 release.')
+parser.add_option("-v", "--version", dest="version", default='1.4.4',
+                          help='Use a specific zc.buildout version.  *This '
+                          'bootstrap script defaults to '
+                          '1.4.4, unlike usual buildpout bootstrap scripts.*')
 parser.add_option("-d", "--distribute",
                    action="store_true", dest="distribute", default=False,
                    help="Use Disribute rather than Setuptools.")
@@ -85,7 +90,6 @@
     def quote (c):
         return c
 
-cmd = 'from setuptools.command.easy_install import main; main()'
 ws  = pkg_resources.working_set
 
 if USE_DISTRIBUTE:
@@ -93,27 +97,29 @@
 else:
     requirement = 'setuptools'
 
+env = dict(os.environ,
+           PYTHONPATH=
+           ws.find(pkg_resources.Requirement.parse(requirement)).location
+           )
+
+cmd = [quote(sys.executable),
+       '-c',
+       quote('from setuptools.command.easy_install import main; main()'),
+       '-mqNxd',
+       quote(tmpeggs)]
+
+if 'bootstrap-testing-find-links' in os.environ:
+    cmd.extend(['-f', os.environ['bootstrap-testing-find-links']])
+
+cmd.append('zc.buildout' + VERSION)
+
 if is_jython:
     import subprocess
+    exitcode = subprocess.Popen(cmd, env=env).wait()
+else: # Windows prefers this, apparently; otherwise we would prefer subprocess
+    exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
+assert exitcode == 0
 
-    assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
-           quote(tmpeggs), 'zc.buildout' + VERSION],
-           env=dict(os.environ,
-               PYTHONPATH=
-               ws.find(pkg_resources.Requirement.parse(requirement)).location
-               ),
-           ).wait() == 0
-
-else:
-    assert os.spawnle(
-        os.P_WAIT, sys.executable, quote (sys.executable),
-        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout' + VERSION,
-        dict(os.environ,
-            PYTHONPATH=
-            ws.find(pkg_resources.Requirement.parse(requirement)).location
-            ),
-        ) == 0
-
 ws.add_entry(tmpeggs)
 ws.require('zc.buildout' + VERSION)
 import zc.buildout.buildout

Modified: zc.buildout/branches/1.4/buildout.cfg
===================================================================
--- zc.buildout/branches/1.4/buildout.cfg	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/buildout.cfg	2010-08-03 00:03:02 UTC (rev 115394)
@@ -10,15 +10,15 @@
 
 [test]
 recipe = zc.recipe.testrunner
-eggs = 
-  zc.buildout
+eggs =
+  zc.buildout[test]
   zc.recipe.egg
 
 # Tests that can be run wo a network
 [oltest]
 recipe = zc.recipe.testrunner
-eggs = 
-  zc.buildout
+eggs =
+  zc.buildout[test]
   zc.recipe.egg
 defaults =
   [

Modified: zc.buildout/branches/1.4/setup.py
===================================================================
--- zc.buildout/branches/1.4/setup.py	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/setup.py	2010-08-03 00:03:02 UTC (rev 115394)
@@ -12,7 +12,7 @@
 #
 ##############################################################################
 name = "zc.buildout"
-version = "1.4.3"
+version = "1.4.4"
 
 import os
 from setuptools import setup
@@ -83,6 +83,7 @@
     install_requires = 'setuptools',
     include_package_data = True,
     entry_points = entry_points,
+    extras_require = dict(test=['zope.testing']),
     zip_safe=False,
     classifiers = [
        'Intended Audience :: Developers',

Modified: zc.buildout/branches/1.4/src/zc/buildout/allowhosts.txt
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/allowhosts.txt	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/allowhosts.txt	2010-08-03 00:03:02 UTC (rev 115394)
@@ -2,14 +2,14 @@
 -----------
 
 On some environments the links visited by `zc.buildout` can be forbidden
-by paranoiac firewalls. These URL might be on the chain of links 
+by paranoiac firewalls. These URL might be on the chain of links
 visited by `zc.buildout` whether they are defined in the `find-links` option
 or by various eggs in their `url`, `download_url` and `dependency_links` metadata.
 
-It is even harder to track that package_index works like a spider and 
+It is even harder to track that package_index works like a spider and
 might visit links and go to other location.
 
-The `allow-hosts` option provides a way to prevent this, and 
+The `allow-hosts` option provides a way to prevent this, and
 works exactly like the one provided in `easy_install`
 (see `easy_install allow-hosts option`_).
 
@@ -17,7 +17,7 @@
 
     [buildout]
     ...
-    
+
     allow-hosts =
         *.python.org
         example.com
@@ -36,7 +36,7 @@
     ...     zip_safe=True, version='1')
     ... ''')
 
-Now let's configure the buildout to use the develop egg, 
+Now let's configure the buildout to use the develop egg,
 together with some rules that disallow any website but PyPI and
 local files::
 
@@ -115,13 +115,14 @@
     ... [buildout]
     ... parts=python
     ... foo = ${python:interpreter}
-    ... 
+    ...
     ... [python]
     ... recipe=zc.recipe.egg
     ... eggs=zc.buildout
     ... interpreter=python
     ... ''')
-    >>> print system(buildout)
+    >>> print 'XX'; print system(buildout) # doctest: +ELLIPSIS
+    X...
     Unused options for buildout: 'foo'.
     Installing python.
     Generated script '/sample-buildout/bin/buildout'.

Modified: zc.buildout/branches/1.4/src/zc/buildout/buildout.py
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/buildout.py	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/buildout.py	2010-08-03 00:03:02 UTC (rev 115394)
@@ -123,7 +123,23 @@
     'log-format': '',
     }, 'DEFAULT_VALUE')
 
+# _buildout_version and _buildout_1_4_default_versions are part of a
+# hack specific to zc.buildout 1.4.4. Search for
+# _buildout_1_4_default_versions below to see the usage.
+_buildout_version = pkg_resources.working_set.find(
+    pkg_resources.Requirement.parse('zc.buildout')).version
 
+_buildout_1_4_default_versions = {
+    # Buildout and recipes that are likely to change to 1.5.0 sooner rather
+    # than later.
+    'zc.buildout': _buildout_version,
+    'zc.recipe.egg': '1.2.2',
+    'zc.recipe.testrunner': '1.3.0',
+    'z3c.recipe.i18n': '0.7.0',
+    'z3c.recipe.tag:': '0.3.0',
+    'djangorecipe': '0.20',
+    }
+
 class Buildout(UserDict.DictMixin):
 
     def __init__(self, config_file, cloptions,
@@ -261,9 +277,16 @@
             options['newest'] = newest
         self.newest = newest == 'true'
 
-        versions = options.get('versions')
-        if versions:
-            zc.buildout.easy_install.default_versions(dict(self[versions]))
+        # This is a hacked version of zc.buildout for 1.4.4.
+        # This means that buildout uses the defaults set up above.  The point
+        # of it is to keep from migrating to 1.5 unless explicitly
+        # requested.  This lets 1.4.4 be an "aspirin release" that people can
+        # use if they are having trouble with the 1.5 releases.
+        versions = _buildout_1_4_default_versions.copy()
+        versions_section = options.get('versions')
+        if versions_section:
+            versions.update(dict(self[versions_section]))
+        zc.buildout.easy_install.default_versions(versions)
 
         prefer_final = options.get('prefer-final', 'false')
         if prefer_final not in ('true', 'false'):

Modified: zc.buildout/branches/1.4/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/easy_install.txt	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/easy_install.txt	2010-08-03 00:03:02 UTC (rev 115394)
@@ -367,7 +367,8 @@
 If called with an argument, it sets the default versions:
 
     >>> zc.buildout.easy_install.default_versions(dict(demoneeded='1'))
-    {}
+    ... # doctest: +ELLIPSIS
+    {...}
 
 It always returns the previous default versions.  If called without an
 argument, it simply returns the default versions without changing

Modified: zc.buildout/branches/1.4/src/zc/buildout/testing_bugfix.txt
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/testing_bugfix.txt	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/testing_bugfix.txt	2010-08-03 00:03:02 UTC (rev 115394)
@@ -15,7 +15,7 @@
     >>> len(logging.getLogger().handlers)
     1
     >>> logging.getLogger().handlers # doctest: +ELLIPSIS
-    [<zope.testing.testrunner.logsupport.NullHandler instance at ...>]
+    [<zope...testrunner.logsupport.NullHandler instance at ...>]
 
 After calling it, a ``logging.StreamHandler`` was added:
 
@@ -27,7 +27,7 @@
     >>> len(logging.getLogger().handlers)
     2
     >>> logging.getLogger().handlers # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
-    [<zope.testing.testrunner.logsupport.NullHandler instance at ...>,
+    [<zope...testrunner.logsupport.NullHandler instance at ...>,
      <logging.StreamHandler instance at ...>]
 
 But tear down removes the new logging handler:
@@ -36,4 +36,4 @@
     >>> len(logging.getLogger().handlers)
     1
     >>> logging.getLogger().handlers # doctest: +ELLIPSIS
-    [<zope.testing.testrunner.logsupport.NullHandler instance at ...>]
+    [<zope...testrunner.logsupport.NullHandler instance at ...>]

Modified: zc.buildout/branches/1.4/src/zc/buildout/tests.py
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/tests.py	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/tests.py	2010-08-03 00:03:02 UTC (rev 115394)
@@ -2779,37 +2779,33 @@
 
 egg_parse = re.compile('([0-9a-zA-Z_.]+)-([0-9a-zA-Z_.]+)-py(\d[.]\d).egg$'
                        ).match
-def makeNewRelease(project, ws, dest):
+def makeNewRelease(project, ws, dest, version='99.99'):
     dist = ws.find(pkg_resources.Requirement.parse(project))
     eggname, oldver, pyver = egg_parse(
         os.path.basename(dist.location)
         ).groups()
-    dest = os.path.join(dest, "%s-99.99-py%s.egg" % (eggname, pyver))
+    dest = os.path.join(dest, "%s-%s-py%s.egg" % (eggname, version, pyver))
     if os.path.isfile(dist.location):
         shutil.copy(dist.location, dest)
         zip = zipfile.ZipFile(dest, 'a')
         zip.writestr(
             'EGG-INFO/PKG-INFO',
             zip.read('EGG-INFO/PKG-INFO').replace("Version: %s" % oldver,
-                                                  "Version: 99.99")
+                                                  "Version: %s" % version)
             )
         zip.close()
     else:
         shutil.copytree(dist.location, dest)
         info_path = os.path.join(dest, 'EGG-INFO', 'PKG-INFO')
         info = open(info_path).read().replace("Version: %s" % oldver,
-                                              "Version: 99.99")
+                                              "Version: %s" % version)
         open(info_path, 'w').write(info)
 
-
-def updateSetup(test):
-    zc.buildout.testing.buildoutSetUp(test)
-    new_releases = test.globs['tmpdir']('new_releases')
-    test.globs['new_releases'] = new_releases
+def getWorkingSetWithBuildoutEgg(test):
     sample_buildout = test.globs['sample_buildout']
     eggs = os.path.join(sample_buildout, 'eggs')
 
-    # If the zc.buildout dist is a develo dist, convert it to a
+    # If the zc.buildout dist is a develop dist, convert it to a
     # regular egg in the sample buildout
     req = pkg_resources.Requirement.parse('zc.buildout')
     dist = pkg_resources.working_set.find(req)
@@ -2818,7 +2814,8 @@
         here = os.getcwd()
         os.chdir(os.path.dirname(dist.location))
         assert os.spawnle(
-            os.P_WAIT, sys.executable, zc.buildout.easy_install._safe_arg (sys.executable),
+            os.P_WAIT, sys.executable,
+            zc.buildout.easy_install._safe_arg(sys.executable),
             os.path.join(os.path.dirname(dist.location), 'setup.py'),
             '-q', 'bdist_egg', '-d', eggs,
             dict(os.environ,
@@ -2838,14 +2835,25 @@
             os.path.join(sample_buildout, 'bin'))
     else:
         ws = pkg_resources.working_set
+    return ws
 
+def updateSetup(test):
+    zc.buildout.testing.buildoutSetUp(test)
+    new_releases = test.globs['tmpdir']('new_releases')
+    test.globs['new_releases'] = new_releases
+    ws = getWorkingSetWithBuildoutEgg(test)
     # now let's make the new releases
     makeNewRelease('zc.buildout', ws, new_releases)
+    os.mkdir(os.path.join(new_releases, 'zc.buildout'))
     makeNewRelease('setuptools', ws, new_releases)
-
-    os.mkdir(os.path.join(new_releases, 'zc.buildout'))
     os.mkdir(os.path.join(new_releases, 'setuptools'))
 
+def bootstrapSetup(test):
+    easy_install_SetUp(test)
+    sample_eggs = test.globs['sample_eggs']
+    ws = getWorkingSetWithBuildoutEgg(test)
+    makeNewRelease('zc.buildout', ws, sample_eggs, '1.4.4')
+    os.environ['bootstrap-testing-find-links'] = test.globs['link_server']
 
 
 normalize_bang = (
@@ -3031,7 +3039,7 @@
     if os.path.exists(bootstrap_py):
         test_suite.append(doctest.DocFileSuite(
             'bootstrap.txt',
-            setUp=easy_install_SetUp,
+            setUp=bootstrapSetup,
             tearDown=zc.buildout.testing.buildoutTearDown,
             checker=renormalizing.RENormalizing([
                zc.buildout.testing.normalize_path,

Modified: zc.buildout/branches/1.4/src/zc/buildout/update.txt
===================================================================
--- zc.buildout/branches/1.4/src/zc/buildout/update.txt	2010-08-02 22:40:29 UTC (rev 115393)
+++ zc.buildout/branches/1.4/src/zc/buildout/update.txt	2010-08-03 00:03:02 UTC (rev 115394)
@@ -1,11 +1,21 @@
 Automatic Buildout Updates
 ==========================
 
-When a buildout is run, one of the first steps performed is to check
-for updates to either zc.buildout or setuptools.  To demonstrate this,
-we've creates some "new releases" of buildout and setuptools in a
-new_releases folder:
+NOTE: buildout 1.4.4 is a version that has been hacked to prefer itself, and
+not upgrade.  It is intended as a way for people who have trouble with the new
+1.5 line to easily keep from upgrading until they are ready.  In the future,
+we suggest that you specify the versions of your dependencies using the
+standard buildout mechanism
+(http://pypi.python.org/pypi/zc.buildout#repeatable-buildouts-controlling-eggs-used).
+However, for now, you can use 1.4.4 to easily control your dependencies.
+When this file changes because of the hack, the documentation indicates this
+with a "HACK" label.
 
+When a buildout is run, one of the first steps performed is to check for
+updates to either zc.buildout or setuptools (HACK: not zc.buildout).  To
+demonstrate this, we've created some "new releases" of buildout and
+setuptools in a new_releases folder:
+
     >>> ls(new_releases)
     d  setuptools
     -  setuptools-99.99-py2.4.egg
@@ -61,31 +71,29 @@
 
 
 Now if we run the buildout, the buildout will upgrade itself to the
-new versions found in new releases:
+new versions found in new releases (HACK: only setuptools):
 
     >>> print system(buildout),
-    Getting distribution for 'zc.buildout'.
-    Got zc.buildout 99.99.
     Getting distribution for 'setuptools'.
     Got setuptools 99.99.
     Upgraded:
-      zc.buildout version 99.99,
       setuptools version 99.99;
     restarting.
     Generated script '/sample-buildout/bin/buildout'.
     Develop: '/sample-buildout/showversions'
     Installing show-versions.
-    zc.buildout 99.99
+    zc.buildout 1.4.4
     setuptools 99.99
 
-Our buildout script has been updated to use the new eggs:
+Our buildout script has been updated to use the new eggs (HACK: only for
+setuptools):
 
     >>> cat(sample_buildout, 'bin', 'buildout')
     #!/usr/local/bin/python2.4
     <BLANKLINE>
     import sys
     sys.path[0:0] = [
-      '/sample-buildout/eggs/zc.buildout-99.99-py2.4.egg',
+      '/sample-buildout/eggs/zc.buildout-1.4.4-py2.4.egg',
       '/sample-buildout/eggs/setuptools-99.99-py2.4.egg',
       ]
     <BLANKLINE>
@@ -95,8 +103,8 @@
         zc.buildout.buildout.main()
 
 Now, let's recreate the sample buildout. If we specify constraints on
-the versions of zc.buildout and setuptools to use, running the
-buildout will install earlier versions of these packages:
+the versions of zc.buildout and setuptools to use, running the buildout
+will install earlier versions of these packages (HACK: only setuptools):
 
     >>> write(sample_buildout, 'buildout.cfg',
     ... """
@@ -116,7 +124,6 @@
 
     >>> print system(buildout),
     Upgraded:
-      zc.buildout version 1.0.0,
       setuptools version 0.6;
     restarting.
     Generated script '/sample-buildout/bin/buildout'.
@@ -175,8 +182,6 @@
     Creating directory '/sample_buildout2/parts'.
     Creating directory '/sample_buildout2/eggs'.
     Creating directory '/sample_buildout2/develop-eggs'.
-    Getting distribution for 'zc.buildout'.
-    Got zc.buildout 99.99.
     Getting distribution for 'setuptools'.
     Got setuptools 99.99.
     Not upgrading because not running a local buildout command.



More information about the checkins mailing list