]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Improve zetuptoolz' logging of what it is doing.
authorDaira Hopwood <daira@jacaranda.org>
Thu, 2 Oct 2014 00:33:49 +0000 (01:33 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Thu, 2 Oct 2014 00:33:49 +0000 (01:33 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
setuptools-0.6c16dev4.egg/pkg_resources.py
setuptools-0.6c16dev4.egg/zetuptoolz.txt

index 3dbdec14dc385ba35cd3ce41214b2850e19c989f..36ec57adac23402cbd995693ff65dfeea283dbfd 100644 (file)
@@ -25,6 +25,8 @@ from os import utime, rename, unlink, mkdir
 from os import open as os_open
 from os.path import isdir, split
 
+from distutils import log
+
 def _bypass_ensure_directory(name, mode=0777):
     # Sandbox-bypassing version of ensure_directory()
     dirname, filename = split(name)
@@ -565,7 +567,9 @@ class WorkingSet(object):
             req = requirements.pop(0)   # process dependencies breadth-first
             if req in processed:
                 # Ignore cyclic or redundant dependencies
+                log.info("\nAlready processed %s", req)
                 continue
+            log.info("\nNeed %s", req)
             dist = best.get(req.key)
             if dist is None:
                 # Find the best distribution and add it to the map
@@ -576,11 +580,19 @@ class WorkingSet(object):
                     dist = best[req.key] = env.best_match(req, self, installer)
                     if dist is None:
                         raise DistributionNotFound(req)  # XXX put more info here
+                log.info("  found %r", dist)
                 to_activate.append(dist)
             if dist not in req:
                 # Oops, the "best" so far conflicts with a dependency
                 raise VersionConflict(dist,req) # XXX put more info here
-            requirements.extend(dist.requires(req.extras)[::-1])
+            to_add = dist.requires(req.extras)[::-1]
+            if len(to_add) == 0:
+                log.info("  no subdependencies to add")
+            elif len(to_add) == 1:
+                log.info("  adding subdependency %s", "; ".join(map(str, to_add)))
+            else:
+                log.info("  adding subdependencies %s", "; ".join(map(str, to_add)))
+            requirements.extend(to_add)
             processed[req] = True
 
         return to_activate    # return list of distros to activate
index b4729c7f3554691e14ffb0efa7935f7260124f17..469e262cc0b4c4fe7237019f986a86f4111d0d47 100644 (file)
@@ -1,8 +1,11 @@
 This is the "zetuptoolz" fork of setuptools. This version is forked from
-setuptools trunk r80621 (which is current as of 2010-08-31), with the following
+setuptools trunk r80621 (which was current at 2010-08-31), with the following
 differences:
 
 
+ * Logging outputs more information about which dependencies are being processed.
+
+
  * Zooko's and David-Sarah's patches for the following bugs and features have been applied:
  
      <http://bugs.python.org/setuptools/issue17>