summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorsienkiew <sienkiew@stsci.edu>2013-01-11 17:16:00 -0500
committersienkiew <sienkiew@stsci.edu>2013-01-11 17:16:00 -0500
commit5b61eb1ef2f7cb0bf4a074cecb2522e423c079b5 (patch)
tree5bfbc4ed74757a093eabbc7a46c3a40a445ffbac /setup.py
parent773381ed1be1297cbce4ab7b0c28d32ccf3e0e79 (diff)
downloadstwcs_hcf-5b61eb1ef2f7cb0bf4a074cecb2522e423c079b5.tar.gz
new install
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@21558 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'setup.py')
-rwxr-xr-x[-rw-r--r--]setup.py36
1 files changed, 33 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index ba1a2c0..94e3380 100644..100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,35 @@
#!/usr/bin/env python
-from __future__ import division # confidence high
-import stsci.tools.stsci_distutils_hack as H
-H.run()
+try:
+ from setuptools import setup
+except ImportError:
+ from distribute_setup import use_setuptools
+ use_setuptools()
+ from setuptools import setup
+
+try:
+ from stsci.distutils.command.easier_install import easier_install
+except ImportError:
+ import os
+ import sys
+ stsci_distutils = os.path.abspath(os.path.join('..', 'distutils', 'lib'))
+ if os.path.exists(stsci_distutils) and stsci_distutils not in sys.path:
+ sys.path.append(stsci_distutils)
+ try:
+ from stsci.distutils.command.easier_install import easier_install
+ import setuptools.command.easy_install
+ except ImportError:
+ # If even this failed, we're not in an stsci_python source checkout,
+ # so there's nothing gained from using easier_install
+ from setuptools.command.easy_install import easy_install
+ easier_install = easy_install
+# This is required so that easier_install can be used for setup_requires
+import setuptools
+setuptools.command.easy_install.easy_install = easier_install
+
+setup(
+ setup_requires=['d2to1>=0.2.5', 'stsci.distutils'],
+ d2to1=True,
+ use_2to3=True,
+ zip_safe=False
+)