On Tue, Apr 15, 2008 at 6:32 PM, William Stein <[EMAIL PROTECTED]> wrote: > > > On Tue, Apr 15, 2008 at 9:22 AM, Ondrej Certik <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have the following problem: > > > > 1) current sympy spkg in Sage has a file: > > > > /sage/local/lib/python2.5/site-packages/sympy/core/parser.py > > > > that we removed in later versions of sympy, because it has the same > > name as the standard module. > > > > 2) later, we use the standard python parser module in sympy > > > > 3) I created a new spkg, however, when I install it in sage (over the > > current one), the old parser.py will not get removed and it will get > > called instead of the builtin parser, thus making sympy completely > > fail. > > > > Easy solution is just to use "rm parser.py". However, is there > > something that can be done with this? Or simply when you update the > > new spkg in the new version of Sage, the old files will automatically > > not be there, thus all will be fine. > > > > It took me quite some time to figure out what's wrong, so I am sharing > > my experiences. :) > > > > Now I need to go, but later hopefully I'll fix the remaining problems > > and create a trac ticket. > > This is just a general Python distutils problem -- it's not at all specific > to Sage. When we install sympy into sage we just do > > python setup.py install > > and what happens next is Python's "fault".
Yep. > > Namely stupid distutils does *not* delete the target directory before > installing the new sympy. What should be done? > > Note that *anybody* installing sympy into *any* python install would > have exactly the same problem, if they have installed a previous > sympy. Unless they do "apt-get install python-sympy". Sage is imho kind of a distribution, so maybe a solution is to implement some (very light) package management in sage, in a sense, that there could be a simple script in each spkg to clean after itself on removing, or just make Sage remember the files it installed. Maybe it's an overkill though. > > Maybe setuptools (or whatever sqlalchemy uses) addresses this > problem? I don't like setuptools, it's too much magic and it almost never worked for me. Plain distutils is stupid, but at least it does the job of copying the correct files to correct locations 100%. However just the fact, that it produces a broken install if there were some files before it is bad. However, I even consider this a python fault (i.e. I belive a python library/module should be working no matter which files you put around), but I think this could be fixed by using relative imports in python2.5. Ondrej --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
