Thanks for everyone's help. I decided to make it a package that can be
installed like:

sage -python setup.py install

My setup.py is as follows (except I changed the name of the package).
I arrived at its contents by trial and error, so if anyone could have
a quick look at it to see if there is anything really silly, then that
would be appreciated! -Emil

--------------------------
import os

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

if not os.environ.has_key('SAGE_ROOT'):
    print "    ERROR: The environment variable SAGE_ROOT must be defined."
    sys.exit(1)
else:
    SAGE_ROOT  = os.environ['SAGE_ROOT']
    SAGE_LOCAL = SAGE_ROOT + '/local'
    SAGE_DEVEL = SAGE_ROOT + '/devel'

setup(
        name='MyPackage',
        packages=['mypackage'],
        version='1.0',
        cmdclass = {'build_ext': build_ext},
        ext_modules = [
                Extension('mypackage.thing', sources=['mypackage/thing.pyx'],
                include_dirs = [SAGE_LOCAL + 
'/lib/python/site-packages/numpy/core/include',
                        SAGE_LOCAL + '/include/csage',
                        SAGE_DEVEL + '/sage/sage/ext',
                        SAGE_DEVEL + '/sage'],
                library_dirs = [SAGE_LOCAL + '/lib'])
        ]
)

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to