[Checkins] SVN: z3c.checkversions/tags/0.2/ tag 0.2

Christophe Combelles ccomb at free.fr
Fri May 21 18:33:44 EDT 2010


Log message for revision 112644:
  tag 0.2
  

Changed:
  A   z3c.checkversions/tags/0.2/
  D   z3c.checkversions/tags/0.2/.hg_archival.txt
  D   z3c.checkversions/tags/0.2/.hgignore
  A   z3c.checkversions/tags/0.2/CHANGELOG.txt
  D   z3c.checkversions/tags/0.2/HISTORY.txt
  A   z3c.checkversions/tags/0.2/LICENSE.txt
  D   z3c.checkversions/tags/0.2/README.txt
  A   z3c.checkversions/tags/0.2/README.txt
  A   z3c.checkversions/tags/0.2/TODO.txt
  D   z3c.checkversions/tags/0.2/setup.py
  A   z3c.checkversions/tags/0.2/setup.py
  D   z3c.checkversions/tags/0.2/z3c/checkversions/base.py
  A   z3c.checkversions/tags/0.2/z3c/checkversions/base.py
  D   z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py
  A   z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py
  D   z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt
  A   z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt
  D   z3c.checkversions/tags/0.2/z3c/checkversions/installed.py
  A   z3c.checkversions/tags/0.2/z3c/checkversions/installed.py
  D   z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt
  A   z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt
  D   z3c.checkversions/tags/0.2/z3c/checkversions/main.py
  A   z3c.checkversions/tags/0.2/z3c/checkversions/main.py
  D   z3c.checkversions/tags/0.2/z3c/checkversions/test.py
  A   z3c.checkversions/tags/0.2/z3c/checkversions/test.py

-=-
Deleted: z3c.checkversions/tags/0.2/.hg_archival.txt
===================================================================
--- z3c.checkversions/trunk/.hg_archival.txt	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/.hg_archival.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,5 +0,0 @@
-repo: a8fea0e1f7782ac1a850ead2105ad0c260a694f5
-node: eadabb3f6acf70028a447de580138387038c3693
-branch: default
-latesttag: null
-latesttagdistance: 12

Deleted: z3c.checkversions/tags/0.2/.hgignore
===================================================================
--- z3c.checkversions/trunk/.hgignore	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/.hgignore	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,4 +0,0 @@
-.*egg-info/
-.*pyc$
-.*swp$
-sandbox/

Copied: z3c.checkversions/tags/0.2/CHANGELOG.txt (from rev 112643, z3c.checkversions/trunk/CHANGELOG.txt)
===================================================================
--- z3c.checkversions/tags/0.2/CHANGELOG.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/CHANGELOG.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,13 @@
+Changelog
+=========
+
+0.2 (2010-05-22)
+----------------
+
+- added a verbose option to print old versions as well
+- updated metadata, doc and license
+
+0.1 (2010-05-16)
+----------------
+
+- Initial release

Deleted: z3c.checkversions/tags/0.2/HISTORY.txt
===================================================================
--- z3c.checkversions/trunk/HISTORY.txt	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/HISTORY.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,7 +0,0 @@
-Changelog
-=========
-
-0.1dev (unreleased)
--------------------
-
-- Initial release

Copied: z3c.checkversions/tags/0.2/LICENSE.txt (from rev 112380, z3c.checkversions/trunk/LICENSE.txt)
===================================================================
--- z3c.checkversions/tags/0.2/LICENSE.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/LICENSE.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,54 @@
+Zope Public License (ZPL) Version 2.1
+-------------------------------------
+
+A copyright notice accompanies this license document that
+identifies the copyright holders.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the
+   accompanying copyright notice, this list of conditions,
+   and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the accompanying
+   copyright notice, this list of conditions, and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+
+3. Names of the copyright holders must not be used to
+   endorse or promote products derived from this software
+   without prior written permission from the copyright
+   holders.
+
+4. The right to distribute this software or to use it for
+   any purpose does not give you the right to use
+   Servicemarks (sm) or Trademarks (tm) of the copyright
+   holders. Use of them is covered by separate agreement
+   with the copyright holders.
+
+5. If any files are modified, you must cause the modified
+   files to carry prominent notices stating that you changed
+   the files and the date of any change.
+
+Disclaimer
+
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS``
+  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+  NO EVENT SHALL THE COPYRIGHT HOLDERS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.

