import os, sys, glob, fnmatch # This gets data files installed in the correct place. ee # http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb from distutils.command.install import INSTALL_SCHEMES for scheme in INSTALL_SCHEMES.values(): scheme['data'] = scheme['purelib'] # Importing these adds a 'bdist_mpkg' option that allows building binary packages on OS X. try: import setuptools import bdist_mpkg except ImportError: pass # need numpy distutils for fortran-based radau import numpy.distutils.core as ndcore # need regular python distutils for c-based dopri import distutils.core as pdcore #radau = ndcore.Extension(name='radau5', # sources=['integrator/_radau5v.f', # 'integrator/dc_lapack.f', # 'integrator/lapack.f', # 'integrator/lapackc.f', # 'integrator/radau5.f', # 'integrator/radau5.h', # 'integrator/radau5.i', # 'integrator/radau5mod.c', # 'integrator/radau5mod.h']) #dopri = pdcore.Extension(name='dopri853', # sources=[]) def opj(*args): path = os.path.join(*args) return os.path.normpath(path) def find_data_files(srcdir, *wildcards, **kw): # get a list of all files under the srcdir matching wildcards, # returned in a format to be used for install_data def walk_helper(arg, dirname, files): if '.svn' in dirname: return names = [] lst, wildcards = arg for wc in wildcards: wc_name = opj(dirname, wc) for f in files: filename = opj(dirname, f) if fnmatch.fnmatch(filename, wc_name) and not os.path.isdir(filename): names.append(filename) if names: lst.append( (dirname, names ) ) file_list = [] recursive = kw.get('recursive', True) if recursive: os.path.walk(srcdir, walk_helper, (file_list, wildcards)) else: walk_helper((file_list, wildcards), srcdir, [os.path.basename(f) for f in glob.glob(opj(srcdir, '*'))]) return file_list # recursive search needed here auto_files = find_data_files('PyDSTool/PyCont/auto','*.*') pdcore.setup( version="0.87", author="Rob Clewley; Erik Sherwood; Drew LaMar", author_email="robclewley@user.sourceforge.net;wesherwood@users.sourceforge.net;mdlamar@users.sourceforge.net", description="PyDSTool dynamical systems simulation and analysis package", license="BSD license", name="PyDSTool", url="http://pydstool.sourceforge.net", classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Topic :: Scientific/Engineering'], #install_requires=['numpy', 'scipy', 'matplotlib'], packages=['PyDSTool', 'PyDSTool.Generator', 'PyDSTool.PyCont', 'PyDSTool.Toolbox'], package_data={'PyDSTool': ['tests/*', 'integrator/*']}, data_files=auto_files#, # ext_modules = [radau, dopri] )