Export __version__ at the module level (#258)

This commit is contained in:
Guillaume Klein
2023-05-24 15:50:37 +02:00
committed by GitHub
parent 4db549b800
commit cf7c021573
3 changed files with 14 additions and 1 deletions

View File

@@ -1,10 +1,12 @@
from faster_whisper.audio import decode_audio
from faster_whisper.transcribe import WhisperModel
from faster_whisper.utils import download_model, format_timestamp
from faster_whisper.version import __version__
__all__ = [
"decode_audio",
"WhisperModel",
"download_model",
"format_timestamp",
"__version__",
]

View File

@@ -0,0 +1,3 @@
"""Version information."""
__version__ = "0.5.1"

View File

@@ -11,6 +11,14 @@ def get_long_description():
return readme_file.read()
def get_project_version():
version_path = os.path.join(base_dir, "faster_whisper", "version.py")
version = {}
with open(version_path, encoding="utf-8") as fp:
exec(fp.read(), version)
return version["__version__"]
def get_requirements(path):
with open(path, encoding="utf-8") as requirements:
return [requirement.strip() for requirement in requirements]
@@ -23,7 +31,7 @@ conversion_requires = get_requirements(
setup(
name="faster-whisper",
version="0.5.1",
version=get_project_version(),
license="MIT",
description="Faster Whisper transcription with CTranslate2",
long_description=get_long_description(),