mirror of https://github.com/coqui-ai/TTS.git
94 lines
3.2 KiB
Python
94 lines
3.2 KiB
Python
#!/usr/bin/env python
|
|
# ,*++++++*, ,*++++++*,
|
|
# *++. .+++ *++. .++*
|
|
# *+* ,++++* *+* *+* ,++++, *+*
|
|
# ,+, .++++++++++* ,++,,,,*+, ,++++++++++. *+,
|
|
# *+. .++++++++++++..++ *+.,++++++++++++. .+*
|
|
# .+* ++++++++++++.*+, .+*.++++++++++++ *+,
|
|
# .++ *++++++++* ++, .++.*++++++++* ++,
|
|
# ,+++*. . .*++, ,++*. .*+++*
|
|
# *+, .,*++**. .**++**. ,+*
|
|
# .+* *+,
|
|
# *+. Coqui .+*
|
|
# *+* +++ TTS +++ *+*
|
|
# .+++*. . . *+++.
|
|
# ,+* *+++*... ...*+++* *+,
|
|
# .++. .""""+++++++****+++++++"""". ++.
|
|
# ,++. .++,
|
|
# .++* *++.
|
|
# *+++, ,+++*
|
|
# .,*++++::::::++++*,.
|
|
# ``````
|
|
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
import numpy
|
|
import setuptools.command.build_py
|
|
import setuptools.command.develop
|
|
from Cython.Build import cythonize
|
|
from setuptools import Extension, setup
|
|
|
|
cwd = os.path.dirname(os.path.abspath(__file__))
|
|
with open(os.path.join(cwd, "TTS", "VERSION")) as fin:
|
|
version = fin.read().strip()
|
|
|
|
|
|
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
|
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
|
|
package_data = ["TTS/server/templates/*"]
|
|
|
|
|
|
def pip_install(package_name):
|
|
subprocess.call([sys.executable, "-m", "pip", "install", package_name])
|
|
|
|
|
|
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.ja.txt"), "r") as f:
|
|
requirements_ja = f.readlines()
|
|
requirements_server = ["flask>=2.0.1"]
|
|
requirements_all = requirements_dev + requirements_notebooks + requirements_ja + requirements_server
|
|
|
|
exts = [
|
|
Extension(
|
|
name="TTS.tts.utils.monotonic_align.core",
|
|
sources=["TTS/tts/utils/monotonic_align/core.pyx"],
|
|
)
|
|
]
|
|
setup(
|
|
version=version,
|
|
# cython
|
|
include_dirs=numpy.get_include(),
|
|
ext_modules=cythonize(exts, language_level=3),
|
|
# ext_modules=find_cython_extensions(),
|
|
# package
|
|
cmdclass={
|
|
"build_py": build_py,
|
|
"develop": develop,
|
|
# 'build_ext': build_ext
|
|
},
|
|
install_requires=requirements,
|
|
extras_require={
|
|
"all": requirements_all,
|
|
"dev": requirements_dev,
|
|
"notebooks": requirements_notebooks,
|
|
"server": requirements_server,
|
|
"ja": requirements_ja,
|
|
},
|
|
zip_safe=False,
|
|
)
|