mirror of https://github.com/coqui-ai/TTS.git
auto upload to pypi on release
This commit is contained in:
parent
e66753bd0d
commit
ba9bcf7c6b
|
@ -0,0 +1,38 @@
|
||||||
|
name: Publish Python 🐍 distributions 📦 to PyPI
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell:
|
||||||
|
bash
|
||||||
|
jobs:
|
||||||
|
build-package:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Verify tag matches version
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
version=$(cat TTS/VERSION)
|
||||||
|
tag="${GITHUB_REF/refs\/tags\/}"
|
||||||
|
if [[ "v$version" != "$tag" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- run: |
|
||||||
|
python -m pip install -U pip setuptools twine toml
|
||||||
|
python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip install -r /dev/stdin
|
||||||
|
- run: |
|
||||||
|
python setup.py sdist
|
||||||
|
- name: Setup PyPI config
|
||||||
|
run: |
|
||||||
|
cat << EOF > ~/.pypirc
|
||||||
|
[pypi]
|
||||||
|
username=__token__
|
||||||
|
password=${{ secrets.PYPI_TOKEN }}
|
||||||
|
EOF
|
||||||
|
- run: |
|
||||||
|
twine upload --repository pypi dist/*.tar.gz
|
|
@ -0,0 +1 @@
|
||||||
|
0.0.14.1-alpha.2
|
|
@ -1 +1,7 @@
|
||||||
from ._version import __version__
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
with open(os.path.join(os.path.dirname(__file__), "VERSION")) as f:
|
||||||
|
version = f.read().strip()
|
||||||
|
|
||||||
|
__version__ = version
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
__version__ = "0.0.15"
|
|
91
setup.py
91
setup.py
|
@ -4,7 +4,6 @@ import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
from TTS._version import __version__
|
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
import setuptools.command.build_py
|
import setuptools.command.build_py
|
||||||
|
@ -12,82 +11,85 @@ import setuptools.command.develop
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
from setuptools import Extension, find_packages, setup
|
from setuptools import Extension, find_packages, setup
|
||||||
|
|
||||||
|
|
||||||
if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion(sys.version) > LooseVersion("3.9"):
|
if LooseVersion(sys.version) < LooseVersion("3.6") or LooseVersion(sys.version) > LooseVersion("3.9"):
|
||||||
raise RuntimeError(
|
raise RuntimeError("TTS requires python >= 3.6 and <3.9 " "but your Python version is {}".format(sys.version))
|
||||||
"TTS requires python >= 3.6 and <3.9 "
|
|
||||||
"but your Python version is {}".format(sys.version)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
version = __version__
|
|
||||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
|
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
|
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
||||||
def run(self):
|
def run(self):
|
||||||
self.create_version_file()
|
|
||||||
setuptools.command.build_py.build_py.run(self)
|
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):
|
class develop(setuptools.command.develop.develop):
|
||||||
def run(self):
|
def run(self):
|
||||||
build_py.create_version_file()
|
|
||||||
setuptools.command.develop.develop.run(self)
|
setuptools.command.develop.develop.run(self)
|
||||||
|
|
||||||
|
|
||||||
# The documentation for this feature is in server/README.md
|
# The documentation for this feature is in server/README.md
|
||||||
package_data = ['TTS/server/templates/*']
|
package_data = ["TTS/server/templates/*"]
|
||||||
|
|
||||||
|
|
||||||
def pip_install(package_name):
|
def pip_install(package_name):
|
||||||
subprocess.call([sys.executable, '-m', 'pip', 'install', package_name])
|
subprocess.call([sys.executable, "-m", "pip", "install", package_name])
|
||||||
|
|
||||||
|
|
||||||
requirements = open(os.path.join(cwd, 'requirements.txt'), 'r').readlines()
|
requirements = open(os.path.join(cwd, "requirements.txt"), "r").readlines()
|
||||||
with open(os.path.join(cwd, 'requirements.notebooks.txt'), 'r') as f:
|
with open(os.path.join(cwd, "requirements.notebooks.txt"), "r") as f:
|
||||||
requirements_notebooks = f.readlines()
|
requirements_notebooks = f.readlines()
|
||||||
with open(os.path.join(cwd, 'requirements.dev.txt'), 'r') as f:
|
with open(os.path.join(cwd, "requirements.dev.txt"), "r") as f:
|
||||||
requirements_dev = f.readlines()
|
requirements_dev = f.readlines()
|
||||||
with open(os.path.join(cwd, 'requirements.tf.txt'), 'r') as f:
|
with open(os.path.join(cwd, "requirements.tf.txt"), "r") as f:
|
||||||
requirements_tf = f.readlines()
|
requirements_tf = f.readlines()
|
||||||
requirements_all = requirements_dev + requirements_notebooks + requirements_tf
|
requirements_all = requirements_dev + requirements_notebooks + requirements_tf
|
||||||
|
|
||||||
with open('README.md', "r", encoding="utf-8") as readme_file:
|
with open("README.md", "r", encoding="utf-8") as readme_file:
|
||||||
README = readme_file.read()
|
README = readme_file.read()
|
||||||
|
|
||||||
exts = [Extension(name='TTS.tts.layers.glow_tts.monotonic_align.core',
|
exts = [
|
||||||
sources=["TTS/tts/layers/glow_tts/monotonic_align/core.pyx"])]
|
Extension(
|
||||||
|
name="TTS.tts.layers.glow_tts.monotonic_align.core",
|
||||||
|
sources=["TTS/tts/layers/glow_tts/monotonic_align/core.pyx"],
|
||||||
|
)
|
||||||
|
]
|
||||||
setup(
|
setup(
|
||||||
name='TTS',
|
name="TTS",
|
||||||
version=version,
|
version=version,
|
||||||
url='https://github.com/coqui-ai/TTS',
|
url="https://github.com/coqui-ai/TTS",
|
||||||
author='Eren Gölge',
|
author="Eren Gölge",
|
||||||
author_email='egolge@coqui.ai',
|
author_email="egolge@coqui.ai",
|
||||||
description='Deep learning for Text to Speech by Coqui.',
|
description="Deep learning for Text to Speech by Coqui.",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
license='MPL-2.0',
|
license="MPL-2.0",
|
||||||
# cython
|
# cython
|
||||||
include_dirs=numpy.get_include(),
|
include_dirs=numpy.get_include(),
|
||||||
ext_modules=cythonize(exts, language_level=3),
|
ext_modules=cythonize(exts, language_level=3),
|
||||||
# ext_modules=find_cython_extensions(),
|
# ext_modules=find_cython_extensions(),
|
||||||
# package
|
# package
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
packages=find_packages(include=['TTS*']),
|
packages=find_packages(include=["TTS*"]),
|
||||||
|
package_data={
|
||||||
|
"TTS": [
|
||||||
|
"VERSION",
|
||||||
|
]
|
||||||
|
},
|
||||||
project_urls={
|
project_urls={
|
||||||
'Documentation': 'https://github.com/coqui-ai/TTS/wiki',
|
"Documentation": "https://github.com/coqui-ai/TTS/wiki",
|
||||||
'Tracker': 'https://github.com/coqui-ai/TTS/issues',
|
"Tracker": "https://github.com/coqui-ai/TTS/issues",
|
||||||
'Repository': 'https://github.com/coqui-ai/TTS',
|
"Repository": "https://github.com/coqui-ai/TTS",
|
||||||
'Discussions': 'https://github.com/coqui-ai/TTS/discussions',
|
"Discussions": "https://github.com/coqui-ai/TTS/discussions",
|
||||||
},
|
},
|
||||||
cmdclass={
|
cmdclass={
|
||||||
'build_py': build_py,
|
"build_py": build_py,
|
||||||
'develop': develop,
|
"develop": develop,
|
||||||
# 'build_ext': build_ext
|
# 'build_ext': build_ext
|
||||||
},
|
},
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
|
@ -97,30 +99,25 @@ setup(
|
||||||
"notebooks": requirements_notebooks,
|
"notebooks": requirements_notebooks,
|
||||||
"tf": requirements_tf,
|
"tf": requirements_tf,
|
||||||
},
|
},
|
||||||
python_requires='>=3.6.0, <3.9',
|
python_requires=">=3.6.0, <3.9",
|
||||||
entry_points={
|
entry_points={"console_scripts": ["tts=TTS.bin.synthesize:main", "tts-server = TTS.server.server:main"]},
|
||||||
'console_scripts': [
|
|
||||||
'tts=TTS.bin.synthesize:main',
|
|
||||||
'tts-server = TTS.server.server:main'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.6",
|
"Programming Language :: Python :: 3.6",
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
'Development Status :: 3 - Alpha',
|
"Development Status :: 3 - Alpha",
|
||||||
"Intended Audience :: Science/Research",
|
"Intended Audience :: Science/Research",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Operating System :: POSIX :: Linux",
|
"Operating System :: POSIX :: Linux",
|
||||||
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
|
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
|
||||||
"Topic :: Software Development",
|
"Topic :: Software Development",
|
||||||
"Topic :: Software Development :: Libraries :: Python Modules",
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
||||||
"Topic :: Multimedia :: Sound/Audio",
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
"Topic :: Multimedia",
|
"Topic :: Multimedia",
|
||||||
"Topic :: Scientific/Engineering :: Artificial Intelligence"
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
||||||
],
|
],
|
||||||
zip_safe=False
|
zip_safe=False,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue