summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsetup.cfg36
-rwxr-xr-xsetup.py50
-rw-r--r--stsci/__init__.py8
-rw-r--r--stsci/sphere/__init__.py (renamed from lib/__init__.py)0
-rw-r--r--stsci/sphere/graph.py (renamed from lib/graph.py)0
-rw-r--r--stsci/sphere/great_circle_arc.py (renamed from lib/great_circle_arc.py)0
-rw-r--r--stsci/sphere/polygon.py (renamed from lib/polygon.py)0
-rw-r--r--stsci/sphere/test/__init__.py (renamed from lib/test/__init__.py)0
-rw-r--r--stsci/sphere/test/benchmarks.py (renamed from lib/test/benchmarks.py)0
-rw-r--r--stsci/sphere/test/data/1904-66_TAN.fits.gz (renamed from lib/test/data/1904-66_TAN.fits.gz)bin113196 -> 113196 bytes
-rw-r--r--stsci/sphere/test/data/2chipA.fits.gz (renamed from lib/test/data/2chipA.fits.gz)bin227579 -> 227579 bytes
-rw-r--r--stsci/sphere/test/data/2chipB.fits.gz (renamed from lib/test/data/2chipB.fits.gz)bin227493 -> 227493 bytes
-rw-r--r--stsci/sphere/test/data/2chipC.fits.gz (renamed from lib/test/data/2chipC.fits.gz)bin183594 -> 183594 bytes
-rw-r--r--stsci/sphere/test/test.py (renamed from lib/test/test.py)0
-rw-r--r--stsci/sphere/test/test_intersection.py (renamed from lib/test/test_intersection.py)0
-rw-r--r--stsci/sphere/test/test_shared.py (renamed from lib/test/test_shared.py)0
-rw-r--r--stsci/sphere/test/test_skyline.py (renamed from lib/test/test_skyline.py)0
-rw-r--r--stsci/sphere/test/test_union.py (renamed from lib/test/test_union.py)0
-rw-r--r--stsci/sphere/test/test_util.py (renamed from lib/test/test_util.py)0
-rw-r--r--stsci/sphere/vector.py (renamed from lib/vector.py)0
20 files changed, 56 insertions, 38 deletions
diff --git a/setup.cfg b/setup.cfg
index 64dcc16..70d9790 100755
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,39 @@
[metadata]
name = sphere
version = 0.1
+author = Michael Droettboom
+author-email = help@stsci.edu
+summary = Python based tools for spherical geometry
+home-page = http://www.stsci.edu/resources/software_hardware/stsci_python
+classifier =
+ Intended Audience :: Science/Research
+ License :: OSI Approved :: BSD License
+ Operating System :: OS Independent
+ Programming Language :: Python
+ Topic :: Scientific/Engineering :: Astronomy
+ Topic :: Software Development :: Libraries :: Python Modules
+requires-python = >=2.6
+
+[files]
+packages =
+ stsci
+ stsci.sphere
+ stsci.sphere.test
+package_data =
+ stsci.sphere.test = data/*
+
+[build_ext]
+pre-hook.numpy-extension-hook = stsci.distutils.hooks.numpy_extension_hook
+
+[extension=stsci.sphere.math_util]
+sources = src/math_util.c
+define_macros =
+ NUMPY = 1
+include_dirs = numpy
+
+[global]
+setup_hooks =
+ stsci.distutils.hooks.use_packages_root
+ stsci.distutils.hooks.tag_svn_revision
+ stsci.distutils.hooks.version_setup_hook
+
diff --git a/setup.py b/setup.py
index b810728..798cd05 100755
--- a/setup.py
+++ b/setup.py
@@ -1,45 +1,19 @@
#!/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
+ from setuptools import setup
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
+ from distribute_setup import use_setuptools
+ use_setuptools()
+ from setuptools import setup
-try:
- numpy_include = numpy.get_include()
-except AttributeError:
- numpy_include = numpy.get_numpy_include()
+setup(
+ setup_requires=['d2to1>=0.2.5', 'stsci.distutils>=0.3.dev'],
+ namespace_packages=['stsci'], packages=['stsci'],
+ d2to1=True,
+ use_2to3=True,
+ zip_safe=False
+)
-extensions = [
- Extension('sphere.math_util',
- ['src/math_util.c'],
- include_dirs = [numpy_include],
- libraries = ['m'])
- ]
+# package_data = {'stsci.sphere.test': ['data/*.fits', 'data/*.fits.gz']},
-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
- )
diff --git a/stsci/__init__.py b/stsci/__init__.py
new file mode 100644
index 0000000..a5133cc
--- /dev/null
+++ b/stsci/__init__.py
@@ -0,0 +1,8 @@
+# This is a special __init__.py required to place sample_package under the
+# stsci namespace package. There should be no other code in this module.
+try:
+ from pkg_resources import declare_namespace
+ declare_namespace(__name__)
+except ImportError:
+ from pkgutil import extend_path
+ __path__ = extend_path(__path__, __name__)
diff --git a/lib/__init__.py b/stsci/sphere/__init__.py
index 6a03273..6a03273 100644
--- a/lib/__init__.py
+++ b/stsci/sphere/__init__.py
diff --git a/lib/graph.py b/stsci/sphere/graph.py
index d8ccf75..d8ccf75 100644
--- a/lib/graph.py
+++ b/stsci/sphere/graph.py
diff --git a/lib/great_circle_arc.py b/stsci/sphere/great_circle_arc.py
index d5e78f2..d5e78f2 100644
--- a/lib/great_circle_arc.py
+++ b/stsci/sphere/great_circle_arc.py
diff --git a/lib/polygon.py b/stsci/sphere/polygon.py
index e9ad379..e9ad379 100644
--- a/lib/polygon.py
+++ b/stsci/sphere/polygon.py
diff --git a/lib/test/__init__.py b/stsci/sphere/test/__init__.py
index 8b13789..8b13789 100644
--- a/lib/test/__init__.py
+++ b/stsci/sphere/test/__init__.py
diff --git a/lib/test/benchmarks.py b/stsci/sphere/test/benchmarks.py
index 91ef8db..91ef8db 100644
--- a/lib/test/benchmarks.py
+++ b/stsci/sphere/test/benchmarks.py
diff --git a/lib/test/data/1904-66_TAN.fits.gz b/stsci/sphere/test/data/1904-66_TAN.fits.gz
index 34ff168..34ff168 100644
--- a/lib/test/data/1904-66_TAN.fits.gz
+++ b/stsci/sphere/test/data/1904-66_TAN.fits.gz
Binary files differ
diff --git a/lib/test/data/2chipA.fits.gz b/stsci/sphere/test/data/2chipA.fits.gz
index 27a68ab..27a68ab 100644
--- a/lib/test/data/2chipA.fits.gz
+++ b/stsci/sphere/test/data/2chipA.fits.gz
Binary files differ
diff --git a/lib/test/data/2chipB.fits.gz b/stsci/sphere/test/data/2chipB.fits.gz
index 209d5f9..209d5f9 100644
--- a/lib/test/data/2chipB.fits.gz
+++ b/stsci/sphere/test/data/2chipB.fits.gz
Binary files differ
diff --git a/lib/test/data/2chipC.fits.gz b/stsci/sphere/test/data/2chipC.fits.gz
index 10af627..10af627 100644
--- a/lib/test/data/2chipC.fits.gz
+++ b/stsci/sphere/test/data/2chipC.fits.gz
Binary files differ
diff --git a/lib/test/test.py b/stsci/sphere/test/test.py
index b551090..b551090 100644
--- a/lib/test/test.py
+++ b/stsci/sphere/test/test.py
diff --git a/lib/test/test_intersection.py b/stsci/sphere/test/test_intersection.py
index 6dacb3d..6dacb3d 100644
--- a/lib/test/test_intersection.py
+++ b/stsci/sphere/test/test_intersection.py
diff --git a/lib/test/test_shared.py b/stsci/sphere/test/test_shared.py
index 0853d3a..0853d3a 100644
--- a/lib/test/test_shared.py
+++ b/stsci/sphere/test/test_shared.py
diff --git a/lib/test/test_skyline.py b/stsci/sphere/test/test_skyline.py
index 929f0ba..929f0ba 100644
--- a/lib/test/test_skyline.py
+++ b/stsci/sphere/test/test_skyline.py
diff --git a/lib/test/test_union.py b/stsci/sphere/test/test_union.py
index 4b649f6..4b649f6 100644
--- a/lib/test/test_union.py
+++ b/stsci/sphere/test/test_union.py
diff --git a/lib/test/test_util.py b/stsci/sphere/test/test_util.py
index 6dc0393..6dc0393 100644
--- a/lib/test/test_util.py
+++ b/stsci/sphere/test/test_util.py
diff --git a/lib/vector.py b/stsci/sphere/vector.py
index c6887c4..c6887c4 100644
--- a/lib/vector.py
+++ b/stsci/sphere/vector.py