[Checkins] SVN: zope.release/branches/3.4/ Backport of feature improvements:

Stephan Richter srichter at cosmos.phy.tufts.edu
Sat Nov 10 13:23:09 EST 2007


Log message for revision 81727:
  Backport of feature improvements:
  
  Log message for revision 81726:
  
    - Added support for a new `extends` option that allows using other controlled
      package configurations as a base.
    
    Note: I shamelessly copied the code from buildout.
  
  Log message for revision 81725:
  
    - Refactored configuration file parsing into a new module that provides
      object-oriented output.
    
    - Added tests for the existing code.
    
    - Update package data
  
  

Changed:
  A   zope.release/branches/3.4/CHANGES.txt
  U   zope.release/branches/3.4/buildout.cfg
  U   zope.release/branches/3.4/controlled-packages.cfg
  U   zope.release/branches/3.4/setup.py
  A   zope.release/branches/3.4/src/zope/release/README.txt
  U   zope.release/branches/3.4/src/zope/release/buildout.cfg.in
  U   zope.release/branches/3.4/src/zope/release/buildout.py
  A   zope.release/branches/3.4/src/zope/release/kgs.py
  A   zope.release/branches/3.4/src/zope/release/tests.py
  U   zope.release/branches/3.4/src/zope/release/tree.py
  U   zope.release/branches/3.4/src/zope/release/upload.py
  U   zope.release/branches/3.4/src/zope/release/version.py

-=-
Copied: zope.release/branches/3.4/CHANGES.txt (from rev 81726, zope.release/trunk/CHANGES.txt)
===================================================================
--- zope.release/branches/3.4/CHANGES.txt	                        (rev 0)
+++ zope.release/branches/3.4/CHANGES.txt	2007-11-10 18:23:08 UTC (rev 81727)
@@ -0,0 +1,30 @@
+=======
+CHANGES
+=======
+
+NOTE: The release of this package are synced with the Zope 3 releases.
+
+
+3.4.0 (2007-11-??)
+------------------
+
+- Added support for a new `extends` option that allows using other controlled
+  package configurations as a base.
+
+- Refactored configuration file parsing into a new module that provides
+  object-oriented output.
+
+- Added tests for the existing code.
+
+- Update package data.
+
+3.4.0b2 (2007-11-05)
+--------------------
+
+- Initial version
+
+  * Generate `versions.cfg` and `buildout.cfg` script.
+
+  * Upload to KGS.
+
+  * Update Zope 3 source tree.

Modified: zope.release/branches/3.4/buildout.cfg
===================================================================
--- zope.release/branches/3.4/buildout.cfg	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/buildout.cfg	2007-11-10 18:23:08 UTC (rev 81727)
@@ -1,13 +1,17 @@
 [buildout]
 develop = .
-parts = generate-buildout generate-versions upload update-tree
+index = http://download.zope.org/zope3.4
+parts = test generate-buildout generate-versions upload update-tree
 
+[test]
+recipe = zc.recipe.testrunner
+eggs = zope.release [test]
+
 [generate-buildout]
 recipe = zc.recipe.egg:scripts
 eggs = zope.release
 scripts = generate-buildout
 arguments = ('controlled-packages.cfg',
-             'http://download.zope.org/zope3.4',
              './test/buildout.cfg')
 
 [generate-versions]
@@ -23,6 +27,8 @@
 scripts = upload
 arguments = ('./test/buildout.cfg',
              './test/versions.cfg',
+             # Activate this line in the tag.
+             #'./test/versions.cfg = versions-3.4.0.cfg',
              './controlled-packages.cfg',
              'download.zope.org:/var/www/download.zope.org/zope3.4',)
 

Modified: zope.release/branches/3.4/controlled-packages.cfg
===================================================================
--- zope.release/branches/3.4/controlled-packages.cfg	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/controlled-packages.cfg	2007-11-10 18:23:08 UTC (rev 81727)
@@ -1,6 +1,9 @@
 [DEFAULT]
 tested=true
 
+[KGS]
+name = zope
+
 [ClientForm]
 tested=false
 versions = 0.2.7

Modified: zope.release/branches/3.4/setup.py
===================================================================
--- zope.release/branches/3.4/setup.py	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/setup.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -12,16 +12,51 @@
 #
 ##############################################################################
 """Setup for ``zope.release`` project"""
-from setuptools import setup
+import os
+from setuptools import setup, find_packages
 
