[Checkins] SVN: zope.site/trunk/ Dropped the dependency on zope.traversing which was only used to access

Thomas Lotze tl at gocept.com
Tue Sep 29 10:38:24 EDT 2009


Log message for revision 104609:
  Dropped the dependency on zope.traversing which was only used to access
  zope.location functionality. Configure zope.location for some tests.
  Demoted zope.configuration to a testing dependency.
  

Changed:
  U   zope.site/trunk/CHANGES.txt
  U   zope.site/trunk/setup.py
  U   zope.site/trunk/src/zope/site/site.py
  U   zope.site/trunk/src/zope/site/site.txt
  U   zope.site/trunk/src/zope/site/tests/test_site.py

-=-
Modified: zope.site/trunk/CHANGES.txt
===================================================================
--- zope.site/trunk/CHANGES.txt	2009-09-29 14:36:16 UTC (rev 104608)
+++ zope.site/trunk/CHANGES.txt	2009-09-29 14:38:23 UTC (rev 104609)
@@ -2,13 +2,17 @@
 CHANGES
 =======
 
-3.6.5 (unreleased)
+3.7.0 (unreleased)
 ------------------
 
 - Cleaned up the undeclared dependency on zope.app.publication by moving the
   two relevant subscriber registrations and their tests to that package.
 
+- Dropped the dependency on zope.traversing which was only used to access
+  zope.location functionality. Configure zope.location for some tests.
 
+- Demoted zope.configuration to a testing dependency.
+
 3.6.4 (2009-09-01)
 ------------------
 

Modified: zope.site/trunk/setup.py
===================================================================
--- zope.site/trunk/setup.py	2009-09-29 14:36:16 UTC (rev 104608)
+++ zope.site/trunk/setup.py	2009-09-29 14:38:23 UTC (rev 104609)
@@ -27,7 +27,7 @@
     return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
 
 setup(name='zope.site',
-      version = '3.6.5dev',
+      version = '3.7.0dev',
       author='Zope Corporation and Contributors',
       author_email='zope-dev at zope.org',
       description='Local registries for zope component architecture',
@@ -57,6 +57,7 @@
       namespace_packages=['zope'],
       extras_require=dict(
           test=['zope.app.testing',
+                'zope.configuration',
                 'zope.copypastemove']),
       install_requires=[
           'setuptools',
@@ -64,12 +65,10 @@
           'zope.container',
           'zope.security',
           'zope.component>=3.6.0',
-          'zope.configuration',
           'zope.event',
           'zope.interface',
           'zope.lifecycleevent',
-          'zope.location>3.4.0b1',
-          'zope.traversing',
+          'zope.location>=3.7.0dev',
           ],
       include_package_data = True,
       zip_safe = False,

Modified: zope.site/trunk/src/zope/site/site.py
===================================================================
--- zope.site/trunk/src/zope/site/site.py	2009-09-29 14:36:16 UTC (rev 104608)
+++ zope.site/trunk/src/zope/site/site.py	2009-09-29 14:38:23 UTC (rev 104609)
@@ -30,7 +30,6 @@
 import zope.component
 import zope.component.persistentregistry
 import zope.component.interfaces
-import zope.traversing.api
 import zope.location
 import zope.location.interfaces
 
@@ -96,7 +95,7 @@
             return None
 
         try:
-            site = zope.traversing.api.getParent(site)
+            site = zope.location.interfaces.ILocationInfo(site).getParent()
         except TypeError:
             # there was not enough context; probably run from a test
             return None

Modified: zope.site/trunk/src/zope/site/site.txt
===================================================================
--- zope.site/trunk/src/zope/site/site.txt	2009-09-29 14:36:16 UTC (rev 104608)
+++ zope.site/trunk/src/zope/site/site.txt	2009-09-29 14:38:23 UTC (rev 104609)
@@ -220,6 +220,17 @@
 really become interesting, once we have multiple sites. We can override other
 local configuration.
 
+This behaviour uses the notion of location, therefore we need to configure the
+zope.location package first:
+
+  >>> import zope.configuration.xmlconfig
+  >>> _  = zope.configuration.xmlconfig.string("""
+  ... <configure xmlns="http://namespaces.zope.org/zope">
+  ...   <include package="zope.component" file="meta.zcml"/>
+  ...   <include package="zope.location" />
+  ... </configure>
+  ... """)
+
 Let's now create a new folder called `folder11`, add it to `myfolder` and make
 it a site:
 

Modified: zope.site/trunk/src/zope/site/tests/test_site.py
===================================================================
--- zope.site/trunk/src/zope/site/tests/test_site.py	2009-09-29 14:36:16 UTC (rev 104608)
+++ zope.site/trunk/src/zope/site/tests/test_site.py	2009-09-29 14:38:23 UTC (rev 104609)
@@ -118,11 +118,24 @@
 def tearDown(test):
     testing.siteTearDown()
 
+
+class Layer(object):
+
+    @staticmethod
+    def setUp():
+        pass
+
+
 def test_suite():
+    site_suite = doctest.DocFileSuite('../site.txt',
+                                       setUp=setUp, tearDown=tearDown)
+    # XXX Isolate the site.txt tests within their own layer as they do some
+    # component registration.
+    site_suite.layer = Layer
+
     return unittest.TestSuite((
         doctest.DocTestSuite(),
         unittest.makeSuite(SiteManagerContainerTest),
-        doctest.DocFileSuite('../site.txt',
-                             setUp=setUp, tearDown=tearDown),
+        site_suite,
         ))
     



More information about the checkins mailing list