root/trunk/setup.py

Revision 289, 1.6 kB (checked in by rmay, 3 years ago)

Remove testing code.

Line 
1from distutils.core import setup
2import os.path, sys
3
4build_gauss = False
5
6setup_path = os.path.split(os.path.abspath(__file__))[0]
7sys.path.append(os.path.join(setup_path, 'metpy'))
8import version
9version.write_svn_version()
10ver = version.get_version()
11sys.path.pop()
12
13# Optionally build the gaussian filter code
14if build_gauss:
15    from numpy.distutils.misc_util import get_numpy_include_dirs
16    include_dirs = get_numpy_include_dirs()
17    from distutils.extension import Extension
18
19    # If we find Cython, build from the pyx file, otherwise just build the
20    # C file
21    try:
22        from Cython.Distutils import build_ext
23        files = ["src/gauss.pyx"]
24    except ImportError:
25        from distutils.command.build_ext import build_ext
26        files = ["src/gauss.c"]
27
28    ext_modules = [Extension("metpy.tools._gauss_filt", files,
29        extra_compile_args=['-O2 -fomit-frame-pointer'])]
30else:
31    ext_modules = []
32    include_dirs = None
33    build_ext = None
34
35setup(name = 'MetPy',
36      version = ver,
37      packages = ['metpy', 'metpy.bl', 'metpy.readers', 'metpy.tools',
38        'metpy.vis'],
39      ext_modules = ext_modules,
40      include_dirs = include_dirs,
41      cmdclass = {'build_ext':build_ext},
42      platforms = ['Linux'],
43      description = 'Collection of tools for reading, visualizing and'
44        'performing calculations with weather data.',
45      url = 'http://code.forwarn.org/metpy',
46      )
47
48if not version.release:
49  # Remove __svn_version__ so that if we run from local, an outdated version
50  # won't be found
51  os.remove(version._svn_file_path)
52  os.remove(version._svn_file_path + 'c') #The .pyc file
Note: See TracBrowser for help on using the browser.