#!/usr/bin/env python
import os
import sys
from setuptools import setup

# Prepare and send a new release to PyPI
if "release" in sys.argv[-1]:
    os.system("python setup.py sdist")
    os.system("twine upload dist/*")
    os.system("rm -rf dist/kadenza*")
    sys.exit()

# Load the __version__ variable without importing the package already
exec(open('kadenza/version.py').read())

# Command-line tools
entry_points = {'console_scripts': [
    'kadenza-tpf = kadenza.kadenza:kadenza_tpf_main',
    'kadenza-ffi = kadenza.kadenza:kadenza_ffi_main'
]}

setup(name='kadenza',
      version=__version__,
      description="Converts raw cadence data from the Kepler spacecraft "
                  "into astronomer-friendly FITS files.",
      long_description=open('README.md').read(),
      author='Geert Barentsen',
      author_email='hello@geert.io',
      license='MIT',
      packages=['kadenza'],
      install_requires=['numpy>=1.8',
                        'astropy>=1.1',
                        'tqdm'],
      entry_points=entry_points,
      include_package_data=True,
      classifiers=[
          "Development Status :: 5 - Production/Stable",
          "License :: OSI Approved :: MIT License",
          "Operating System :: OS Independent",
          "Programming Language :: Python",
          "Intended Audience :: Science/Research",
          "Topic :: Scientific/Engineering :: Astronomy",
          ],
      )
