# -*- coding: utf-8 -*-

import sys

from odmltables import VERSION
from setuptools import setup

long_description = open("README.rst").read()
install_requires = ['xlrd >= 0.9.4',
                    'xlwt >= 1.0.0',
                    'numpy >= 1.8.2',
                    'quantities >= 0.10.1',
                    'odml >= 1.4',
                    'future >= 0.16.0']

# Add python 2 only install requirements
if sys.version_info.major < 3:
    install_requires.append('enum >= 0.4.6')

extras_require = {'docs': ['numpydoc>=0.5',
                           'sphinx>=1.2.2'],
                  'tests': ['nose>=1.3.3'],
                  'gui': ['pyqt5>=5.0.0'],
                  # 'basics':['gcc >= 4.8.5',
                  #           'libxml2 >= 2.9.2'],
                  }

setup(
    name="python-odmltables",
    version=VERSION,
    packages=['odmltables', 'odmltables.gui', 'odmltables.tests'],
    package_data={'odmltables': ['gui/graphics/*']},
    install_requires=install_requires,
    extras_require=extras_require,

    author="odMLtables authors and contributors",
    author_email="j.sprenger@fz-juelich.de",
    description="Interface to convert odML structures to and from table-like representations",
    long_description=long_description,
    license="BSD",
    url='https://github.com/INM-6/python-odmltables',
    # download_url='https://github.com/INM-6/python-odmltables/archive/0.1.1.tar.gz',
    # keep this dependency link only until odml 1.4 release on PyPi
    dependency_links=[
        'git+https://github.com/g-node/python-odml.git@master#egg=odml-1.4'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Scientific/Engineering'],

    entry_points={
        'gui_scripts': ['odmltables = odmltables.gui.main:parse_args []']},
    zip_safe=False,
    keywords=['odml', 'excel', 'metadata management']
    #     data_files = [('/usr/share/applications', ['odmltables.desktop']),
    #                   ('/usr/share/pixmaps', ['logo/odMLtables.png'])]
)

# -*- coding: utf-8 -*-

import sys
import warnings

from odmltables import VERSION
from setuptools import setup, find_packages

with open("README.rst") as f:
    long_description = f.read()
with open('requirements.txt') as f:
    install_requires = f.read().splitlines()
with open('requirements_docs.txt') as f:
    docs_requires = f.read().splitlines()
with open('requirements_tests.txt') as f:
    tests_requires = f.read().splitlines()
with open('requirements_gui.txt') as f:
    gui_requires = f.read().splitlines()

extras_require = {'docs': docs_requires,
                  'tests': tests_requires,
                  'gui': gui_requires
                  }

# PyQt5 needs to be installed manually with python 2 when installing odmltables gui.
if sys.version_info.major < 3:
    warnings.warn('The odMLtables gui requires PyQt5. Please install this dependency first before '
                  'installing the odmltables gui, eg. using "conda install -c anaconda '
                  '\'pyqt>=5\'"')

setup(
    name="python-odmltables",
    version=VERSION,
    packages=find_packages(),
    package_data={'odmltables': ['gui/graphics/*']},
    install_requires=install_requires,
    extras_require=extras_require,

    author="odMLtables authors and contributors",
    author_email="j.sprenger@fz-juelich.de",
    description="Interface to convert odML structures to and from table-like representations",
    long_description=long_description,
    license="BSD",
    url='https://github.com/INM-6/python-odmltables',
    download_url="https://github.com/INM-6/python-odmltables/archive/{0}.tar.gz".format(VERSION),
    # keep this dependency link only until odml 1.4 release on PyPi
    dependency_links=[
        'git+https://github.com/g-node/python-odml.git@master#egg=odml-1.4'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Scientific/Engineering'],
    entry_points={
        'gui_scripts': ['odmltables = odmltables.gui.main:parse_args []']},
    zip_safe=False,
    keywords=['odml', 'excel', 'metadata management']
    #     data_files = [('/usr/share/applications', ['odmltables.desktop']),
    #                   ('/usr/share/pixmaps', ['logo/odMLtables.png'])]
)

make use of requirements files for installation