summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorembray <embray@stsci.edu>2011-07-07 12:38:53 -0400
committerembray <embray@stsci.edu>2011-07-07 12:38:53 -0400
commitebc288f142741cf8863c1d520350d618753a7f30 (patch)
tree412c4823a9d811009dcb1cc060184ed557bb3ec4
parent433054acfc0593f83bd8ee650ac7ceb991e3c5e8 (diff)
downloadstwcs_hcf-ebc288f142741cf8863c1d520350d618753a7f30.tar.gz
Updated packages to use the svn_info hooks, and to get their version numbers from pkg_resources. I only did this with packages that were already using __svn_version__, __full_svn_info__, etc. to begin with.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@13327 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--lib/stwcs/__init__.py36
-rw-r--r--setup.cfg8
2 files changed, 33 insertions, 11 deletions
diff --git a/lib/stwcs/__init__.py b/lib/stwcs/__init__.py
index a32f8b9..120608f 100644
--- a/lib/stwcs/__init__.py
+++ b/lib/stwcs/__init__.py
@@ -1,12 +1,17 @@
""" STWCS
-This package provides support for WCS based distortion models and coordinate
-transformation. It relies on PyWCS (based on WCSLIB). It consists of two subpackages:
-updatewcs and wcsutil. Updatewcs performs corrections to the basic WCS and includes
-other distortion infomation in the science files as header keywords or file extensions.
-Wcsutil provides an HSTWCS object which extends pywcs.WCS object and provides HST instrument
-specific information as well as methods for coordinate tarnsformaiton. Wcsutil also provides
-functions for manipulating alternate WCS descriptions in the headers.
+This package provides support for WCS based distortion models and coordinate
+transformation. It relies on PyWCS (based on WCSLIB). It consists of two
+subpackages: updatewcs and wcsutil.
+
+updatewcs performs corrections to the
+basic WCS and includes other distortion infomation in the science files as
+header keywords or file extensions.
+
+Wcsutil provides an HSTWCS object which extends pywcs.WCS object and provides
+HST instrument specific information as well as methods for coordinate
+transformation. wcsutil also provides functions for manipulating alternate WCS
+descriptions in the headers.
"""
from __future__ import division # confidence high
@@ -20,10 +25,19 @@ __docformat__ = 'restructuredtext'
DEGTORAD = fileutil.DEGTORAD
RADTODEG = fileutil.RADTODEG
-__version__ = '0.8'
+
+__version__ = ''
+__svn_version = ''
+__full_svn_info__ = ''
+__setup_datetime__ = None
+
+try:
+ __version__ = __import__('pkg_resources').get_distribution('stwcs').version
+except:
+ pass
try:
- import svn_version
- __svn_version__ = svn_version.__svn_version__
+ from stwcs.svninfo import (__svn_version__, __full_svn_info__,
+ __setup_datetime__)
except ImportError:
- __svn_version__ = 'Unable to determine SVN revision' \ No newline at end of file
+ __svn_version__ = 'Unable to determine SVN revision'
diff --git a/setup.cfg b/setup.cfg
index 4db0ee5..74e63b1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,5 +29,13 @@ packages =
[global]
commands = stsci.distutils.command.easier_install.easier_install
+[sdist]
+pre-hook.svn-info = stsci.distutils.hooks.svn_info_pre_hook
+post-hook.svn-info = stsci.distutils.hooks.svn_info_post_hook
+
+[build_py]
+pre-hook.svn-info = stsci.distutils.hooks.svn_info_pre_hook
+post-hook.svn-info = stsci.distutils.hooks.svn_info_post_hook
+
[easy_install]
find-links = ..