[Checkins] SVN: zope.location/trunk/ Add Python 3.2 support.

Tres Seaver cvs-admin at zope.org
Thu Jun 7 15:04:26 UTC 2012


Log message for revision 126660:
  Add Python 3.2 support.

Changed:
  U   zope.location/trunk/CHANGES.txt
  U   zope.location/trunk/setup.py
  U   zope.location/trunk/src/zope/location/tests/test_pickling.py
  U   zope.location/trunk/src/zope/location/traversing.py
  U   zope.location/trunk/tox.ini

-=-
Modified: zope.location/trunk/CHANGES.txt
===================================================================
--- zope.location/trunk/CHANGES.txt	2012-06-07 15:04:17 UTC (rev 126659)
+++ zope.location/trunk/CHANGES.txt	2012-06-07 15:04:22 UTC (rev 126660)
@@ -5,6 +5,8 @@
 4.0.0 (unreleased)
 ------------------
 
+- Added Python 3.2 support.
+
 - Made ``zope.component`` dependency optional.  Use the ``component`` extra
   to force its installation (or just require it directly).  If
   ``zope.component`` is not present, this package defines the ``ISite``

Modified: zope.location/trunk/setup.py
===================================================================
--- zope.location/trunk/setup.py	2012-06-07 15:04:17 UTC (rev 126659)
+++ zope.location/trunk/setup.py	2012-06-07 15:04:22 UTC (rev 126660)
@@ -46,6 +46,8 @@
           'Programming Language :: Python :: 2',
           'Programming Language :: Python :: 2.6',
           'Programming Language :: Python :: 2.7',
+          'Programming Language :: Python :: 3',
+          'Programming Language :: Python :: 3.2',
           'Programming Language :: Python :: Implementation :: CPython',
           'Programming Language :: Python :: Implementation :: PyPy',
           'Natural Language :: English',

Modified: zope.location/trunk/src/zope/location/tests/test_pickling.py
===================================================================
--- zope.location/trunk/src/zope/location/tests/test_pickling.py	2012-06-07 15:04:17 UTC (rev 126659)
+++ zope.location/trunk/src/zope/location/tests/test_pickling.py	2012-06-07 15:04:22 UTC (rev 126660)
@@ -13,49 +13,54 @@
 ##############################################################################
 import unittest
 
+try:
+    import zope.copy
+except ImportError:
+    def test_suite():
+        return unittest.TestSuite()
+else:
+    class LocationCopyHookTests(unittest.TestCase):
 
-class LocationCopyHookTests(unittest.TestCase):
+        def _getTargetClass(self):
+            from zope.location.pickling import LocationCopyHook
+            return LocationCopyHook
 
-    def _getTargetClass(self):
-        from zope.location.pickling import LocationCopyHook
-        return LocationCopyHook
+        def _makeOne(self, obj=None):
+            if obj is None:
+                obj = object()
+            return self._getTargetClass()(obj)
 
-    def _makeOne(self, obj=None):
-        if obj is None:
-            obj = object()
-        return self._getTargetClass()(obj)
+        def test_class_conforms_to_ICopyHook(self):
+            from zope.interface.verify import verifyClass
+            from zope.copy.interfaces import ICopyHook
+            verifyClass(ICopyHook, self._getTargetClass())
 
-    def test_class_conforms_to_ICopyHook(self):
-        from zope.interface.verify import verifyClass
-        from zope.copy.interfaces import ICopyHook
-        verifyClass(ICopyHook, self._getTargetClass())
+        def test_instance_conforms_to_ICopyHook(self):
+            from zope.interface.verify import verifyObject
+            from zope.copy.interfaces import ICopyHook
+            verifyObject(ICopyHook, self._makeOne())
 
-    def test_instance_conforms_to_ICopyHook(self):
-        from zope.interface.verify import verifyObject
-        from zope.copy.interfaces import ICopyHook
-        verifyObject(ICopyHook, self._makeOne())
+        def test___call___w_context_inside_toplevel(self):
+            from zope.copy.interfaces import ResumeCopy
+            class Dummy(object):
+                __parent__ = __name__ = None
+            top_level = Dummy()
+            context = Dummy()
+            context.__parent__ = top_level
+            hook = self._makeOne(context)
+            self.assertRaises(ResumeCopy, hook, top_level, object())
 
