TTS/setup.py

124 lines
4.1 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
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
2021-06-22 19:39:17 +00:00
if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion(sys.version) > LooseVersion("3.10"):
raise RuntimeError("TTS requires python >= 3.6 and <=3.10 " "but your Python version is {}".format(sys.version))
2019-11-27 15:40:32 +00:00
2018-06-21 13:48:13 +00:00
cwd = os.path.dirname(os.path.abspath(__file__))
2021-06-04 08:10:51 +00:00
cwd = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(cwd, "TTS", "VERSION")) as fin:
version = fin.read().strip()
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):
setuptools.command.build_py.build_py.run(self)
class develop(setuptools.command.develop.develop):
def run(self):
setuptools.command.develop.develop.run(self)
# The documentation for this feature is in server/README.md
2021-06-04 08:10:51 +00:00
package_data = ["TTS/server/templates/*"]
2018-06-21 13:48:13 +00:00
def pip_install(package_name):
2021-06-04 08:10:51 +00:00
subprocess.call([sys.executable, "-m", "pip", "install", package_name])
2021-06-04 08:10:51 +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()
2021-06-04 08:10:51 +00:00
with open(os.path.join(cwd, "requirements.dev.txt"), "r") as f:
requirements_dev = f.readlines()
2021-06-04 08:10:51 +00:00
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-06-04 08:10:51 +00:00
with open("README.md", "r", encoding="utf-8") as readme_file:
2021-01-25 10:16:20 +00:00
README = readme_file.read()
2021-06-04 08:10:51 +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(
2021-06-04 08:10:51 +00:00
name="TTS",
2018-08-02 14:34:17 +00:00
version=version,
2021-06-04 08:10:51 +00:00
url="https://github.com/coqui-ai/TTS",
author="Eren Gölge",
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",
2021-06-04 08:10:51 +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,
2021-06-04 08:10:51 +00:00
packages=find_packages(include=["TTS*"]),
package_data={
"TTS": [
"VERSION",
]
},
2019-08-26 13:18:43 +00:00
project_urls={
2021-06-04 08:10:51 +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={
2021-06-04 08:10:51 +00:00
"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,
},
python_requires=">=3.6.0, <3.10",
2021-06-04 08:10:51 +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",
2021-06-22 19:39:17 +00:00
"Programming Language :: Python :: 3.9",
2021-06-04 08:10:51 +00:00
"Development Status :: 3 - Alpha",
2021-01-25 10:16:20 +00:00
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
2021-06-04 08:10:51 +00:00
"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",
2021-06-04 08:10:51 +00:00
"Topic :: Scientific/Engineering :: Artificial Intelligence",
2021-01-26 01:57:50 +00:00
],
2021-06-04 08:10:51 +00:00
zip_safe=False,
2021-01-26 01:57:50 +00:00
)