On Wed, 03 Nov 2010 at 04:07AM -0700, Georg S. Weber wrote: > Watch out, > > there are are dragons ... :-)
Yes, as I discovered when I did something that I thought was simple and couldn't fail... > Let me try to give you some answers nevertheless (which might be > neither correct nor complete). Your answers are really helpful! Thanks so much. > Essentially, Sage uses the classical Python setuptools/distutils, with > some proprietary enhancements for Cython support. Classically, you > have a "python setup.py build" part, and a "python setup.py install" > part, much like "make" versus "make install". > > The "build" part is done in some subdirectory (created/named again > "build") of the directory where the setup.py script sits, and where > under "sage" all the sources are. Then, in "build/sage/ > temp.macosx-10.3-i386-2.6" (or the like) all the generated *.o files > from C extensions land (and nothing else), in "build/sage/ > lib.macosx-10.3-i386-2.6" (or the like) all the .so files (generated > from the *.o files) land, plus the *.py source files, and in "build/ > sage" the generated *.pyc files (together with copies of the .so files > and again, copies of the *.py files). In the end, instead of doing > some real "install" step, a symlink is created under "python/ > sitepackages" to this last directory (essentially, putting it into the > PYTHONPATH should do the same trick). That's what I'm trying to do in #9967: never use a symlink, and always have PYTHONPATH set appropriately. I have the PYTHONPATH stuff working, and now I'm trying to get the build process to not make the symlink, so that when running one branch, it's impossible to use the code from a different branch. > [...] > > Maybe it is this part confusing you --- in this manual step, new > directories are created, if necessary. And currently, this manual step > is using SITE_PACKAGES as anchor (see in the Sage 4.6 setup.py the > function "compile_command0()", around lines 772 - 787). To adapt this > for "build/sage" as anchor instead might mean only a handful of > changes, but these should be thoroughly reviewed ... That's pretty much what I want. As far as I can see, if I change SITE_PACKAGES in setup.py, nothing at all should end up in lib/python/site-packages -- but it does anyway. Thanks for the description. I'll go back and take another look and see if I can get the build process to ignore the site-packages directory. Dan -- --- Dan Drake ----- http://mathsci.kaist.ac.kr/~drake -------
signature.asc
Description: Digital signature