TTS/setup.py

127 lines
4.3 KiB
Python
Raw Normal View History

2018-06-21 13:48:13 +00:00
#!/usr/bin/env python
2019-11-27 15:40:32 +00:00
import os
import subprocess
import sys
from distutils.version import LooseVersion
2021-05-10 17:46:34 +00:00
from TTS._version import __version__
2019-11-27 15:40:32 +00:00
2021-01-26 01:57:50 +00:00
import numpy
2018-06-21 13:48:13 +00:00
import setuptools.command.build_py
2021-01-26 01:57:50 +00:00
import setuptools.command.develop
2021-01-29 00:36:21 +00:00
from Cython.Build import cythonize
2021-04-08 22:45:20 +00:00
from setuptools import Extension, find_packages, setup
if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion(sys.version) > LooseVersion("3.9"):
raise RuntimeError(
"TTS requires python >= 3.6 and <3.9 "
"but your Python version is {}".format(sys.version)
)
2019-11-27 15:40:32 +00:00
2018-06-21 13:48:13 +00:00
2021-05-10 17:46:34 +00:00
version = __version__
2018-06-21 13:48:13 +00:00
cwd = os.path.dirname(os.path.abspath(__file__))
2020-08-04 12:07:47 +00:00
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
2018-06-21 13:48:13 +00:00
def run(self):
self.create_version_file()
setuptools.command.build_py.build_py.run(self)
@staticmethod
def create_version_file():
print('-- Building version ' + version)
version_path = os.path.join(cwd, 'version.py')
with open(version_path, 'w') as f:
f.write("__version__ = '{}'\n".format(version))
class develop(setuptools.command.develop.develop):
def run(self):
build_py.create_version_file()
setuptools.command.develop.develop.run(self)
# The documentation for this feature is in server/README.md
2020-09-09 10:27:23 +00:00
package_data = ['TTS/server/templates/*']
2018-06-21 13:48:13 +00:00
def pip_install(package_name):
2020-09-22 01:54:16 +00:00
subprocess.call([sys.executable, '-m', 'pip', 'install', package_name])
2021-01-25 12:06:12 +00:00
requirements = open(os.path.join(cwd, 'requirements.txt'), 'r').readlines()
with open(os.path.join(cwd, 'requirements.notebooks.txt'), 'r') as f:
requirements_notebooks = f.readlines()
with open(os.path.join(cwd, 'requirements.dev.txt'), 'r') as f:
requirements_dev = f.readlines()
with open(os.path.join(cwd, 'requirements.tf.txt'), 'r') as f:
requirements_tf = f.readlines()
requirements_all = requirements_dev + requirements_notebooks + requirements_tf
2021-01-25 10:16:20 +00:00
with open('README.md', "r", encoding="utf-8") as readme_file:
README = readme_file.read()
2021-01-26 01:57:50 +00:00
exts = [Extension(name='TTS.tts.layers.glow_tts.monotonic_align.core',
sources=["TTS/tts/layers/glow_tts/monotonic_align/core.pyx"])]
2018-08-02 14:34:17 +00:00
setup(
2020-09-09 10:27:23 +00:00
name='TTS',
2018-08-02 14:34:17 +00:00
version=version,
2021-03-05 01:50:38 +00:00
url='https://github.com/coqui-ai/TTS',
2020-07-16 13:05:36 +00:00
author='Eren Gölge',
2021-03-05 01:50:38 +00:00
author_email='egolge@coqui.ai',
description='Deep learning for Text to Speech by Coqui.',
2021-01-25 12:06:12 +00:00
long_description=README,
long_description_content_type="text/markdown",
2019-08-26 13:18:43 +00:00
license='MPL-2.0',
2021-01-26 01:57:50 +00:00
# cython
include_dirs=numpy.get_include(),
ext_modules=cythonize(exts, language_level=3),
# ext_modules=find_cython_extensions(),
# package
include_package_data=True,
2020-07-16 13:05:36 +00:00
packages=find_packages(include=['TTS*']),
2019-08-26 13:18:43 +00:00
project_urls={
2021-03-05 01:50:38 +00:00
'Documentation': 'https://github.com/coqui-ai/TTS/wiki',
'Tracker': 'https://github.com/coqui-ai/TTS/issues',
'Repository': 'https://github.com/coqui-ai/TTS',
'Discussions': 'https://github.com/coqui-ai/TTS/discussions',
2019-08-30 08:29:22 +00:00
},
2018-08-02 14:34:17 +00:00
cmdclass={
'build_py': build_py,
'develop': develop,
2021-01-26 01:57:50 +00:00
# 'build_ext': build_ext
2018-08-02 14:34:17 +00:00
},
2021-01-25 12:06:12 +00:00
install_requires=requirements,
extras_require={
"all": requirements_all,
"dev": requirements_dev,
"notebooks": requirements_notebooks,
"tf": requirements_tf,
},
2021-01-25 12:06:12 +00:00
python_requires='>=3.6.0, <3.9',
2021-01-25 10:16:20 +00:00
entry_points={
'console_scripts': [
'tts=TTS.bin.synthesize:main',
'tts-server = TTS.server.server:main'
]
},
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
'Development Status :: 3 - Alpha',
2021-01-25 10:16:20 +00:00
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
2021-01-25 10:16:20 +00:00
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
2021-01-26 01:57:50 +00:00
],
zip_safe=False
)