-setup(
-    name='zope.release',
-    version='0.1.0',
-    package_dir = {'': 'src'},
-    entry_points = dict(console_scripts=[
-        'generate-buildout = zope.release.buildout:main',
-        'generate-versions = zope.release.version:main',
-        'upload = zope.release.upload:main',
-        'update-tree = zope.release.tree:main',
-        ])
-    )
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+setup(name='zope.release',
+      version = '3.4',
+      author='Zope Corporation and Contributors',
+      author_email='zope3-dev at zope.org',
+      description='Zope Release and Known-Good-Set (KGS) Support',
+      long_description=(
+          read('README.txt')
+          + '\n\n' +
+          read('src', 'zope', 'release', 'README.txt')
+          + '\n\n' +
+          read('CHANGES.txt')
+          ),
+      keywords = "zope3 setuptools egg kgs release",
+      classifiers = [
+          'Development Status :: 4 - Beta',
+          'Intended Audience :: Developers',
+          'License :: OSI Approved :: Zope Public License',
+          'Programming Language :: Python',
+          'Natural Language :: English',
+          'Operating System :: OS Independent',
+          'Topic :: Internet :: WWW/HTTP',
+          'Framework :: Zope3'],
+      url='http://cheeseshop.python.org/pypi/zope.release',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'': 'src'},
+      namespace_packages=['zope'],
+      extras_require = dict(
+          test=['zope.testing']),
+      install_requires=[
+          'setuptools',
+          'zc.buildout',
+          ],
+      entry_points = dict(console_scripts=[
+          'generate-buildout = zope.release.buildout:main',
+          'generate-versions = zope.release.version:main',
+          'upload = zope.release.upload:main',
+          'update-tree = zope.release.tree:main',
+          ]),
+      include_package_data = True,
+      zip_safe = False,
+      )

