summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorlim <lim@stsci.edu>2012-03-29 11:31:13 -0400
committerlim <lim@stsci.edu>2012-03-29 11:31:13 -0400
commitaf99439c057871ea8974f5e4cdd674b8c6110dfe (patch)
treef82170a77c8cb63691f1f235e46ee14664895eb7 /setup.py
parent69e439b92cece8d8a2def7d38c2cb38b639eab0d (diff)
downloadstsci.sphere-af99439c057871ea8974f5e4cdd674b8c6110dfe.tar.gz
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
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py45
1 files changed, 45 insertions, 0 deletions
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
+ )