License.txt inclussion breaks McMillan's Installer.

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>. A second solution is to wrap the above incantation in try, except; however, this doesn't guarantee that the license file is included. A third solution is to come up with a different incantation that works for installer. I've looked at this briefly and it looks a little messy. Nevertheless, I'll come up with something that works if this is deemed the preferred solution. Someone else will have to figure out what works with py2exe. [ If the above makes no sense to those of you unfamilar with McMillan's installer, I apologize -- ask away and I'll try to clarify] Regards -tim

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
A second solution is to wrap the above incantation in try, except; however, this doesn't guarantee that the license file is included.
A third solution is to come up with a different incantation that works for installer. I've looked at this briefly and it looks a little messy. Nevertheless, I'll come up with something that works if this is deemed the preferred solution. Someone else will have to figure out what works with py2exe.
[ If the above makes no sense to those of you unfamilar with McMillan's installer, I apologize -- ask away and I'll try to clarify]
Regards
-tim
------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion -- Todd Miller Space Telescope Science Institute 3700 San Martin Drive Baltimore MD, 21030 (410) 338 - 4576

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@physics.mcmaster.ca
participants (3)
-
David M. Cooke
-
Tim Hochberg
-
Todd Miller