Copied: zope.release/branches/3.4/src/zope/release/README.txt (from rev 81726, zope.release/trunk/src/zope/release/README.txt)
===================================================================
--- zope.release/branches/3.4/src/zope/release/README.txt	                        (rev 0)
+++ zope.release/branches/3.4/src/zope/release/README.txt	2007-11-10 18:23:08 UTC (rev 81727)
@@ -0,0 +1,316 @@
+==================
+Zope Release Tools
+==================
+
+This package provides a set of scripts and tools to manage Good-Known-Sets, or
+short KGSs. A KGS is a set of package distributions that are known to work
+well together. You can verify this, for example, by running all the tests of
+all the packages at once.
+
+Let me show you how a typical controlled packages configuration file looks
+like:
+
+  >>> import tempfile
+  >>> cfgFile = tempfile.mktemp('-cp.cfg')
+  >>> open(cfgFile, 'w').write('''\
+  ... [DEFAULT]
+  ... tested = true
+  ...
+  ... [KGS]
+  ... name = zope-dev
+  ...
+  ... [packageA]
+  ... versions = 1.0.0
+  ...            1.0.1
+  ...
+  ... [packageB]
+  ... versions = 1.2.3
+  ...
+  ... [packageC]
+  ... # Do not test this package.
+  ... tested = false
+  ... versions = 4.3.1
+  ... ''')
+
+As you can see, this file uses an INI-style format. The "DEFAULT" section is
+special, as it will insert the specified options into all other sections as
+default. The "KGS" section specifies some global information about the KGS,
+such as the name of the KGS.
+
+All other sections refer to package names. Currently each package section
+supports two options. The "versions" option lists all versions that are known
+to work in the KGS. Those versions should *always* only be bug fixes to the
+first listed version. The second option, "tested", specifies whether the
+package should be part of the KGS test suite. By default, we want all packages
+to be tested, but some packages require very specific test setups that cannot
+be easily reproduced _[1], so we turn off those tests.
+
+You can also stack controlled package configurations on top of each
+other. Base configurations can be specified using the `extends` option:
+
+  >>> import tempfile
+  >>> cfgFile2 = tempfile.mktemp('-cp.cfg')
+  >>> open(cfgFile2, 'w').write('''\
+  ... [DEFAULT]
+  ... tested = true
+  ...
+  ... [KGS]
+  ... name = grok-dev
+  ... extends = %s
+  ...
+  ... [packageA]
+  ... versions = 1.0.2
+  ...
+  ... [packageD]
+  ... versions = 2.2.3
+  ...            2.2.4
+  ... ''' %cfgFile)
+
+As you can see, you can completely override another package's version
+specification as well.
+
+Generating the configuration file and managing it is actually the hard
+part. Let's now see what we can do with it.
+
+.. [1]: This is usually due to bugs in setuptools or buildout, such as PYC
+files not containing the correct reference to their PY file.
+
+
+Generate Versions
+-----------------
+
+One of the easiest scripts, is the version generation. This script will
+generate a "versions" section that is compatible with buildout.
+
+  >>> versionsFile = tempfile.mktemp('-versions.cfg')
+
+  >>> from zope.release import version
+  >>> version.main((cfgFile, versionsFile))
+
+  >>> print open(versionsFile, 'r').read()
+  [versions]
+  packageA = 1.0.1
+  packageB = 1.2.3
+  packageC = 4.3.1
+
+Let's now ensure that the versions also work for the extended configuration:
+
+  >>> versionsFile2 = tempfile.mktemp('-versions.cfg')
+
+  >>> from zope.release import version
+  >>> version.main((cfgFile2, versionsFile2))
+
+  >>> print open(versionsFile2, 'r').read()
+  [versions]
+  packageA = 1.0.2
+  packageB = 1.2.3
+  packageC = 4.3.1
+  packageD = 2.2.4
+
+
+Generate Buildout
+-----------------
+
+In order to be able to test the KGS, you can also generate a full buildout
+file that will create and install a testrunner over all packages for you:
+
+  >>> buildoutFile = tempfile.mktemp('-buildout.cfg')
+
+  >>> from zope.release import buildout
+  >>> buildout.main((cfgFile, buildoutFile))
+
+  >>> print open(buildoutFile, 'r').read()
+  [buildout]
+  parts = test
+  versions = versions
+  <BLANKLINE>
+  [test]
+  recipe = zc.recipe.testrunner
+  eggs = packageA
+      packageB
+  <BLANKLINE>
+  [versions]
+  packageA = 1.0.1
+  packageB = 1.2.3
+  packageC = 4.3.1
+  <BLANKLINE>
+
+Let's make sure that the buildout generation also honors the extensions:
+
+  >>> buildoutFile2 = tempfile.mktemp('-buildout.cfg')
+
+  >>> from zope.release import buildout
+  >>> buildout.main((cfgFile2, buildoutFile2))
+
+  >>> print open(buildoutFile2, 'r').read()
+  [buildout]
+  parts = test
+  versions = versions
+  <BLANKLINE>
+  [test]
+  recipe = zc.recipe.testrunner
+  eggs = packageA
+      packageB
+      packageD
+  <BLANKLINE>
+  [versions]
+  packageA = 1.0.2
+  packageB = 1.2.3
+  packageC = 4.3.1
+  packageD = 2.2.4
+  <BLANKLINE>
+
+
+Uploading Files
+---------------
+
+Once the generated files are tested and ready for upload, you can use the
+upload script to upload the files to the KGS. Since we do not actually want to
+upload files, we simply switch into dry-run mode:
+
+  >>> from zope.release import upload
+  >>> upload.DRY_RUN = True
+
+  >>> upload.main((
+  ...     cfgFile, versionsFile, buildoutFile,
+  ...     'download.zope.org:/zope-dev'
+  ...     ))
+  scp ...-cp.cfg download.zope.org:/zope-dev/...-cp.cfg
+  scp ...-versions.cfg download.zope.org:/zope-dev/...-versions.cfg
+  scp ...-buildout.cfg download.zope.org:/zope-dev/...-buildout.cfg
+
+
+Updating the Zope 3 Tree
+------------------------
+
+Since we still want to create a Zope 3 source tree release, we need ot be able
+to update its externals using the information of the controlled packages
+file. Since this script is clearly Zope3-specific, we need a new controlled
+packages config file that contains actual packages:
+
+  >>> import tempfile
+  >>> zopeCfgFile = tempfile.mktemp('-cp.cfg')
+  >>> open(zopeCfgFile, 'w').write('''\
+  ... [DEFAULT]
+  ... tested = true
+  ...
+  ... [KGS]
+  ... name = zope-dev
+  ...
+  ... [ZODB3]
+  ... versions = 1.0.0
+  ...
+  ... [ZConfig]
+  ... versions = 1.1.0
+  ...
+  ... [pytz]
+  ... versions = 2007g
+  ...
+  ... [zope.interface]
+  ... versions = 1.2.0
+  ...
+  ... [zope.app.container]
+  ... versions = 1.3.0
+  ... ''')
+
+We also need to stub the command execution, since we do not have an actual Zope
+3 tree checked out:
+
+  >>> cmdOutput = {
+  ...     'svn propget svn:externals Zope3/src': '''\
+  ... docutils   path/to/docutils
+  ... pytz       path/to/pytz
+  ... twisted    path/to/twisted
+  ... ZConfig    path/to/ZConfig
+  ... ZODB       path/to/ZODB''',
+  ...     'svn propget svn:externals Zope3/src/zope': '''\
+  ... interface  path/to/zope/interface''',
+  ...     'svn propget svn:externals Zope3/src/zope/app': '''\
+  ... container  path/to/zope/app/container''',
+  ... }
+
+  >>> def do(cmd):
+  ...     print cmd
+  ...     print '-----'
+  ...     return cmdOutput.get(cmd, '')
+
+  >>> from zope.release import tree
+  >>> tree.do = do
+
+Let's now run the tree update:
+
+  >>> tree.main((zopeCfgFile, 'Zope3'))
+  svn propget svn:externals Zope3/src
+  -----
+  svn propset svn:externals
+    "docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0/
+     pytz svn://svn.zope.org/repos/main/pytz/tags/2007g/src/pytz
+     twisted svn://svn.twistedmatrix.com/.../twisted-core-2.5.0/twisted
+     ZConfig svn://svn.zope.org/repos/main/ZConfig/tags/1.1.0/ZConfig
+     ZODB svn://svn.zope.org/repos/main/ZODB/tags/1.0.0/src/ZODB"
+    Zope3/src
+  -----
+  svn propget svn:externals Zope3/src/zope
+  -----
+  svn propset svn:externals
+    "interface svn://svn.zope.org/repos/main/zope.interface/tags/1.2.0/src/zope/interface" Zope3/src/zope
+  -----
+  svn propget svn:externals Zope3/src/zope/app
+  -----
+  svn propset svn:externals
+    "container svn://svn.zope.org/repos/main/zope.app.container/tags/1.3.0/src/zope/app/container" Zope3/src/zope/app
+  -----
+
+
+Basic Parser API
+----------------
+
+The ``kgs.py`` module provides a simple class that parses the KGS
+configuration file and provides all data in an object-oriented manner.
+
+  >>> from zope.release import kgs
+
+The class is simply instnatiated using the path to the config file:
+
+  >>> myKGS = kgs.KGS(cfgFile)
+  >>> myKGS
+  <KGS 'zope-dev'>
+
+The name of the KGS is available via the `name` attribute:
+
+  >>> myKGS.name
+  'zope-dev'
+
+The packages are available under `packages`:
+
+  >>> myKGS.packages
+  [<Package 'packageA'>, <Package 'packageB'>, <Package 'packageC'>]
+
+Each package is also an object:
+
+  >>> pkgA = myKGS.packages[0]
+  >>> pkgA
+  <Package 'packageA'>
+
+  >>> pkgA.name
+  'packageA'
+  >>> pkgA.versions
+  ['1.0.0', '1.0.1']
+  >>> pkgA.tested
+  True
+
+As we have seen in the scripts above, the KGS class also supports the
+`entends` option. Thus, let's load the KGS for the config file 2:
+
+  >>> myKGS2 = kgs.KGS(cfgFile2)
+  >>> myKGS2
+  <KGS 'grok-dev'>
+
+  >>> myKGS2.name
+  'grok-dev'
+
+  >>> myKGS2.packages
+  [<Package 'packageA'>,
+   <Package 'packageB'>,
+   <Package 'packageC'>,
+   <Package 'packageD'>]

