[Patches] [ python-Patches-1673619 ] Identify modules which couldn't be built

SourceForge.net noreply at sourceforge.net
Tue Mar 6 16:42:45 CET 2007


Patches item #1673619, was opened at 2007-03-04 15:31
Message generated for change (Comment added) made by montanaro
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1673619&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Distutils and setup.py
Group: Python 2.6
>Status: Closed
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Skip Montanaro (montanaro)
Assigned to: Skip Montanaro (montanaro)
Summary: Identify modules which couldn't be built

Initial Comment:
A user has been moaning on c.l.py that Python's setup.py doesn't bail out when the necessary bits can't be found to build a particular extension module (curses in this case).  For reasons that should be obvious to this crowd you simply can't have it stop if a particular module can't be built.

This patch is a compromise.  It enumerates the modules for which the necessary build mojo exists and those modules for which it doesn't.  I'm personally a bit ambivalent about it, both the need for it and my particular implementation.  An alternate implementation might create a set of all module names at the start of the run then subtract the modules which could be built from that.  This implementation has the slight advantage that all the fiddling for a particular module occurs near the tests for that module.

Skip


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

>Comment By: Skip Montanaro (montanaro)
Date: 2007-03-06 09:42

Message:
Logged In: YES 
user_id=44345
Originator: YES

Checked in as r54166.  I applied the sort() change but not the
max() change.  Note that self.extensions is a list of Extension instances
while self.failed is a list of strings.


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

Comment By: Martin v. Löwis (loewis)
Date: 2007-03-06 04:15

Message:
Logged In: YES 
user_id=21627
Originator: NO

Some nits: 
- the max computation can be simplified as
  longest = max(len(e.name) for e in self.extensions+self.failed)

- The sort can be simplified as
  lst.sort(key=str.lower)

There is a change to xmlrpclib in this patch that probably isn't meant to
be part of it.

Otherwise, it looks fine, please apply.


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

Comment By: Skip Montanaro (montanaro)
Date: 2007-03-05 08:25

Message:
Logged In: YES 
user_id=44345
Originator: YES

Tweak summary.

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

Comment By: Skip Montanaro (montanaro)
Date: 2007-03-05 08:24

Message:
Logged In: YES 
user_id=44345
Originator: YES

Martin,

Thanks for the feedback.  Attached is an updated diff.  It defers the
report until build_ext is finished and reports only on what couldn't
be built, either because the environment was missing something or
because the compile/link phase failed.  These two different problems
are reported in different paragraphs, e.g.:

    Failed to find the necessary bits to build these modules:
    _md5              _sha              _sha256
    _sha512           gdbm              linuxaudiodev
    ossaudiodev       spwd              sunaudiodev


    Failed to build these modules:
    _elementtree



File Added: missing.diff

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

Comment By: Martin v. Löwis (loewis)
Date: 2007-03-05 03:18

Message:
Logged In: YES 
user_id=21627
Originator: NO

I don't think the modules that it builds successfully need to be printed -
the build messages will tell, anyway.

I'm not sure when it prints these things. IMO, they should be printed at
the end of the build (i.e. after all modules have been built). It should
also print out, in summary, modules that had been attempted to build, but
where building failed for some reason.

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

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


More information about the Patches mailing list