Improve zetuptoolz' logging of what it is doing.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2014-10-02 01:33:49 +01:00
parent d29e956a0f
commit f69c9f2a0e
2 changed files with 17 additions and 2 deletions

View File

@ -25,6 +25,8 @@ from os import utime, rename, unlink, mkdir
from os import open as os_open from os import open as os_open
from os.path import isdir, split from os.path import isdir, split
from distutils import log
def _bypass_ensure_directory(name, mode=0777): def _bypass_ensure_directory(name, mode=0777):
# Sandbox-bypassing version of ensure_directory() # Sandbox-bypassing version of ensure_directory()
dirname, filename = split(name) dirname, filename = split(name)
@ -565,7 +567,9 @@ class WorkingSet(object):
req = requirements.pop(0) # process dependencies breadth-first req = requirements.pop(0) # process dependencies breadth-first
if req in processed: if req in processed:
# Ignore cyclic or redundant dependencies # Ignore cyclic or redundant dependencies
log.info("\nAlready processed %s", req)
continue continue
log.info("\nNeed %s", req)
dist = best.get(req.key) dist = best.get(req.key)
if dist is None: if dist is None:
# Find the best distribution and add it to the map # 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) dist = best[req.key] = env.best_match(req, self, installer)
if dist is None: if dist is None:
raise DistributionNotFound(req) # XXX put more info here raise DistributionNotFound(req) # XXX put more info here
log.info(" found %r", dist)
to_activate.append(dist) to_activate.append(dist)
if dist not in req: if dist not in req:
# Oops, the "best" so far conflicts with a dependency # Oops, the "best" so far conflicts with a dependency
raise VersionConflict(dist,req) # XXX put more info here 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 processed[req] = True
return to_activate # return list of distros to activate return to_activate # return list of distros to activate

View File

@ -1,8 +1,11 @@
This is the "zetuptoolz" fork of setuptools. This version is forked from 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: 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: * Zooko's and David-Sarah's patches for the following bugs and features have been applied:
<http://bugs.python.org/setuptools/issue17> <http://bugs.python.org/setuptools/issue17>