mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 06:26:03 +00:00
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
This commit is contained in:
parent
271445b2f2
commit
f7e34da3e9
8
setup.py
8
setup.py
@ -1,14 +1,16 @@
|
||||
import importlib.util
|
||||
import platform
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pkg_resources
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
|
||||
def read_version(fname="whisper/version.py"):
|
||||
exec(compile(open(fname, encoding="utf-8").read(), fname, "exec"))
|
||||
return locals()["__version__"]
|
||||
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 = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user