[Checkins] SVN: z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/ update deps

Nikolay Kim fafhrd91 at gmail.com
Fri Jan 15 09:14:40 EST 2010


Log message for revision 108147:
  update deps

Changed:
  U   z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py
  U   z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/include.py

-=-
Modified: z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py
===================================================================
--- z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py	2010-01-15 14:14:00 UTC (rev 108146)
+++ z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/dependency.py	2010-01-15 14:14:39 UTC (rev 108147)
@@ -1,6 +1,8 @@
 import os, sys, pkg_resources
 
+deps = {1: {}, 2: {}}
 
+
 class DependencyFinder(object):
 
     def __init__(self, dist, ws):
@@ -20,6 +22,7 @@
         result = []
         for ns_path in ns_paths:
             path = os.path.join(dist_path, ns_path)
+
             subpackages = subpackageDottedNames(path, ns_path)
             for subpackage in subpackages:
                 if subpackage not in ns_paths:
@@ -38,6 +41,16 @@
         for req in self.context.requires():
             pkg = req.project_name
 
+            if pkg.startswith('zope.app.') or pkg in ('zope.formlib', 'z3ext.resource'):
+                global deps
+                d = deps[1].setdefault(self.context.project_name, [])
+                if pkg not in d:
+                    d.append(pkg)
+
+                d = deps[2].setdefault(pkg, [])
+                if self.context.project_name not in d:
+                    d.append(self.context.project_name)
+
             if pkg in seen or pkg == 'setuptools':
                 continue
 

Modified: z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/include.py
===================================================================
--- z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/include.py	2010-01-15 14:14:00 UTC (rev 108146)
+++ z3c.recipe.autoinclude/trunk/src/z3c/recipe/autoinclude/include.py	2010-01-15 14:14:39 UTC (rev 108147)
@@ -19,7 +19,7 @@
 import zc.buildout
 import zc.recipe.egg
 import pkg_resources
-from dependency import DependencyFinder
+from dependency import deps, DependencyFinder
 
 
 class AutoIncludeSetup(object):
@@ -73,19 +73,15 @@
             ['<include package="%s" file="exclude.zcml" />\n'%pkg for pkg in exclude])
 
         configureData = ''.join(
-            ['<include package="%s" />\n'%pkg for pkg in configure])
+            ['<include package="%s" />\n'%
+             pkg for pkg in configure if pkg != 'Chameleon'])
 
-        # fix zope.app.xxx dependencies problem
-        if 'zope.app.appsetup' in configure:
+        # fix zope.traversing.browser dependencies problem
+        if 'zope.traversing' in configure:
             configureData = (
-                '<include package="zope.app.appsetup" />\n' +
-                configureData)
+                configureData +
+                '<include package="zope.traversing.browser" />\n')
 
-        if 'zope.app.zcmlfiles' in configure:
-            configureData = (
-                '<include package="zope.app.zcmlfiles" file="menus.zcml" />\n' +
-                configureData)
-
         dest = []
 
         location = self.location
@@ -106,6 +102,12 @@
         open(os.path.join(location, 'packages-exclude.zcml'), 'w').write(
             packages_zcml_template % exclude)
 
+        for key, val in deps[2].items():
+            print key
+            val.sort()
+            print val
+            print '==============================='
+
         return dest
 
     update = install



More information about the checkins mailing list