-    def test___call___w_context_inside_toplevel(self):
-        from zope.copy.interfaces import ResumeCopy
-        class Dummy(object):
-            __parent__ = __name__ = None
-        top_level = Dummy()
-        context = Dummy()
-        context.__parent__ = top_level
-        hook = self._makeOne(context)
-        self.assertRaises(ResumeCopy, hook, top_level, object())
+        def test___call___w_context_outside_toplevel(self):
+            class Dummy(object):
+                __parent__ = __name__ = None
+            top_level = Dummy()
+            context = Dummy()
+            hook = self._makeOne(context)
+            self.assertTrue(hook(top_level, object()) is context)
 
-    def test___call___w_context_outside_toplevel(self):
-        class Dummy(object):
-            __parent__ = __name__ = None
-        top_level = Dummy()
-        context = Dummy()
-        hook = self._makeOne(context)
-        self.assertTrue(hook(top_level, object()) is context)
 
 
-
-def test_suite():
-    return unittest.TestSuite((
-        unittest.makeSuite(LocationCopyHookTests),
-    ))
+    def test_suite():
+        return unittest.TestSuite((
+            unittest.makeSuite(LocationCopyHookTests),
+        ))

Modified: zope.location/trunk/src/zope/location/traversing.py
===================================================================
--- zope.location/trunk/src/zope/location/traversing.py	2012-06-07 15:04:17 UTC (rev 126659)
+++ zope.location/trunk/src/zope/location/traversing.py	2012-06-07 15:04:22 UTC (rev 126660)
@@ -20,6 +20,7 @@
 from zope.location.interfaces import ILocationInfo
 from zope.location.interfaces import IRoot
 from zope.location.interfaces import ISite # zope.component, if present
+from zope.location._compat import u
 
 
 @implementer(ILocationInfo)
@@ -56,9 +57,9 @@
                 if path:
                     path.append('')
                     path.reverse()
-                    return u'/'.join(path)
+                    return u('/'.join(path))
                 else:
-                    return u'/'
+                    return u('/')
             path.append(context.__name__)
             context = context.__parent__
             max -= 1
@@ -130,7 +131,7 @@
     def getPath(self):
         """See ILocationInfo
         """
-        return u'/'
+        return u('/')
 
     def getParent(self):
         """See ILocationInfo.
@@ -145,7 +146,7 @@
     def getName(self):
         """See ILocationInfo
         """
-        return u''
+        return u('')
 
     def getNearestSite(self):
         """See ILocationInfo

Modified: zope.location/trunk/tox.ini
===================================================================
--- zope.location/trunk/tox.ini	2012-06-07 15:04:17 UTC (rev 126659)
+++ zope.location/trunk/tox.ini	2012-06-07 15:04:22 UTC (rev 126660)
@@ -11,22 +11,32 @@
 commands = 
     python setup.py test -q
 deps =
-    zope.configuration
+    zope.configuration>=4.0
     zope.copy
-    zope.interface
-    zope.proxy>3.3
-    zope.schema>=3.6
+    zope.interface>=4.0
+    zope.proxy>=4.0
+    zope.schema>=4.0
 
 [testenv:jython]
 commands = 
    jython setup.py test -q
 deps =
-    zope.configuration
+    zope.configuration>=4.0
     zope.copy
-    zope.interface
-    zope.proxy>3.3
-    zope.schema>=3.6
+    zope.interface>=4.0
+    zope.proxy>=4.0
+    zope.schema>=4.0
 
+[testenv:py32]
+commands = 
+    python setup.py test -q
+deps =
+    zope.configuration>=4.0
+#   zope.copy>=4.0          not yet ported
+    zope.interface>=4.0
+    zope.proxy>=4.0
+    zope.schema>=4.0
+
 [testenv:coverage]
 basepython =
     python2.6
@@ -38,12 +48,12 @@
     pip install -e .
     nosetests --with-xunit --with-xcoverage
 deps =
+    zope.configuration>=4.0
+    zope.copy
+    zope.interface>=4.0
+    zope.proxy>=4.0
+    zope.schema>=4.0
     zope.component>=3.8
-    zope.configuration
-    zope.copy
-    zope.interface
-    zope.proxy>3.3
-    zope.schema>=3.6
     nose
     coverage
     nosexcover



More information about the checkins mailing list