Modified: zope.release/branches/3.4/src/zope/release/buildout.cfg.in
===================================================================
--- zope.release/branches/3.4/src/zope/release/buildout.cfg.in	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/src/zope/release/buildout.cfg.in	2007-11-10 18:23:08 UTC (rev 81727)
@@ -1,6 +1,5 @@
 [buildout]
 parts = test
-index = %(index-url)s
 versions = versions
 
 [test]

Modified: zope.release/branches/3.4/src/zope/release/buildout.py
===================================================================
--- zope.release/branches/3.4/src/zope/release/buildout.py	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/src/zope/release/buildout.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -13,17 +13,12 @@
 ##############################################################################
 """Generate a ``buildout.cfg`` file from the controlled list of packages.
 
-Usage: generate-buildout package-cfg-path index-url [output-cfg-path]
+Usage: generate-buildout package-cfg-path [output-cfg-path]
 
 * ``package-cfg-path``
 
   This is the path to the controlled packages configuration file.
 
-* ``index-url``
-
-  The URL of the index to use. This is usually the index of the controlled
-  pacakges.
-
 * ``output-cfg-path``
 
   The path of the file under which the generated buildout configuration file
@@ -34,39 +29,24 @@
 import ConfigParser
 import os
 
-def getPackagesInfo(packageConfigPath):
-    """Read all information from the controlled package configuration."""
-    config = ConfigParser.RawConfigParser()
-    config.read(packageConfigPath)
-    packages = []
-    sections = config.sections()
-    sections.sort()
-    for section in sections:
-        packages.append((
-            section,
-            config.get(section, 'versions').split(),
-            config.getboolean(section, 'tested')
-            ))
-    return packages
+from zope.release import kgs
 
-
 def getVersionsListing(packages):
     """Create a version listing string."""
     return '\n'.join(
-        [name + ' = ' + version[-1]
-         for (name, version, tested) in packages])
+        [package.name + ' = ' + package.versions[-1]
+         for package in packages])
 
 
-def generateBuildout(packageConfigPath, indexUrl, outputPath):
+def generateBuildout(packageConfigPath, outputPath):
     """Generate a ``buildout.cfg`` from the list of controlled packages."""
     # Load all package information from the controlled pacakge config file.
-    packages = getPackagesInfo(packageConfigPath)
+    packages = kgs.KGS(packageConfigPath).packages
 
     # Create the data dictionary
     data = {
-        'index-url': indexUrl,
         'tested-packages': '\n    '.join(
-            [p for (p, v, t) in packages if t]),
+            [package.name for package in packages if package.tested]),
         'versions': getVersionsListing(packages)
         }
 
@@ -79,16 +59,15 @@
     if args is None:
         args = sys.argv[1:]
 
-    if len(args) < 2:
+    if len(args) < 1:
         print __file__.__doc__
         sys.exit(1)
 
     packageConfigPath = os.path.abspath(args[0])
-    indexUrl = args[1]
 
     outputPath = os.path.join(
         os.path.dirname(packageConfigPath), 'test-buildout.cfg')
-    if len(args) == 3:
-        outputPath = args[2]
+    if len(args) == 2:
+        outputPath = args[1]
 
-    generateBuildout(packageConfigPath, indexUrl, outputPath)
+    generateBuildout(packageConfigPath, outputPath)

Copied: zope.release/branches/3.4/src/zope/release/kgs.py (from rev 81726, zope.release/trunk/src/zope/release/kgs.py)
===================================================================
--- zope.release/branches/3.4/src/zope/release/kgs.py	                        (rev 0)
+++ zope.release/branches/3.4/src/zope/release/kgs.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -0,0 +1,113 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""KGS configuration file parser."""
+import os.path
+import urllib2
+import ConfigParser
+from zc.buildout.buildout import _update, _isurl
+
+MAIN_SECTION = 'KGS'
+EXTENDS_OPTION = 'extends'
+
+def _open(base, filename, seen):
+    """Open a configuration file and return the result as a dictionary,
+
+    Recursively open other files based on options found.
+
+    Note: Shamelessly copied from zc.buildout!
+    """
+
+    if _isurl(filename):
+        fp = urllib2.urlopen(filename)
+        base = filename[:filename.rfind('/')]
+    elif _isurl(base):
+        if os.path.isabs(filename):
+            fp = open(filename)
+            base = os.path.dirname(filename)
+        else:
+            filename = base + '/' + filename
+            fp = urllib2.urlopen(filename)
+            base = filename[:filename.rfind('/')]
+    else:
+        filename = os.path.join(base, filename)
+        fp = open(filename)
+        base = os.path.dirname(filename)
+
+    if filename in seen:
+        raise ValueError("Recursive file include", seen, filename)
+
+    seen.append(filename)
+
+    result = {}
+
+    parser = ConfigParser.RawConfigParser()
+    parser.optionxform = lambda s: s
+    parser.readfp(fp)
+    extends = None
+    for section in parser.sections():
+        options = dict(parser.items(section))
+        if section == MAIN_SECTION:
+            extends = options.pop(EXTENDS_OPTION, extends)
+        result[section] = options
+
+    if extends:
+        extends = extends.split()
+        extends.reverse()
+        for fname in extends:
+            result = _update(_open(base, fname, seen), result)
+
+    seen.pop()
+    return result
+
+
+class Package(object):
+
+    def __init__(self, name, versions, tested):
+        self.name = name
+        self.versions = versions
+        self.tested = tested
+
+    def __repr__(self):
+        return '<%s %r>' %(self.__class__.__name__, self.name)
+
+
+class KGS(object):
+
+    name = u''
+    packages = ()
+
+    def __init__(self, path):
+        self.path = path
+        self._extract()
+
+    def _extract(self):
+        result = _open(os.path.dirname(self.path), self.path, [])
+        if MAIN_SECTION in result:
+            self.name = result[MAIN_SECTION].get('name', u'')
+            del result[MAIN_SECTION]
+        self.packages = []
+        sections = result.keys()
+        sections.sort()
+        for section in sections:
+            self.packages.append(
+                Package(section,
+                        result[section]['versions'].split(),
+                        ConfigParser.ConfigParser._boolean_states[
+                            result[section]['tested']]
+                        )
+                )
+
+    def __repr__(self):
+        return '<%s %r>' %(self.__class__.__name__, self.name)
+