Deleted: z3c.checkversions/tags/0.2/README.txt
===================================================================
--- z3c.checkversions/trunk/README.txt	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/README.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,81 +0,0 @@
-Introduction
-============
-
-Find newer versions of your installed Python packages, or newer versions of
-packages in a buildout file.
-
-This package provides a console script named ``checkversions``.
-
-Install
-=======
-
-you can install this package either in a virtualenv::
-
-    $ virtualenv sandbox
-    $ sandbox/bin/pip install z3c.checkversions
-    $ sandbox/bin/checkversions --help
-
-or in your system::
-
-    $ sudo pip install z3c.checkversions
-    $ checkversions --help
-
-or in a buildout::
-
-    [buildout]
-    parts = checkversions
-    
-    [checkversions]
-    recipe=zc.recipe.egg
-    eggs=z3c.checkversions
-
-Usage
-=====
-
-For installed packages
-----------------------
-
-Imagine `foobar` 1.0.1 is installed in your system
-
-Check the highest versions available::
-
-    $ checkversions
-    foobar=2.3.5
-
-Check the highest intermediate upgrades available::
-
-    $ checkversions -l 1
-    foobar=1.4.2
-
-Check the highest minor upgrades available::
-
-    $ checkversions -l 2
-    foobar=1.0.5
-
-For a buildout
---------------
-
-The usage is the same, you just have to specify the buildout file to scan.
-The buildout does not need to be built.
-
-Imagine you have a buildout.cfg with::
-
-    [versions]
-    foobar=1.0.0
-
-Check the highest versions available::
-
-    $ checkversions buildout.cfg
-    foobar=2.3.5
-
-Check the highest intermediate upgrades available
-
-    $ checkversions -l 1 buildout.cfg
-    foobar=1.4.2
-
-Check the highest minor upgrades available
-
-    $ checkversions -l 2 buildout.cfg
-    foobar=1.0.5
-
-

Copied: z3c.checkversions/tags/0.2/README.txt (from rev 112432, z3c.checkversions/trunk/README.txt)
===================================================================
--- z3c.checkversions/tags/0.2/README.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/README.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,88 @@
+Introduction
+============
+
+Find newer versions of your installed Python packages, or newer versions of
+packages in a buildout file.
+
+This package provides a console script named ``checkversions``.
+
+Install
+=======
+
+you can install this package either in a virtualenv::
+
+    $ virtualenv sandbox
+    $ sandbox/bin/pip install z3c.checkversions
+    $ sandbox/bin/checkversions --help
+
+or in your system::
+
+    $ sudo pip install z3c.checkversions
+    $ checkversions --help
+
+or in a buildout::
+
+    [buildout]
+    parts = checkversions
+    
+    [checkversions]
+    recipe=zc.recipe.egg
+    eggs=z3c.checkversions
+
+
+Usage
+=====
+
+::
+
+    $ checkversions -h
+    Usage: checkversions [options]
+    
+    This script will check new package versions of either your current installed
+    distributions or a buildout file if provided. It can detect major or minor
+    versions availability: level 0 gets the highest version (X.y.z), level 1 gets
+    the highest intermediate version (x.Y.z), level 2 gets the highest minor
+    version (x.y.Z).  Using level 2, you can automatically retrieve all bugfix
+    versions of a buildout.
+    
+    Options:
+      -h, --help            show this help message and exit
+      -l LEVEL, --level=LEVEL
+                            Version level to check
+      -i INDEX, --index=INDEX
+                            Alternative package index URL
+      -v, --verbose         Verbose mode (prints old versions too)
+
+
+Examples
+========
+
+For installed packages
+----------------------
+
+Example with a virtualenv::
+
+    $ virtualenv --no-site-packages sandbox
+    $ sandbox/bin/pip install z3c.checkversions
+    $ sandbox/bin/checkversions -v -l 1
+    # Checking your installed distributions
+    pip=0.7.1 # was: 0.6.3
+
+For a buildout
+--------------
+
+It can work either with a full buildout.cfg or with a simple versions.cfg file.
+
+Here is a sample `versions.cfg` file::
+
+    [versions]
+    pip=0.6.3
+
+You can create a new versions.cfg with the output ::
+
+    $ checkversions -v -l 1 versions.cfg
+    # Checking your installed distributions
+    pip=0.7.1 # was: 0.6.3
+
+
+

