diff --git a/requirements.txt b/requirements.txt index fec48b05e..ebb271ddb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +setuptools packaging==23.1 jsonpath-rw regex @@ -9,7 +10,7 @@ requests>=2.31.0 questionary pyfiglet termcolor -grpcio==1.58.0 +grpcio mmh3 protobuf<=3.20.0 cachetools diff --git a/thingsboard_gateway/tb_utility/tb_updater.py b/thingsboard_gateway/tb_utility/tb_updater.py index 0a18cb496..9872983f5 100644 --- a/thingsboard_gateway/tb_utility/tb_updater.py +++ b/thingsboard_gateway/tb_utility/tb_updater.py @@ -18,8 +18,8 @@ from time import sleep, time from uuid import uuid1 -from pkg_resources import DistributionNotFound -from pkg_resources import get_distribution +from importlib.metadata import PackageNotFoundError +from importlib.metadata import version from requests import ConnectionError, post from simplejson import loads @@ -35,9 +35,9 @@ def __init__(self): super().__init__() try: - self.__version = {"current_version": get_distribution('thingsboard_gateway').version, - "latest_version": get_distribution('thingsboard_gateway').version} - except DistributionNotFound: + self.__version = {"current_version": version('thingsboard_gateway'), + "latest_version": version('thingsboard_gateway')} + except PackageNotFoundError: self.__version = {"current_version": "0.0", "latest_version": "0.0"} self.__instance_id = str(uuid1())