[Numpy-discussion] License.txt inclussion breaks McMillan's Installer.

David M. Cooke cookedm at physics.mcmaster.ca
Fri Jan 9 06:51:00 EST 2004


On Fri, Jan 09, 2004 at 08:50:04AM -0500, Todd Miller wrote:
> On Thu, 2004-01-08 at 18:37, Tim Hochberg wrote:
> > 
> > The way LICENSE.txt is included in the __init__ file for numarray breaks 
> > McMillan's installer (and probably py2exe as well, although I haven't 
> > checked that). The offending line is:
> > 
> >     __LICENSE__ = open(_os.path.join(__path__[0],"LICENSE.txt")).read()
> > 
> > 
> > The first problem is that the installer doesn't pick up the dependancy 
> > on LICENSE.txt. That's not a huge deal as it's relatively simple to add 
> > that to the list of dependancy's by hand.
> > 
> > More serious is that the __path__ variable is bogus in an installer 
> > archive so that the reading of the license file fails, even if it's present.
> > 
> > One solution is just include the license text directly instead of 
> > reading it from a separate file. This is simple and the license is short 
> > enough that this shouldn't clutter things too much. It's not like 
> > there's all that much in the __init__ file anyway <0.5 wink>.
> 
> I like this solution the best from the perspective of simplicity and
> fool-proof-ness.  I had considered it before but rejected it as leading
> to duplication of the license.  Now I realize I can just "put a symbolic
> link" in LICENSE.txt and move the actual text of the license to
> __init__.py as you suggest.
> 
> This is fixed in CVS now.
> 
> Todd

I have to admit that I read the problem above and thought, WHAT?
numarray already takes longer to import than Numeric; you mean some of
that time it's reading in a license file I'll never look at?

Compare:

$ time python -c 'import numarray'
real    0m0.230s
user    0m0.230s
sys     0m0.000s
$ time python -c 'import Numeric'
real    0m0.076s
user    0m0.050s
sys     0m0.020s

[final results after running each a couple times to get it in cache]

numarray takes 3 times longer to import than Numeric. I know, it's only
0.154 s difference, but that's noticeable for small scripts.

[Ok, so I just tested the change to reading the license, and I don't
see any change in import times :-)]

If I had any time, I'd look at making it import faster. Some playing
around with the hotshot profiler shows that most of the time is spent in
numarray.ufunc._makeCUFuncDict.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the NumPy-Discussion mailing list