mirror of
https://github.com/openai/whisper.git
synced 2025-11-24 14:35:57 +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 platform
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pkg_resources
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
|
|
||||||
|
|
||||||
def read_version(fname="whisper/version.py"):
|
def read_version(fname="whisper/version.py"):
|
||||||
exec(compile(open(fname, encoding="utf-8").read(), fname, "exec"))
|
spec = importlib.util.spec_from_file_location("version", fname)
|
||||||
return locals()["__version__"]
|
version_module = importlib.util.module_from_spec(spec)
|
||||||
|
spec.loader.exec_module(version_module)
|
||||||
|
return version_module.__version__
|
||||||
|
|
||||||
|
|
||||||
requirements = []
|
requirements = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user