from __future__ import with_statement
import sys

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

version = "0.0.1-dev"


def readme():
    with open('README.md') as f:
        return f.read()

reqs = [line.strip() for line in open('requirements.txt')]


class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

setup(
    name                = "modflow2netcdf",
    version             = version,
    description         = "A utility to convert MODFLOW output into a CF compliant NetCDF file",
    long_description    = readme(),
    license             = 'MIT',
    author              = "<NAME>",
    author_email        = "<EMAIL>",
    url                 = "https://github.com/axiom-data-science/modflow2netcdf",
    packages            = find_packages(),
    install_requires    = reqs,
    tests_require       = ['pytest'],
    cmdclass            = {'test': PyTest},
    entry_points        = {
        'console_scripts' : [
            'mod2net=modflow2netcdf.mod2net:run'
        ],
    },
    classifiers         = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Topic :: Scientific/Engineering',
    ],
    include_package_data = True,
)

from __future__ import with_statement
import sys

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

version = "0.0.1-dev"


def readme():
    with open('README.md') as f:
        return f.read()

reqs = [line.strip() for line in open('requirements.txt')]


class PyTest(TestCommand):
    def finalize_options(self):
        TestCommand.finalize_options(self)
        self.test_args = []
        self.test_suite = True

    def run_tests(self):
        import pytest
        errno = pytest.main(self.test_args)
        sys.exit(errno)

setup(
    name                = "modflow2netcdf",
    version             = version,
    description         = "A utility to convert MODFLOW output into a CF compliant NetCDF file",
    long_description    = readme(),
    license             = 'MIT',
    author              = "<NAME>",
    author_email        = "<EMAIL>",
    url                 = "https://github.com/axiom-data-science/modflow2netcdf",
    packages            = find_packages(),
    install_requires    = reqs,
    tests_require       = ['pytest'],
    cmdclass            = {'test': PyTest},
    entry_points        = {
        'console_scripts' : [
            'mod2net=modflow2netcdf.mod2net:run'
        ],
    },
    classifiers         = [
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Topic :: Scientific/Engineering',
    ],
    include_package_data = True,
)
