# -*- coding: utf-8 -*-
#
# Copyright 2016 - 2018  Ternaris.
# SPDX-License-Identifier: AGPL-3.0-only

from __future__ import absolute_import, division, print_function

import io
import os
from collections import OrderedDict
from setuptools import find_packages, setup

NAME = 'marv-robotics'
DESCRIPTION = 'Data management platform for robot logs'
ENTRY_POINTS = {
}

# Copy/paste block below here

os.chdir(os.path.abspath(os.path.dirname(__file__)))

with io.open(os.path.join('README.rst'), 'rt', encoding='utf8') as f:
    README = f.read()

with io.open('version', encoding='utf8') as f:
    VERSION = f.read().strip()

with io.open('requirements.in', 'rt', encoding='utf8') as f:
    INSTALL_REQUIRES = [
        '{}=={}'.format(
            os.path.basename(req.split()[1])[:-3],  # e.g. -r ../path/to/file/package_name.in
            VERSION
        ) if req.startswith('-r') else req
        for req in [line.strip() for line in f.readlines() if not line.startswith('#')]
        if req
    ] + ['marv-ludwig=={}'.format(VERSION)]

setup(name=NAME,
      version=VERSION,
      description=DESCRIPTION,
      long_description=README,
      classifiers=[
          'Development Status :: 5 - Production/Stable',
          'Framework :: Flask',
          'License :: OSI Approved :: GNU Affero General Public License v3',
          'Operating System :: POSIX :: Linux',
          'Programming Language :: Python :: 2 :: Only',
          'Programming Language :: Python :: 2.7',
          'Programming Language :: Python :: Implementation :: CPython',
          'Programming Language :: Python',
          'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
          'Topic :: Scientific/Engineering',
      ],
      author='Ternaris',
      author_email='team@ternaris.com',
      maintainer='Ternaris',
      maintainer_email='team@ternaris.com',
      url='https://ternaris.com/marv-robotics',
      project_urls=OrderedDict((
          ('Documentation', 'https://ternaris.com/marv-robotics/docs/'),
          ('Code', 'https://gitlab.com/ternaris/marv-robotics'),
          ('Issue tracker', 'https://gitlab.com/ternaris/marv-robotics/issues'),
      )),
      license='AGPL-3.0-only',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=False,
      python_requires='>=2.7.12,<3.0',
      install_requires=INSTALL_REQUIRES,
      tests_require=[
          'pytest',
          'mock',
          'testfixtures',
      ],
      setup_requires=['pytest-runner'],
      entry_points=ENTRY_POINTS)
