from setuptools import setup
import ast
import os
import io


def version():
    



def get_long_description():
    with io.open('readme.md', encoding="utf-8") as f:
        long_description = f.read()

    try:
        import pypandoc
    except ImportError:
        print('pypandoc not installed, using file contents.')
        return long_description

    try:
        long_description = pypandoc.convert('readme.md', 'rst')
    except OSError:
        print("Pandoc not found. Long_description conversion failure.")
        return long_description
    else:
        long_description = long_description.replace("\r", "")
    return long_description


setup(name='remixcast',
      version=version(),
      description='Create podcasts by remixing other podcasts and audio files',
      long_description=get_long_description(),
      url='https://github.com/thomasballinger/remixcast',
      author='Thomas Ballinger',
      author_email='thomasballinger@gmail.com',
      license='Expat',
      packages=['remixcast'],
      install_requires=[
          'requests',
          'feedgen',
          'parsimonious',
          'podcastparser',
          'pydub',
      ],
      tests_require=[
          'pytest'
      ],
      entry_points={
          'console_scripts': [
              'mix = remixcast.mix:main',
              'feedmix = remixcast.feedmix:main',
          ]
      },
      classifiers=[
          "Development Status :: 3 - Alpha",
          "License :: DFSG approved",
          "License :: OSI Approved :: MIT License",
          "Operating System :: OS Independent",
          "Programming Language :: Python",
          "Programming Language :: Python :: 3",
          "Programming Language :: Python :: 3.3",
          "Programming Language :: Python :: 3.4",
          "Programming Language :: Python :: 3.5",
          "Topic :: Multimedia :: Sound/Audio"
          "Topic :: Multimedia :: Sound/Audio :: Mixers"
      ],
      zip_safe=False)

"""Return version string."""
    with open(os.path.join('remixcast', '__init__.py')) as input_file:
        for line in input_file:
            if line.startswith('__version__'):
                return ast.parse(line).body[0].value.s