Copied: z3c.checkversions/tags/0.2/TODO.txt (from rev 112643, z3c.checkversions/trunk/TODO.txt)
===================================================================
--- z3c.checkversions/tags/0.2/TODO.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/TODO.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,6 @@
+todo list
+=========
+
+- make several network connection at once for faster detection
+- handle network timeouts (abort at the end ?)
+- use the egg name instead of the package name? (to avoid setuptools=0.6.12)

Deleted: z3c.checkversions/tags/0.2/setup.py
===================================================================
--- z3c.checkversions/trunk/setup.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/setup.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,47 +0,0 @@
-from setuptools import setup, find_packages
-import os
-
-version = '0.1dev'
-
-setup(name='z3c.checkversions',
-      version=version,
-      description="Checks package versions",
-      long_description=open("README.txt").read() + "\n" +
-                       open("HISTORY.txt").read(),
-      # Get more strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
-      classifiers=[
-       "Programming Language :: Python",
-       'Development Status :: 3 - Alpha',
-       'Environment :: Console',
-       'Intended Audience :: Developers',
-       'License :: OSI Approved :: Zope Public License',
-       'Programming Language :: Python',
-       'Natural Language :: English',
-       'Operating System :: OS Independent',
-       'Topic :: Software Development :: Quality Assurance',
-       'Framework :: Zope2',
-       'Framework :: Zope3',
-       'Framework :: Buildout',
-        ],
-      keywords='version, buildout, packages, upgrade, zope, ztk',
-      author='Christophe Combelles and the Zope Community',
-      author_email='zope-dev at zope.org',
-      url='http://pypi.python.org/pypi/z3c.checkversions',
-      license='ZPL 2.1',
-      packages=find_packages(exclude=['ez_setup']),
-      namespace_packages=['z3c'],
-      include_package_data=True,
-      zip_safe=False,
-      install_requires=[
-          'setuptools',
-          # -*- Extra requirements: -*-
-      ],
-      extras_require={'buildout': ['zc.buildout']},
-      tests_require=['zc.buildout', 'virtualenv'],
-      test_suite='z3c.checkversions.test.test',
-      entry_points="""
-      # -*- Entry points: -*-
-      [console_scripts]
-      checkversions = z3c.checkversions.main:main
-      """,
-      )

