#!/usr/bin/env python
"""Nitime release script.

This should only be run at real release time.
"""

from toollib import *

# Find our directory and go one above, regardless of where we were called from
my_dir = os.path.split(os.path.abspath(__file__))[0]
cd(pjoin(my_dir, '..'))

# Load release info
execfile(pjoin('nitime','version.py'))

print
print "Releasing Nitime version %s" % __version__
print

# Build release files
sh('tools/build_release')

# Register with the Python Package Index (PyPI)
print "Registering with PyPI..."
sh('./setup.py register')

# Upload all files
print "Uploading distribution files..."
sh('./setup.py sdist upload')

print "Done!"
