From af99439c057871ea8974f5e4cdd674b8c6110dfe Mon Sep 17 00:00:00 2001 From: lim Date: Thu, 29 Mar 2012 15:31:13 +0000 Subject: lim added files to sphere branch git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/branches/sphere@15878 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: b51412b5b545598ae101152eeaed470b08616176 --- setup.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 setup.py (limited to 'setup.py') diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..b810728 --- /dev/null +++ b/setup.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +CONTACT = "Michael Droettboom" +EMAIL = "help@stsci.edu" +VERSION = "0.1" + +from distutils.core import setup, Extension +import sys + +try: + import numpy +except ImportError: + print("numpy must be installed to build sphere.") + print("ABORTING.") + raise + +major, minor, rest = numpy.__version__.split(".", 2) +if (int(major), int(minor)) < (1, 4): + print("numpy version 1.4 or later must be installed to build pywcs.") + print("ABORTING.") + raise ImportError + +try: + numpy_include = numpy.get_include() +except AttributeError: + numpy_include = numpy.get_numpy_include() + +extensions = [ + Extension('sphere.math_util', + ['src/math_util.c'], + include_dirs = [numpy_include], + libraries = ['m']) + ] + +setup( + name = 'sphere', + version = VERSION, + description = "Python based tools for spherical geometry", + author = CONTACT, + author_email = EMAIL, + packages = ['sphere', 'sphere.test'], + package_dir = {'sphere': 'lib', 'sphere.test': 'lib/test'}, + package_data = {'sphere.test': ['data/*.fits', 'data/*.fits.gz']}, + ext_modules = extensions + ) -- cgit