Copied: z3c.checkversions/tags/0.2/setup.py (from rev 112643, z3c.checkversions/trunk/setup.py)
===================================================================
--- z3c.checkversions/tags/0.2/setup.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/setup.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,61 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+
+from setuptools import setup, find_packages
+import os
+
+version = '0.2'
+
+setup(name='z3c.checkversions',
+      version=version,
+      description="Find newer package versions on PyPI",
+      long_description=open("README.txt").read() + "\n" +
+                       open("CHANGELOG.txt").read(),
+      # Get more strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+       "Programming Language :: Python",
+       'Development Status :: 4 - Beta',
+       'Environment :: Console',
+       'Intended Audience :: Developers',
+       'License :: OSI Approved :: Zope Public License',
+       'Programming Language :: Python',
+       'Natural Language :: English',
+       'Operating System :: OS Independent',
+       'Topic :: Software Development :: Quality Assurance',
+       'Framework :: Zope2',
+       'Framework :: Zope3',
+       'Framework :: Buildout',
+        ],
+      keywords='version, buildout, packages, upgrade, zope, ztk',
+      author='Christophe Combelles and the Zope Community',
+      author_email='zope-dev at zope.org',
+      url='http://pypi.python.org/pypi/z3c.checkversions',
+      license='ZPL 2.1',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['z3c'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'setuptools',
+          # -*- Extra requirements: -*-
+      ],
+      extras_require={'buildout': ['zc.buildout']},
+      tests_require=['zc.buildout'],
+      test_suite='z3c.checkversions.test.test',
+      entry_points="""
+      # -*- Entry points: -*-
+      [console_scripts]
+      checkversions = z3c.checkversions.main:main
+      """,
+      )

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/base.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/base.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/base.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,56 +0,0 @@
-from pkg_resources import parse_version, Requirement
-from setuptools import package_index
-
-class Checker(object):
-    """Base class for version checkers
-    """
-    __custom_url = False
-    def __init__(self, filename=None, index_url=None):
-        self.filename = filename
-        self.pi = package_index.PackageIndex()
-        self._set_index_url(index_url)
-        if index_url is not None:
-            self.__custom_url = True
-
-    def _set_index_url(self, url):
-        """set the index URL
-        """
-        if url is not None:
-            self.pi.index_url = url
-        if not self.pi.index_url.endswith('/'):
-            self.pi.index_url += '/'
-
-    def check(self, level=0):
-        """Search new versions in a version list
-        versions must be a dict {'name': 'version'}
-
-        The new version is limited to the given level:
-        Example with version x.y.z
-        level = 0: checks new version x
-        level = 1: checks new version y
-        level = 2: checks new version z
-
-        By default, the highest version is found.
-        """
-        versions = self.get_versions()
-
-        for name, version in versions.items():
-            parsed_version = parse_version(version)
-            req = Requirement.parse(name)
-            self.pi.find_packages(req)
-            new_dist = None
-            # loop all versions until we find the first newer version
-            # that keeps the major versions (below level)
-            for dist in self.pi[req.key]:
-                if dist.parsed_version[:level] > parsed_version[:level]:
-                    continue
-                new_dist = dist
-                break
-
-
-            if new_dist and new_dist.parsed_version > parsed_version:
-                print("%s=%s" % (name, new_dist.version))
-
-
-    def get_versions(self):
-        raise NotImplementedError

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/base.py (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/base.py)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/base.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/base.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,79 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+
+from pkg_resources import parse_version, Requirement
+from setuptools import package_index
+
+class Checker(object):
+    """Base class for version checkers
+    """
+    __custom_url = False
+    def __init__(self, filename=None, index_url=None, verbose=False):
+        self.filename = filename
+        self.verbose = verbose
+        self.pi = package_index.PackageIndex()
+        self._set_index_url(index_url)
+        if index_url is not None:
+            self.__custom_url = True
+
+    def _set_index_url(self, url):
+        """set the index URL
+        """
+        if url is not None:
+            self.pi.index_url = url
+        if not self.pi.index_url.endswith('/'):
+            self.pi.index_url += '/'
+
+    def check(self, level=0):
+        """Search new versions in a version list
+        versions must be a dict {'name': 'version'}
+
+        The new version is limited to the given level:
+        Example with version x.y.z
+        level = 0: checks new version x
+        level = 1: checks new version y
+        level = 2: checks new version z
+
+        By default, the highest version is found.
+        """
+        versions = self.get_versions()
+
+        for name, version in versions.items():
+            parsed_version = parse_version(version)
+            req = Requirement.parse(name)
+            self.pi.find_packages(req)
+            new_dist = None
+            # loop all versions until we find the first newer version
+            # that keeps the major versions (below level)
+            for dist in self.pi[req.key]:
+                if dist.parsed_version[:level] > parsed_version[:level]:
+                    continue
+                new_dist = dist
+                break
+
+            if new_dist and new_dist.parsed_version > parsed_version:
+                if self.verbose:
+                    print("%s=%s # was: %s" % (name, new_dist.version, version))
+                else:
+                    print("%s=%s" % (name, new_dist.version))
+            elif self.verbose:
+                print("%s=%s" % (name, version))
+
+
+    def get_versions(self):
+        """Get a dict {'name': 'version', ...} with package versions to check.
+        This should be implemented by derived classes
+        """
+        raise NotImplementedError
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/buildout.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,19 +0,0 @@
-from zc.buildout.buildout import Buildout
-from z3c.checkversions import base
-
-
-class Checker(base.Checker):
-    """checker class for a buildout
-    """
-    def get_versions(self):
-        buildout = Buildout(self.filename, '')
-
-        # set the index URL from the buildout if not already provided
-        buildout_index = buildout['buildout'].get('index')
-        if not self.__custom_url:
-            self._set_index_url(buildout_index)
-
-        print(u"Checking buildout file %s" % self.filename)
-        return buildout['versions']
-
-

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/buildout.py)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/buildout.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+
+from zc.buildout.buildout import Buildout
+from z3c.checkversions import base
+
+
+class Checker(base.Checker):
+    """checker class for a buildout
+    """
+    def get_versions(self):
+        buildout = Buildout(self.filename, '')
+
+        # set the index URL from the buildout if not already provided
+        buildout_index = buildout['buildout'].get('index')
+        if not self.__custom_url:
+            self._set_index_url(buildout_index)
+
+        print(u"# Checking buildout file %s" % self.filename)
+        return buildout['versions']
+
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/buildout.txt	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,78 +0,0 @@
-Checking versions of a buildout
--------------------------------
-
-For the tests, we use two fake local indices
-
->>> import z3c.checkversions
->>> from os.path import dirname, sep
->>> testindex = 'file://' + dirname(z3c.checkversions.__file__).replace(sep, '/') + '/testindex'
->>> testindex2 = 'file://' + dirname(z3c.checkversions.__file__).replace(sep, '/') + '/testindex2'
->>> print testindex
-file:///.../testindex
-
-We create a buildout with a versions section and a custom index:
-
->>> import os
->>> from tempfile import mkstemp
->>> buildout_fd, buildout_path = mkstemp()
->>> buildout_file = os.fdopen(buildout_fd, 'w')
->>> buildout_file.write("""
-... [buildout]
-... index = %s
-... versions = versions
-... [versions]
-... zope.interface = 3.4.0
-... zope.component = 3.4.0
-... """ % testindex)
->>> buildout_file.close()
-
-We can now check the new highest versions:
-
->>> from z3c.checkversions import buildout
->>> checker = buildout.Checker(filename=buildout_path)
->>> checker.get_versions()
-Checking buildout file ...
-{'zope.interface': '3.4.0', 'zope.component': '3.4.0'}
->>> checker.check()
-Checking buildout file ...
-Reading file:///.../zope.interface/
-zope.interface=3.6.1
-Reading file:///.../zope.component/
-zope.component=3.9.4
-
-We can check only the minor versions:
-
->>> checker.check(level=2)
-Checking buildout file ...
-zope.interface=3.4.1
-
-We can provide a different index url:
-
->>> checker = buildout.Checker(filename=buildout_path, index_url=testindex2)
->>> checker.check()
-Checking buildout file ...
-Reading file:///.../zope.interface/
-zope.interface=3.6.2
-Reading file:///.../zope.component/
-zope.component=3.9.3
-
-console script
---------------
-
-the 'main' module is exposed through a console_script entry point.
-We are using it directly here:
-
->>> import sys
->>> from z3c.checkversions import main
->>> from subprocess import Popen, PIPE
->>> p = Popen([sys.executable, main.__file__, '-h'],
-...           stdout=PIPE, stdin=PIPE, stderr=PIPE)
->>> print p.stdout.read()
-Usage: ... [options]
-...
-
-
-Clean the tmp file:
-
->>> os.remove(buildout_path)
-

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/buildout.txt)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/buildout.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,90 @@
+Checking versions of a buildout
+-------------------------------
+
+For the tests, we use two fake local indices
+
+>>> import z3c.checkversions
+>>> from os.path import dirname, sep
+>>> testindex = 'file://' + dirname(z3c.checkversions.__file__).replace(sep, '/') + '/testindex'
+>>> testindex2 = 'file://' + dirname(z3c.checkversions.__file__).replace(sep, '/') + '/testindex2'
+>>> print testindex
+file:///.../testindex
+
+We create a buildout with a versions section and a custom index:
+
+>>> import os
+>>> from tempfile import mkstemp
+>>> buildout_fd, buildout_path = mkstemp()
+>>> buildout_file = os.fdopen(buildout_fd, 'w')
+>>> buildout_file.write("""
+... [buildout]
+... index = %s
+... versions = versions
+... [versions]
+... zope.interface = 3.4.0
+... zope.component = 3.4.0
+... """ % testindex)
+>>> buildout_file.close()
+
+We can now check the new highest versions:
+
+>>> from z3c.checkversions import buildout
+>>> checker = buildout.Checker(filename=buildout_path)
+>>> checker.get_versions()
+# Checking buildout file ...
+{'zope.interface': '3.4.0', 'zope.component': '3.4.0'}
+>>> checker.check()
+# Checking buildout file ...
+Reading file:///.../zope.interface/
+zope.interface=3.6.1
+Reading file:///.../zope.component/
+zope.component=3.9.4
+
+We can check only the minor versions:
+
+>>> checker.check(level=2)
+# Checking buildout file ...
+zope.interface=3.4.1
+
+We can provide a different index url:
+
+>>> checker = buildout.Checker(filename=buildout_path, index_url=testindex2)
+>>> checker.check()
+# Checking buildout file ...
+Reading file:///.../zope.interface/
+zope.interface=3.6.2
+Reading file:///.../zope.component/
+zope.component=3.9.3
+
+The verbose mode gives the current and previous versions
+
+>>> checker = buildout.Checker(filename=buildout_path, verbose=True)
+>>> checker.check(level=2)
+# Checking buildout file ...
+Reading file:///.../zope.interface/
+zope.interface=3.4.1 # was: 3.4.0
+Reading file:///.../zope.component/
+zope.component=3.4.0
+
+
+
+console script
+--------------
+
+the 'main' module is exposed through a console_script entry point.
+We are using it directly here:
+
+>>> import sys
+>>> from z3c.checkversions import main
+>>> from subprocess import Popen, PIPE
+>>> p = Popen([sys.executable, main.__file__, '-h'],
+...           stdout=PIPE, stdin=PIPE, stderr=PIPE)
+>>> print p.stdout.read()
+Usage: ... [options]
+...
+
+
+Clean the tmp file:
+
+>>> os.remove(buildout_path)
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/installed.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/installed.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/installed.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,13 +0,0 @@
-import pkg_resources
-from z3c.checkversions import base
-
-class Checker(base.Checker):
-    """Checker class for installed packages
-    """
-    def get_versions(self, level=0):
-        working_set = pkg_resources.working_set
-        versions = dict([(d.key, d.version) for d in working_set])
-        print "Checking your installed distributions"
-        return versions
-
-

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/installed.py (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/installed.py)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/installed.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/installed.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,27 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+
+import pkg_resources
+from z3c.checkversions import base
+
+class Checker(base.Checker):
+    """Checker class for installed packages
+    """
+    def get_versions(self, level=0):
+        working_set = pkg_resources.working_set
+        versions = dict([(d.key, d.version) for d in working_set])
+        print "# Checking your installed distributions"
+        return versions
+
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/installed.txt	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,16 +0,0 @@
-Checking installed versions
----------------------------
-
->>> from z3c.checkversions import installed
->>> checker = installed.Checker()
-
-We just check we can get the versions:
-
->>> from pprint import pprint
->>> versions = checker.get_versions()
-Checking your installed distributions
->>> 'z3c.checkversions' in versions
-True
-
-Checking for upgrades availability is already done in buildout.txt
-

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/installed.txt)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/installed.txt	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,16 @@
+Checking installed versions
+---------------------------
+
+>>> from z3c.checkversions import installed
+>>> checker = installed.Checker()
+
+We just check we can get the versions:
+
+>>> from pprint import pprint
+>>> versions = checker.get_versions()
+# Checking your installed distributions
+>>> 'z3c.checkversions' in versions
+True
+
+Checking for upgrades availability is already done in buildout.txt
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/main.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/main.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/main.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,52 +0,0 @@
-"""This script will check new package versions of either
-your current installed distributions or a buildout file if provided.
-It can detect major or minor versions availability:
-level 0 gets the highest version (X.y.z),
-level 1 gets the highest intermediate version (x.Y.z),
-level 2 gets the highest minor version (x.y.Z).
-
-Using level 2, you can automatically retrieve all bugfix versions of a buildout.
-"""
-
-from optparse import OptionParser
-
-def main():
-
-    parser = OptionParser(description=__doc__)
-
-    parser.add_option('-l', '--level',
-                      type='int',
-                      dest='level',
-                      default=0,
-                      help=u"Version level to check")
-
-    parser.add_option('-i', '--index',
-                      dest='index',
-                      help=u"Alternative package index URL")
-
-    options, args = parser.parse_args()
-
-    if len(args) > 1:
-        parser.error("You must specify only one argument")
-
-    buildoutcfg = False
-    if len(args) == 1:
-        buildoutcfg = args[0]
-
-    kw = {}
-    if options.index is not None:
-        kw['index_url'] = options.index
-
-    if buildoutcfg:
-        import buildout
-        checker = buildout.Checker(filename=buildoutcfg, **kw)
-    else:
-        import installed
-        checker = installed.Checker()
-
-    checker.check(level=options.level)
-
-
-if __name__ == '__main__':
-    main()
-

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/main.py (from rev 112431, z3c.checkversions/trunk/z3c/checkversions/main.py)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/main.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/main.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,72 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+"""This script will check new package versions of either
+your current installed distributions or a buildout file if provided.
+It can detect major or minor versions availability:
+level 0 gets the highest version (X.y.z),
+level 1 gets the highest intermediate version (x.Y.z),
+level 2 gets the highest minor version (x.y.Z).
+
+Using level 2, you can automatically retrieve all bugfix versions of a buildout.
+"""
+
+from optparse import OptionParser
+
+def main():
+
+    parser = OptionParser(description=__doc__)
+
+    parser.add_option('-l', '--level',
+                      type='int',
+                      dest='level',
+                      default=0,
+                      help=u"Version level to check")
+
+    parser.add_option('-i', '--index',
+                      dest='index',
+                      help=u"Alternative package index URL")
+
+    parser.add_option('-v', '--verbose',
+                      dest='verbose',
+                      action='store_true',
+                      default=False,
+                      help=u"Verbose mode (prints old versions too)")
+    options, args = parser.parse_args()
+
+    if len(args) > 1:
+        parser.error("You must specify only one argument")
+
+    buildoutcfg = False
+    if len(args) == 1:
+        buildoutcfg = args[0]
+
+    kw = {}
+    if options.index is not None:
+        kw['index_url'] = options.index
+
+    if buildoutcfg:
+        import buildout
+        checker = buildout.Checker(filename=buildoutcfg,
+                                   verbose=options.verbose,
+                                   **kw)
+    else:
+        import installed
+        checker = installed.Checker(verbose=options.verbose)
+
+    checker.check(level=options.level)
+
+
+if __name__ == '__main__':
+    main()
+

