[Patches] [ python-Patches-504889 ] make setup.py less chatty by default

noreply@sourceforge.net noreply@sourceforge.net
Fri, 18 Jan 2002 06:53:44 -0800


Patches item #504889, was opened at 2002-01-17 07:02
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=504889&group_id=5470

Category: Distutils and setup.py
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeremy Hylton (jhylton)
Assigned to: Nobody/Anonymous (nobody)
Summary: make setup.py less chatty by default

Initial Comment:
I don't like the amount of output that setup.py
produces by default, and I don't like the way that -q
and -v affect the amount of output.  In general, I want
setup.py to tell me what it is doing and not what it is
skippping.  It's fine to say nothing with -q, but it
shouldn't say more without -v.

The attached patch is a bit of a kludge, but I'm not
familiar enough with distutils to do any better.  One
problem is that -v/--verbose has previously handled as
a flag, either on or off.  (There is a curiously large
amount of code that compares this boolean to see if
it's greater than some number!)  I had the options
processor to treat self.verbose as a count of -v
options.  So -vv is more verbose than -v.

Then I change the specific prints and announcements
that I've seen with setup.py that I didn't want to see.
 The messages I don't want to see (unless verbose is
high) are about skipping builds of Extensions and not
copying files that are already up-to-date.

With this patch in place, setup.py tells me only the
extensions is actually builds and files it actually copies.


----------------------------------------------------------------------

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-01-18 06:53

Message:
Logged In: YES 
user_id=31392

Good suggestion.  I hadn't planned to change anything, but
wanted to capture the feature request and share the code.


----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-01-18 01:05

Message:
Logged In: YES 
user_id=38388

Jeremy, if that's what you want you should at least post
to the distutils list before going ahead and change things.

E.g. I can't see why "skip" notices are any less important
than "building..." notices: they tell you that distutils has
found some components up-to-date and that may sometimes
not be what you'd really expect.

We should first discuss, what distutils developers want as
default and then go ahead and fixup distutils to meet those
demands.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-01-17 10:25

Message:
Logged In: YES 
user_id=31392

MAL, I really want to change distutils not Python's
setup.py.  I use distutils for all sorts of projects and the
default chattiness is always a nuisance.  When I'm doing
development, I invariable have to wade through hundreds of
lines of useless output to find the one or two lines that
confirm a change was made.

You could still get the skip notices for your stuff, you'd
just have to run in extra verbose mode.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-01-17 10:17

Message:
Logged In: YES 
user_id=31392

If I had to guess, I'd say cleaning up and rationalizing the
use of self.verbose and print vs self.announce() vs the
other methods that print things would teach you a lot about
the internals.

Hey, and reformat the code while you're at it <wink>.


----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-01-17 10:17

Message:
Logged In: YES 
user_id=38388

Jeremy, the patch touches the distutils code, but what you really 
want is to change the behaviour in one single use-case (the setup.py
which Python uses).

The "right" way to fix this would be to subclass the various distutils
classes to implement the change. If this becomes too complicated,
then distutils ought to be tweaked to make this easier in way that
doesn't break existing code (e.g. I don't want to miss the skip
notices for my stuff).

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-01-17 09:25

Message:
Logged In: YES 
user_id=6656

You're not wrong :|

The "assert 0" is on the install path though.

Right.  I'm currently fighting emacs to let me print source
duplex, but I want to understand distutils' innards at some
point, might as well be now.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-01-17 08:50

Message:
Logged In: YES 
user_id=31392



The distutils package is a maze of twisty little passages
that all look the same <wink>.  I added an assert 0 to make
sure that the execution path that generated the output
wasn't the one with the assert 0.  (It wasn't.)  Didn't
intend for the patch to make it in.

But I'd still be surprised if this patch is the right thing.
 More likely that it demonstrates good behavior that could
be implemented more cleanly.

----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-01-17 08:45

Message:
Logged In: YES 
user_id=6656

Hokay, next question: why the "assert 0" in cmd.py?  Are you
sure you've finished?

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2002-01-17 08:32

Message:
Logged In: YES 
user_id=31392

Er, context diff.


----------------------------------------------------------------------

Comment By: Michael Hudson (mwh)
Date: 2002-01-17 07:49

Message:
Logged In: YES 
user_id=6656

Um, context diff?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=504889&group_id=5470