Source

IRATE-format / setup.py

Full commit
#!/usr/bin/env python
#Copyright (c) 2010 Erik Tollerud (etolleru@uci.edu) 

from glob import glob
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup,find_packages
from distutils.extension import Extension
    
try:
    from numpy import get_include as numpy_includes
except ImportError: #if numpy is not present, fake it so that the install_requires can be reached
    numpy_includes = lambda:''
    
try:
    from Cython.Distutils import build_ext
    have_cython = True
except ImportError:
    have_cython = False
    
    
setupkwargs = dict(name='IRATE',
    description='Tools for IRvine Astrophysical simulaTion structurE format',
    packages=find_packages(),
    scripts=glob('scripts/*'),
    requires=['numpy','h5py'],
    install_requires=['numpy'],
    provides=['irate'],
    author='Erik Tollerud  Shea Garrison  Miguel Rocha', #is this the way to do multiple authors?
    author_email='erik.tollerud@gmail.com',
    url='http://bitbucket.org/eteq/irate-format'
)


#from irate/__init__.py - update in-sync!
setupkwargs['version'] = '0.1dev'
    

#from irate/__init__.py
setupkwargs['long_description'] = """
The `IRATE` (IRvine Astrophysical simulaTion structurE) package contain tools
for accessing and interacting with the IRATE format, a format for astropysical
n-body and hydrodynamical simulations.
""" 
    
if have_cython:
    setupkwargs['cmdclass'] = {'build_ext':build_ext}
    setupkwargs['ext_modules'] = [Extension("irate.tipsy", ["irate/tipsy.pyx","extern/tipsy.c"],include_dirs=[numpy_includes()])]
else:
    setupkwargs['ext_modules'] = [Extension("irate.tipsy", ["irate/tipsy.c","extern/tipsy.c"],include_dirs=[numpy_includes()])]

setup(**setupkwargs)