/home/windi/.pyenv/versions/3.12.4/lib/python3.12/site-packages/aws_msk_iam_sasl_signer/MSKAuthTokenProvider.py:11: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
It is a fairly trivial fix, just replace return f"{LIB_NAME}/{pkg_resources.get_distribution(LIB_NAME).version}" in __get_user_agent__() with return f"{LIB_NAME}/{importlib.metadata.version(LIB_NAME)}"
e.g.,
import importlib.metadata
# …
def __get_user_agent__():
"""
Builds the user-agent
Returns:
str: The user-agent identifying this signer library.
"""
return f"{LIB_NAME}/{importlib.metadata.version(LIB_NAME)}"
Description
pkg_resources
was removed in Python 3.12 and offloaded into thesetuptools
library. The recommendation (see https://setuptools.pypa.io/en/latest/pkg_resources.html) is to useimportlib.metadata
.Deprecatin warning:
It is a fairly trivial fix, just replace
return f"{LIB_NAME}/{pkg_resources.get_distribution(LIB_NAME).version}"
in__get_user_agent__()
withreturn f"{LIB_NAME}/{importlib.metadata.version(LIB_NAME)}"
e.g.,