Deleted: z3c.checkversions/tags/0.2/z3c/checkversions/test.py
===================================================================
--- z3c.checkversions/trunk/z3c/checkversions/test.py	2010-05-16 14:48:51 UTC (rev 112348)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/test.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -1,11 +0,0 @@
-from doctest import DocFileSuite, ELLIPSIS, NORMALIZE_WHITESPACE
-import unittest
-
-def test():
-    optionflags = ELLIPSIS|NORMALIZE_WHITESPACE
-    suite = unittest.TestSuite()
-    suite.addTest(DocFileSuite('README.txt', optionflags=optionflags))
-    suite.addTest(DocFileSuite('buildout.txt', optionflags=optionflags))
-    suite.addTest(DocFileSuite('installed.txt', optionflags=optionflags))
-
-    return suite

Copied: z3c.checkversions/tags/0.2/z3c/checkversions/test.py (from rev 112380, z3c.checkversions/trunk/z3c/checkversions/test.py)
===================================================================
--- z3c.checkversions/tags/0.2/z3c/checkversions/test.py	                        (rev 0)
+++ z3c.checkversions/tags/0.2/z3c/checkversions/test.py	2010-05-21 22:33:44 UTC (rev 112644)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##############################################################################
+
+from doctest import DocFileSuite, ELLIPSIS, NORMALIZE_WHITESPACE
+import unittest
+
+def test():
+    optionflags = ELLIPSIS|NORMALIZE_WHITESPACE
+    suite = unittest.TestSuite()
+    suite.addTest(DocFileSuite('README.txt', optionflags=optionflags))
+    suite.addTest(DocFileSuite('buildout.txt', optionflags=optionflags))
+    suite.addTest(DocFileSuite('installed.txt', optionflags=optionflags))
+
+    return suite



More information about the checkins mailing list