Files
TTS/setup.py

89 lines
2.3 KiB
Python
Raw Normal View History

2018-06-21 15:48:13 +02:00
#!/usr/bin/env python
from setuptools import setup, find_packages
import setuptools.command.develop
import setuptools.command.build_py
import os
import subprocess
version = '0.0.1'
# Adapted from https://github.com/pytorch/pytorch
cwd = os.path.dirname(os.path.abspath(__file__))
if os.getenv('TTS_PYTORCH_BUILD_VERSION'):
version = os.getenv('TTS_PYTORCH_BUILD_VERSION')
else:
try:
sha = subprocess.check_output(
['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
version += '+' + sha[:7]
except subprocess.CalledProcessError:
pass
except IOError: # FileNotFoundError for python 3
pass
class build_py(setuptools.command.build_py.build_py):
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)
def create_readme_rst():
try:
subprocess.check_call(
2018-08-02 16:34:17 +02:00
[
"pandoc", "--from=markdown", "--to=rst", "--output=README.rst",
"README.md"
],
cwd=cwd)
2018-06-21 15:48:13 +02:00
print("Generated README.rst from README.md using pandoc.")
except subprocess.CalledProcessError:
pass
except OSError:
pass
2018-08-02 16:34:17 +02:00
setup(
name='TTS',
version=version,
url='https://github.com/mozilla/TTS',
description='Text to Speech with Deep Learning',
package_dir={'TTS': '.'},
packages=['TTS'] + ['TTS.' + pkg for pkg in find_packages()],
2018-08-02 16:34:17 +02:00
cmdclass={
'build_py': build_py,
'develop': develop,
},
2019-02-20 16:45:50 +01:00
setup_requires=["numpy==1.15.4"],
2018-08-02 16:34:17 +02:00
install_requires=[
2018-11-03 19:15:06 +01:00
"scipy >=0.19.0",
2018-08-13 15:02:17 +02:00
"torch >= 0.4.1",
2019-02-20 16:45:50 +01:00
"librosa==0.6.2",
2018-08-03 15:37:26 +02:00
"unidecode==0.4.20",
2018-08-02 16:34:17 +02:00
"tensorboardX",
2018-08-03 15:37:26 +02:00
"matplotlib==2.0.2",
2018-08-02 16:34:17 +02:00
"Pillow",
"flask",
2018-11-02 16:13:51 +01:00
# "lws",
"tqdm",
2019-05-23 01:52:37 +02:00
"soundfile",
2019-01-10 15:35:48 +01:00
],
dependency_links=[
'http://github.com/bootphon/phonemizer/tarball/master#egg=phonemizer'
2018-08-02 16:34:17 +02:00
],
)