from setuptools import setup
import re
from io import open

# Get the current version
version = None
with open('plexiglas/__init__.py') as handle:
    for line in handle.readlines():
        if line.startswith('__version__'):
            version = re.findall("'([^']+?)'", line)[0]
            break

if version is None:
    print('Unable to find package version')
    exit(1)

# Get README.md contents
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    readme = f.read()

# Get requirements
requirements = []
dependency_links = []
with open('requirements.txt') as handle:
    for line in handle.readlines():
        if not line.startswith('#') and not line.startswith('-i '):
            if '://' in line:
                link = line.strip()
                dependency_links.append(link)
                requirements.append(re.findall("#egg=(.*?)-[\d.]+", line)[0])
            else:
                requirements.append(line.strip())

setup(
    name='plexiglas',
    version=version,
    packages=['plexiglas'],
    package_dir={'plexiglas': 'plexiglas'},
    url='https://github.com/andrey-yantsen/plexiglass',
    license='MIT',
    author='<NAME>',
    author_email='<EMAIL>',
    description='Tool for downloading videos from your Plex server to an external HDD',
    include_package_data=True,
    long_description=readme,
    long_description_content_type='text/markdown',
    install_requires=requirements,
    dependency_links=dependency_links,
    entry_points={
        'console_scripts': ['plexiglas = plexiglas.cli:main'],
        'plexiglas.plugins': [
            'mobile_sync = plexiglas.mobile_sync',
            'simple_sync = plexiglas.simple_sync',
        ],
    },
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: MIT License',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
    ],
)

from setuptools import setup
import re
from io import open

# Get the current version
version = None
with open('plexiglas/__init__.py') as handle:
    for line in handle.readlines():
        if line.startswith('__version__'):
            version = re.findall("'([^']+?)'", line)[0]
            break

if version is None:
    print('Unable to find package version')
    exit(1)

# Get README.md contents
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    readme = f.read()

# Get requirements
requirements = []
dependency_links = []
with open('requirements.txt') as handle:
    for line in handle.readlines():
        if not line.startswith('#') and not line.startswith('-i '):
            if '://' in line:
                link = line.strip()
                dependency_links.append(link)
                requirements.append(re.findall("#egg=(.*?)-[\d.]+", line)[0])
            else:
                requirements.append(line.strip())

setup(
    name='plexiglas',
    version=version,
    packages=['plexiglas'],
    package_dir={'plexiglas': 'plexiglas'},
    url='https://github.com/andrey-yantsen/plexiglass',
    license='MIT',
    author='<NAME>',
    author_email='<EMAIL>',
    description='Tool for downloading videos from your Plex server to an external HDD',
    include_package_data=True,
    long_description=readme,
    long_description_content_type='text/markdown',
    install_requires=requirements,
    dependency_links=dependency_links,
    entry_points={
        'console_scripts': ['plexiglas = plexiglas.cli:main'],
        'plexiglas.plugins': [
            'mobile_sync = plexiglas.mobile_sync',
            'simple_sync = plexiglas.simple_sync',
        ],
    },
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: End Users/Desktop',
        'License :: OSI Approved :: MIT License',
        "Programming Language :: Python :: 2",
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
    ],
)

# Get the current version # Get README.md contents # read the contents of your README file # Get requirements