chore(updater): address deprecation of pkg_resources

as per module docstring:
This module is deprecated. Users are directed to importlib.resources,
importlib.metadata and packaging instead.
This commit is contained in:
Eugene Brodsky 2024-01-25 00:17:14 -05:00
parent 67ada70a26
commit 45bf2c7da6

View File

@ -5,8 +5,8 @@ pip install <path_to_git_source>.
import os
import platform
from distutils.version import LooseVersion
from importlib.metadata import PackageNotFoundError, distribution
import pkg_resources
import psutil
import requests
from rich import box, print
@ -89,12 +89,11 @@ def welcome(latest_release: str, latest_prerelease: str):
def get_extras():
extras = ""
try:
_ = pkg_resources.get_distribution("xformers")
distribution("xformers")
extras = "[xformers]"
except pkg_resources.DistributionNotFound:
pass
except PackageNotFoundError:
extras = ""
return extras