diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index ab4e9960..3e526e60 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -42,7 +42,7 @@ jobs: branch=${github_ref#*refs/heads/} # strip prefix to get branch name tags="${base}:${branch},${base}:${{ github.sha }}," elif [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]]; then - VERSION="v$(cat TTS/VERSION)" + VERSION="v$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o)" if [[ "${{ github.ref }}" != "refs/tags/${VERSION}" ]]; then echo "Pushed tag does not match VERSION file. Aborting push." exit 1 diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index 78ab5398..14c956fc 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -14,7 +14,7 @@ jobs: - name: Verify tag matches version run: | set -ex - version=$(cat TTS/VERSION) + version=$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o) tag="${GITHUB_REF/refs\/tags\/}" if [[ "v$version" != "$tag" ]]; then exit 1 diff --git a/MANIFEST.in b/MANIFEST.in index 321d3999..498b33c0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ include LICENSE.txt include requirements.*.txt include *.cff include requirements.txt -include TTS/VERSION recursive-include TTS *.json recursive-include TTS *.html recursive-include TTS *.png diff --git a/TTS/VERSION b/TTS/VERSION deleted file mode 100644 index 610e2872..00000000 --- a/TTS/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.23.1 diff --git a/TTS/__init__.py b/TTS/__init__.py index eaf05db1..e69de29b 100644 --- a/TTS/__init__.py +++ b/TTS/__init__.py @@ -1,6 +0,0 @@ -import os - -with open(os.path.join(os.path.dirname(__file__), "VERSION"), "r", encoding="utf-8") as f: - version = f.read().strip() - -__version__ = version diff --git a/docs/source/conf.py b/docs/source/conf.py index b85324fd..200a487f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,6 +10,7 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # +import importlib.metadata import os import sys @@ -23,13 +24,10 @@ project = 'TTS' copyright = "2021 Coqui GmbH, 2020 TTS authors" author = 'Coqui GmbH' -with open("../../TTS/VERSION", "r") as ver: - version = ver.read().strip() - # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. -release = version +release = importlib.metadata.version(project) # The main toctree document. master_doc = "index" diff --git a/pyproject.toml b/pyproject.toml index d10b78f7..b58716e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ include = ["TTS*"] [project] name = "coqui-tts" +version = "0.23.1" description = "Deep learning for Text to Speech." readme = "README.md" requires-python = ">=3.9, <3.13" diff --git a/setup.py b/setup.py index 7180f48b..722959cd 100644 --- a/setup.py +++ b/setup.py @@ -31,8 +31,6 @@ 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 @@ -70,7 +68,6 @@ exts = [ ) ] setup( - version=version, # cython include_dirs=numpy.get_include(), ext_modules=cythonize(exts, language_level=3),