[py-dev] Re: Error with py.test and scipy ...

holger krekel hpk at trillke.net
Fri Apr 8 00:39:02 MEST 2005


On Thu, Apr 07, 2005 at 14:54 -0700, Robert Kern wrote:
> holger krekel wrote:
> 
> >if "import scipy" works then i'd like to find out the real 
> >cause for the problem with py.test interactions here. 
> >py.test is supposed to be non-intrusive ... and having
> >to modify scipy in any way does not sound right. 
> >(we already had such a case with twisted's nevow, btw, 
> >and it was related to *cough*importing*cough*. 
> 
> Scipy uses a lazy importing scheme implemented in scipy_base.ppimport. 

import magic's interfering with each other ... this had to happen 
sooner or later.  And we've had Valentino having problems with 
twisted's nevow already which uses crazy import hacks ... welcome
in scary traceback land.  This strongly suggests to me that py.test 
will have to try harder to reduce its import magic.  Luckily, i have 
an alternative approach which removes the need to have a custom 
import hook for the py lib.  I am checking that into the 
collect-branch (which will soon get merged, didn't i mention that
last week?)

On a side note, i can't remember the number of times anymore 
that i - often in agreemeent with others - have stumbled on 
this pile of hacks called the import system.  What especially bugs 
me is that i am absolutely sure that Python could have (and would 
deserve!) a really nice thought-through import system.   Hum, 
i guess that if a pile of hacks passes a certain complexity level 
then it has strong tendencies to keep piling. 

cheers, 

    holger


More information about the py-dev mailing list