[Zope-Checkins] SVN: Zope/trunk/ Added an allpy interpreter that has the same egg set as the alltests script. Changed the checknew script to check all packages found on sys.path, instead of only direct dependencies of Zope2. Otherwise we'll miss out on new releases from the test-only dependencies

Hanno Schlichting hannosch at hannosch.eu
Wed Jul 1 13:24:10 EDT 2009


Log message for revision 101376:
  Added an allpy interpreter that has the same egg set as the alltests script. Changed the checknew script to check all packages found on sys.path, instead of only direct dependencies of Zope2. Otherwise we'll miss out on new releases from the test-only dependencies
  

Changed:
  U   Zope/trunk/alltests.cfg
  U   Zope/trunk/inst/checknew.py

-=-
Modified: Zope/trunk/alltests.cfg
===================================================================
--- Zope/trunk/alltests.cfg	2009-07-01 16:32:55 UTC (rev 101375)
+++ Zope/trunk/alltests.cfg	2009-07-01 17:24:10 UTC (rev 101376)
@@ -3,7 +3,7 @@
 
 [buildout]
 extends = buildout.cfg
-parts += alltests
+parts += alltests allpy
 
 [alltests]
 recipe = zc.recipe.testrunner
@@ -83,3 +83,10 @@
 
 
 defaults = ['--module', '!^(zope[.]app)[.]']
+
+
+[allpy]
+recipe = zc.recipe.egg
+eggs = ${alltests:eggs}
+interpreter = allpy
+scripts = allpy

Modified: Zope/trunk/inst/checknew.py
===================================================================
--- Zope/trunk/inst/checknew.py	2009-07-01 16:32:55 UTC (rev 101375)
+++ Zope/trunk/inst/checknew.py	2009-07-01 17:24:10 UTC (rev 101376)
@@ -10,25 +10,31 @@
     print 'Setting socket time out to %d seconds' % 3
     socket.setdefaulttimeout(3)
 
-    ws = pkg_resources.require('Zope2')
-    pi = PackageIndex()
+    env = pkg_resources.Environment()
+    env.scan()
 
     names = []
     installed = []
-    for dist in ws:
-        name = dist.project_name
-        if name not in names:
-            names.append(name)
-            installed.append(dict(
-                dist=dist,
-                name=name,
-                req=parse_requirements(name).next(),
-                ))
+    for name in env:
+        if name == 'python':
+            continue
+        distributions = env[name]
+        for dist in distributions:
+            name = dist.project_name
+            if name not in names:
+                names.append(name)
+                installed.append(dict(
+                    dist=dist,
+                    name=name,
+                    req=parse_requirements(name).next(),
+                    ))
 
     def _key(value):
         return value['name']
     installed.sort(key=_key)
 
+    pi = PackageIndex()
+
     upgrade = False
     for info in installed:
         print("Checking for new version of %s." % info['name'])
@@ -46,7 +52,8 @@
 
 
 def help():
-    print("Use this script via ./bin/zopepy inst/checknew.py.")
+    print("Use this script via ./bin/allpy inst/checknew.py.")
+    print("You need to use the alltests.cfg config file for buildout.")
 
 
 if __name__ == '__main__':



More information about the Zope-Checkins mailing list