from setuptools import setup
from setuptools.command.install import install

# build instructions
# python setup.py sdist
# twine upload dist/*

def post_installation():
    import cloudlanguagetools.spacy
    cloudlanguagetools.spacy.install_all_packages()
    import cloudlanguagetools.argostranslate
    cloudlanguagetools.argostranslate.install_all_packages()


class PostInstallCommand(install):
    """Post-installation for installation mode."""

    def run(self):
        install.run(self)
        post_installation()


setup(name='cloudlanguagetools',
      version='0.8',
      description='Interface with various cloud APIs for language processing such as translation, text to speech',
      long_description=open('README.rst', encoding='utf-8').read(),
      url='https://github.com/Language-Tools/cloud-language-tools-core',
      author='Luc',
      author_email='languagetools@mailc.net',
      classifiers=[
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Topic :: Text Processing :: Linguistic',
      ],      
      license='GPL',
      packages=['cloudlanguagetools'],
      install_requires=[
          'azure-cognitiveservices-speech',
          'requests',
          'google-cloud-texttospeech',
          'google-cloud-translate',
          'boto3',
          'epitran',
          'pythainlp[thai2rom,ipa]',
          'spacy',
          'jieba',
          'pinyin_jyutping_sentence',
          'argostranslate',
          'cryptography',
          'pydub'
      ],
      cmdclass={
          'install': PostInstallCommand
      }      
      )