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

noreply@sourceforge.net noreply@sourceforge.net
Thu, 17 Jan 2002 10:17:10 -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: 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