[Distutils] making setup less chatty by default

Jeremy Hylton jeremy@zope.com
Fri Jan 18 10:15:00 2002

I would like to see the setup() command and distutils in general by
less chatty by default.  I've contributed a very rough patch that
enables this for the one place where it bothers me the most:


In discussion on that patch, which, incidentally, isn't something I
planned to checkin myself, Marc-Andre disagrees with the suggestion
that this be the default.

Even if it isn't the default, I'd like to see enough flexibility to
have different levels of verbosity.  The current code supports two
extremes, quiet and verbose, but I don't find either of these very
useful.  I agree that each has their place and I don't think anything
should be changed to prevent them as options, but I'd like to see more

The chattiness that I don't find helpful is all the messages about
things being skipped or not copied because they're up-to-date.  I
don't find this helpful because my typical usage is to make a change
to one or two files, re-build, and run some tests.  When I build, I'd
like to see confirmation that my changes were built.  I don't care to
see hundreds of lines of output about things I didn't change.

Here's one anecdote that describes the kinds of uses I have in mind.
I work on a StandaloneZODB package; when I make no changes and run
setup.py build, it produces 158 lines of output.  That's too much to
fit on my screen, and scrolling back even line looks the same :-).
When I make changes, it's important to see what gets updated.  The
various C extensions have a bunch of internal dependencies, e.g. a .c
file on a .h file.  Distutils doesn't track these dependencies, so I
sometimes need to manually delete .o and .so files when the right
targets don't get rebuilt.  In this case, I don't want to wade through
lots of output to make sure the right things got built.

In the patch discussion, I also note that the code seems internally
confused about what verbose means.  It guarantees that verbose (the
attribute) is a boolean value, either 0 or 1, but it compares verbose
to the variable level using > and >=.  I think that should be cleaned
up regardless, as it makes the code confusing.

Along similar lines, distutils appears to have some helper methods
like announce() that are used for output.  But lots of code just uses
print.  So responsibility for checking the verbose flag is spread
throughout the code base.  I think announce() and the like is probably
a good idea, but can't tell if there is a good reason that it isn't
used systematically.

What's the next step?  I have a rough patch of a feature I'd like to
see.  We need to reach some decision about whether the feature is
good, then what the right default is.