# import sys

import os
import io

from setuptools import setup, find_packages, Command
from os import path

root = 'moana'
name = 'moana'
version = '0.1.0'

here = path.abspath(path.dirname(__file__))
description = ('Moana: A Python Package.')

install_requires = [
    'scikit-learn>=0.19.1, <1',
    'pandas>=0.21.1, <1',
    #'plotly>=2.0.0, <3',
    #'scipy>=1, <2',
]

# do not require installation if built by ReadTheDocs
# (we mock these modules in docs/source/conf.py)
if 'READTHEDOCS' not in os.environ or \
        os.environ['READTHEDOCS'] != 'True':
    install_requires.extend([
        #'plotly>=1.9.6, <3',
    ])
else:
    install_requires.extend([
        #'pandas>=0.13, <1',
    ])

# get long description from file
long_description = ''
with io.open(path.join(here, 'README.rst'), encoding='UTF-8') as fh:
    long_description = fh.read()


class CleanCommand(Command):
    """Removes files generated by setuptools.

    """
    # see https://github.com/trigger/trigger/blob/develop/setup.py
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        error_msg = 'You must run this command in the package root!'
        if not os.getcwd() == here:
            raise OSError(error_msg)
        else:
            os.system('rm -rf ./dist ./build ./*.egg-info ')

setup(
    name=name,

    version=version,

    description=description,
    long_description=long_description,

    # homepage
    url='https://github.com/flo-compbio/moana',

    author='Florian Wagner',
    author_email='florian.wagner@nyu.edu',

    license='proprietary',

    # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Bio-Informatics',

        'License :: Other/Proprietary License',

        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
    ],

    keywords='',

    # packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
    packages=find_packages(exclude=['docs', 'tests*']),
    # packages=find_packages(root),

    # libraries = [],

    install_requires=install_requires,

    # tests_require=[],

    extras_require={
        'docs': [
            'sphinx',
            'sphinx-rtd-theme',
            'sphinx-argparse',
            'mock',
        ],
        'tests': [
            'pytest>=3, <4',
            'pytest-cov>=2.2.1, <3',
        ],
    },

    # data
    package_data={
    },

    # data outside the package
    # data_files=[('my_data', ['data/data_file'])],

    entry_points={
        'console_scripts': [
        ],
    },

    cmdclass={
        'clean': CleanCommand,
    },

)
