whisper/setup.py
Christian Clauss f7e34da3e9
setup.py: Remove deprecated pkg_resources in favor of importlib.util
Remove deprecated `pkg_resources` in favor of `importlib.util`.

Fixes this warning at install-time:
> DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
2024-11-12 04:05:16 +01:00

45 lines
1.3 KiB
Python

import importlib.util
import platform
import sys
from pathlib import Path
from setuptools import find_packages, setup
def read_version(fname="whisper/version.py"):
spec = importlib.util.spec_from_file_location("version", fname)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
return version_module.__version__
requirements = []
if sys.platform.startswith("linux") and platform.machine() == "x86_64":
requirements.append("triton>=2.0.0")
setup(
name="openai-whisper",
py_modules=["whisper"],
version=read_version(),
description="Robust Speech Recognition via Large-Scale Weak Supervision",
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
readme="README.md",
python_requires=">=3.8",
author="OpenAI",
url="https://github.com/openai/whisper",
license="MIT",
packages=find_packages(exclude=["tests*"]),
install_requires=[
str(r)
for r in pkg_resources.parse_requirements(
Path(__file__).with_name("requirements.txt").open()
)
],
entry_points={
"console_scripts": ["whisper=whisper.transcribe:cli"],
},
include_package_data=True,
extras_require={"dev": ["pytest", "scipy", "black", "flake8", "isort"]},
)