Copied: zope.release/branches/3.4/src/zope/release/tests.py (from rev 81726, zope.release/trunk/src/zope/release/tests.py)
===================================================================
--- zope.release/branches/3.4/src/zope/release/tests.py	                        (rev 0)
+++ zope.release/branches/3.4/src/zope/release/tests.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -0,0 +1,29 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""zope.release tools tests
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+import unittest
+from zope.testing import doctest
+from zope.testing.doctestunit import DocFileSuite
+
+def test_suite():
+    return unittest.TestSuite((
+        DocFileSuite('README.txt',
+                     optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
+                     ),
+        ))

Modified: zope.release/branches/3.4/src/zope/release/tree.py
===================================================================
--- zope.release/branches/3.4/src/zope/release/tree.py	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/src/zope/release/tree.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -17,7 +17,7 @@
 Usage: update-tree [path-to-controlled-packages.cfg] [Zope3-Tree-Path]
 """
 import os, sys, popen2
-from zope.release import buildout
+from zope.release import kgs
 
 SVN_TEMPLATE = 'svn://svn.zope.org/repos/main/%s/tags/%s/%s'
 PROPGET_TEMPLATE = 'svn propget svn:externals %s'
@@ -66,8 +66,8 @@
     tree_path = args[1]
 
     pkg_versions = dict([
-        (pkg, versions[-1])
-        for (pkg, versions, tested) in buildout.getPackagesInfo(cp_path)
+        (pkg.name, pkg.versions[-1])
+        for pkg in kgs.KGS(cp_path).packages
         ])
 
     for prefix, subpath in (('', ('src',)),

Modified: zope.release/branches/3.4/src/zope/release/upload.py
===================================================================
--- zope.release/branches/3.4/src/zope/release/upload.py	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/src/zope/release/upload.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -32,11 +32,14 @@
 """
 import os, sys
 
+DRY_RUN = False
+
 def do(cmd):
     print cmd
-    status = os.system(cmd)
-    if status != 0:
-        sys.exit(status)
+    if not DRY_RUN:
+        status = os.system(cmd)
+        if status != 0:
+            sys.exit(status)
 
 def upload(fileSpecs, destination):
     """Generate a ``buildout.cfg`` from the list of controlled packages."""

Modified: zope.release/branches/3.4/src/zope/release/version.py
===================================================================
--- zope.release/branches/3.4/src/zope/release/version.py	2007-11-10 18:15:27 UTC (rev 81726)
+++ zope.release/branches/3.4/src/zope/release/version.py	2007-11-10 18:23:08 UTC (rev 81727)
@@ -31,12 +31,12 @@
 """
 import os
 
-from zope.release import buildout
+from zope.release import buildout, kgs
 
 def generateVersions(packageConfigPath, outputPath):
     """Generate a ``buildout.cfg`` from the list of controlled packages."""
     # Load all package information from the controlled pacakge config file.
-    packages = buildout.getPackagesInfo(packageConfigPath)
+    packages = kgs.KGS(packageConfigPath).packages
 
     # Write a new versions.cfg file
     open(outputPath, 'w').write(



More information about the Checkins mailing list